query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
1084dd45abe9350061dc989703de9f89
PUT /experts/1 PUT /experts/1.xml
[ { "docid": "215a75a1539b66a4d05cd0d9529f4996", "score": "0.72476035", "text": "def update\n @expert = Expert.find(params[:id])\n\n respond_to do |format|\n if @expert.update_attributes(params[:expert])\n format.html { redirect_to(@expert, :notice => 'Expert was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @expert.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "68d14143b04f545d40404e93e9ce829f", "score": "0.70226", "text": "def update\n @expert = Expert.find(params[:id])\n\n respond_to do |format|\n if @expert.update_attributes(params[:expert])\n format.html { redirect_to @expert, notice: 'Expert was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @expert.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c582dce20d54524e8fe6193d470baeff", "score": "0.6654927", "text": "def update\n respond_to do |format|\n if @expert.update(expert_params)\n format.html { redirect_to admin_experts_path, notice: t('shared.msgs.success_updated',\n obj: t('activerecord.models.expert', count: 1)) }\n else\n format.html { render :edit }\n end\n end\n end", "title": "" }, { "docid": "f63317aae40908d905a31c63d4b32168", "score": "0.6636381", "text": "def set_expert\n @expert = Expert.find(params[:id])\n end", "title": "" }, { "docid": "f63317aae40908d905a31c63d4b32168", "score": "0.6636381", "text": "def set_expert\n @expert = Expert.find(params[:id])\n end", "title": "" }, { "docid": "70818f342f12434da4191f8ce748d8db", "score": "0.6546761", "text": "def update\n @expert = Expert.find(params[:id])\n\t@expert.update_by = current_user.email\n respond_to do |format|\n if @expert.update_attributes(params[:expert])\n\t\tflash[:success] = 'Daten wurden gespeichert.'\n format.html { redirect_to experts_url }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @expert.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "35eb20305be51183932e8ff9d22842a8", "score": "0.64834315", "text": "def update\n @expertise = Expertise.find(params[:id])\n\n respond_to do |format|\n if @expertise.update_attributes(params[:expertise])\n format.html { redirect_to @expertise, notice: 'Expertise was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @expertise.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d952b95157d424b28661d23714b3c1cf", "score": "0.6464207", "text": "def update\n @expertise = Expertise.find(params[:id])\n\n respond_to do |format|\n if @expertise.update_attributes(params[:expertise])\n format.html { redirect_to @expertise, notice: 'Expertise was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @expertise.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cf583761ec34ccd347435d13de1b2aac", "score": "0.6290467", "text": "def update\n @expert.user = current_user\n\n if @expert.update_attributes(params[:expert])\n flash[:notice] = t('messages.expert.success.save')\n redirect_to expert_url(@expert)\n else\n flash.now[:alert] = t('messages.expert.errors.save')\n render_form(:edit)\n end\n end", "title": "" }, { "docid": "6919f2f508c23e13420fe996a044d99b", "score": "0.6286048", "text": "def update\n @expert_opinion.update(expert_opinions_params)\n json_response(@expert_opinion)\n end", "title": "" }, { "docid": "89f9544d0799c21075170b38e35f2798", "score": "0.62412643", "text": "def create\n @expert = Expert.new(params[:expert])\n\n respond_to do |format|\n if @expert.save\n format.html { redirect_to(@expert, :notice => 'Expert was successfully created.') }\n format.xml { render :xml => @expert, :status => :created, :location => @expert }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @expert.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "593db678b768e699ff03467bd6256ed0", "score": "0.6110502", "text": "def update\n @expert = Expert.find(params[:id])\n\n respond_to do |format|\n if @expert.update_attributes(params[:expert])\n\t flash[:success] = \"Profile updated\"\r\n\t\tsign_in @expert\n\n format.html { redirect_to @expert }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @expert.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3e74d91f4b1e609f9297ccc4cb487b9a", "score": "0.602579", "text": "def update\n if @expert_topic.update(expert_topic_params)\n render :show, status: :ok, location: @expert_topic\n else\n render json: @expert_topic.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "3185b6a67597e5ed8dd88f4d1947f51f", "score": "0.6020864", "text": "def update\n respond_to do |format|\n if @expertise.update(expertise_params)\n format.html { redirect_to @expertise, notice: 'Expertise was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @expertise.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e4cb1862eaf2384da2a19e999460c418", "score": "0.59978986", "text": "def set_expert_opinion\n @expert_opinion = ExpertOpinion.find(params[:id])\n end", "title": "" }, { "docid": "6e0738103146a011be768623e07ca2ab", "score": "0.5943459", "text": "def create\n @expert = Expert.new(params[:expert])\n\n respond_to do |format|\n if @expert.save\n format.html { redirect_to @expert, notice: 'Expert was successfully created.' }\n format.json { render json: @expert, status: :created, location: @expert }\n else\n format.html { render action: \"new\" }\n format.json { render json: @expert.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5f313903a937ebd1aeb7235615c908ee", "score": "0.59340394", "text": "def destroy\n @expert = Expert.find(params[:id])\n @expert.destroy\n\n respond_to do |format|\n format.html { redirect_to(experts_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "efe8137dd70d20d363ccc809eb15fb50", "score": "0.5860783", "text": "def set_expert_topic\n @expert_topic = ExpertTopic.find(params[:id])\n end", "title": "" }, { "docid": "d5ba185f5bb353dc4245323d2aa1b623", "score": "0.585899", "text": "def set_expertise\n @expertise = Expertise.find(params[:id])\n end", "title": "" }, { "docid": "ff19521b336e79f3c0b05adb4020bf57", "score": "0.58529776", "text": "def create\n @expert = Expert.new(expert_params)\n\n respond_to do |format|\n if @expert.save\n format.html { redirect_to admin_experts_path, notice: t('shared.msgs.success_created',\n obj: t('activerecord.models.expert', count: 1)) }\n else\n format.html { render :new }\n end\n end\n end", "title": "" }, { "docid": "563bf85246c80485c931e469c7451e47", "score": "0.58386236", "text": "def show\n @expert = Expert.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @expert }\n end\n end", "title": "" }, { "docid": "db5182f34083d76abc3dbe0e0bd5fcf3", "score": "0.5721888", "text": "def update\n respond_to do |format|\n if @expert_form.update(expert_form_params)\n format.html { redirect_to @expert_form, notice: 'Schätzungsformular wurde erfolgreich aktualisiert' }\n format.json { render :show, status: :ok, location: @expert_form }\n else\n format.html { render :edit }\n format.json { render json: @expert_form.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ad54471b285e5e357d9be959c8ade2d8", "score": "0.5721277", "text": "def update\n path = \"/workflow/#{repo}/objects/druid:#{druid}/workflows/#{workflow}/#{step}\"\n conn = Faraday.new(url: config['host'])\n conn.basic_auth(config['user'], config['password'])\n conn.headers['content-type'] = 'application/xml'\n\n conn.put path, payload\n end", "title": "" }, { "docid": "4ac7eead209cb686e70a6d29c95ff83f", "score": "0.5720475", "text": "def update\n @exam = Exam.find(params[:id])\n\n respond_to do |format|\n if @exam.update_attributes(params[:exam])\n format.html { redirect_to(signature_part_exam_url(@signature, @part, @exam), :notice => 'El examen se modifico correctamente..') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @exam.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2f43d79cb8ce757f5e82d8476fd01962", "score": "0.56879085", "text": "def test_should_update_topic_via_API_XML\r\n get \"/logout\"\r\n put \"/forum_topics/1.xml\", :forum_topic => {:title=>'Updated API Test Topic',\r\n :description=>'Updated Test topic desc',\r\n :user_id=>1}\r\n assert_response 401\r\n end", "title": "" }, { "docid": "a7188b5423261fe1cf1216a6d3aa1167", "score": "0.56669736", "text": "def update\n respond_to do |format|\n if @exam.update_attributes(params[:exam])\n format.html { redirect_to(@exam, :notice => 'Exam was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @exam.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e951b22643743865f3f0ff93d8c373bf", "score": "0.56494266", "text": "def update\n respond_to do |format|\n if @exam.update_attributes(params[:exam])\n flash[:notice] = 'Exam was successfully updated.'\n format.html { redirect_to(@exam) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @exam.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "390e93b39e6284649cf807ea2531b544", "score": "0.5647024", "text": "def destroy\n @expert = Expert.find(params[:id])\n @expert.destroy\n\n respond_to do |format|\n format.html { redirect_to experts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cb5ecbc4c0dc5210caee9ae64cb75ec4", "score": "0.5608891", "text": "def set_expert_form\n @expert_form = ExpertForm.find(params[:id])\n end", "title": "" }, { "docid": "360ed50b58139634be92b67e4a205815", "score": "0.5597646", "text": "def new\n @expert = Expert.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @expert }\n end\n end", "title": "" }, { "docid": "bf8d0e6ecdce9b865c8758df2296e569", "score": "0.55679995", "text": "def update\n @examquestion = Examquestion.find(params[:id])\n\n respond_to do |format|\n if @examquestion.update_attributes(params[:examquestion])\n flash[:notice] = 'Examquestion was successfully updated.'\n format.html { redirect_to(@examquestion) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @examquestion.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "45c402177b75619b39d58f46a56ac845", "score": "0.5561926", "text": "def update\n @exam_question = ExamQuestion.find(params[:id])\n\n respond_to do |format|\n if @exam_question.update_attributes(params[:exam_question])\n format.html { redirect_to(@exam_question, :notice => 'Exam question was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @exam_question.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "23c4f2950134d2e9ef2f1943fc41e245", "score": "0.5560128", "text": "def update\n @expert_company = ExpertCompany.find(params[:id])\n\n #respond_to do |format|\n if @expert_company.update_attributes(params[:expert_company])\n flash[:notice] = 'ExpertCompany was successfully updated.'\n redirect_to('/expert_professionals')\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @expert_company.errors, :status => :unprocessable_entity }\n end\n #end\n end", "title": "" }, { "docid": "a620bba45004fb7d48c2dbe64b39e868", "score": "0.55257535", "text": "def update\n raise\n @expence_perticuler = ExpencePerticuler.find(params[:id])\n\n respond_to do |format|\n if @expence_perticuler.update_attributes(params[:expence_perticuler])\n flash[:notice] = 'ExpencePerticuler was successfully updated.'\n format.html { redirect_to(@expence_perticuler) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @expence_perticuler.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eb8489d9603d065f1dceadd41f96d41c", "score": "0.55126405", "text": "def update\n @exercise_set = ExerciseSet.find(params[:id])\n\n respond_to do |format|\n if @exercise_set.update_attributes(params[:exercise_set])\n format.html { redirect_to(@exercise_set, :notice => 'Exercise set was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @exercise_set.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5ade8dfc9697f73f168894a24ab2bb6b", "score": "0.55106384", "text": "def update\r\n @experience = Experience.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @experience.update_attributes(params[:experience])\r\n format.html { redirect_to @experience, notice: 'Discussion Topic 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: @experience.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "23b5f5e4dacfb330cb1e0ffd4590ef63", "score": "0.55072635", "text": "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post opts.fetch(:path, update_path), opts\n end", "title": "" }, { "docid": "a43fbdec4959f583f513a6420b27554a", "score": "0.5506708", "text": "def expert_params\n params.require(:expert)\n .permit(:id, :profile_title, :services, :first_name,\n :last_name, :tel, :birthdate)\n end", "title": "" }, { "docid": "59deefe5047fac9ee064b566e80c9b05", "score": "0.54816437", "text": "def show\n @expert = Expert.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @expert }\n end\n end", "title": "" }, { "docid": "e2e55a6ecb4c00b7fe18a670cc021207", "score": "0.5471168", "text": "def put_entry(id,summary)\n xml = <<DATA\n <entry xmlns=\"http://purl.org/atom/ns#\">\n <summary type=\"text/plain\"></summary>\n </entry>\nDATA\n\n doc = REXML::Document.new(xml)\n doc.elements['/entry/summary'].add_text(summary)\n\n # REXML -> String\n data=String.new\n doc.write(data)\n\n #make request\n path=\"/atom/edit/#{id}\"\n req=Net::HTTP::Put.new(path)\n req['Accept']= 'application/x.atom+xml,application/xml,text/xml,*/*',\n req['X-WSSE']= @credential_string\n\n #YHAAAA!!!\n res = @http.request(req,data)\n return res\n end", "title": "" }, { "docid": "9562430560671e11fbba16e75a6a575f", "score": "0.5468068", "text": "def update\n @exam = Exam.find(params[:id])\n\n respond_to do |format|\n if @exam.update_attributes(params[:exam])\n format.html { redirect_to @exam, notice: 'Exam was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @exam.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9562430560671e11fbba16e75a6a575f", "score": "0.5468068", "text": "def update\n @exam = Exam.find(params[:id])\n\n respond_to do |format|\n if @exam.update_attributes(params[:exam])\n format.html { redirect_to @exam, notice: 'Exam was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @exam.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9562430560671e11fbba16e75a6a575f", "score": "0.5468068", "text": "def update\n @exam = Exam.find(params[:id])\n\n respond_to do |format|\n if @exam.update_attributes(params[:exam])\n format.html { redirect_to @exam, notice: 'Exam was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @exam.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9562430560671e11fbba16e75a6a575f", "score": "0.5468068", "text": "def update\n @exam = Exam.find(params[:id])\n\n respond_to do |format|\n if @exam.update_attributes(params[:exam])\n format.html { redirect_to @exam, notice: 'Exam was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @exam.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "03e4b22a3804a4b84a397d48a1cca436", "score": "0.54345447", "text": "def update\n @recommend_expert_category = Recommend::ExpertCategory.find(params[:id])\n\n respond_to do |format|\n if @recommend_expert_category.update_attributes(params[:recommend_expert_category])\n format.html { redirect_to @recommend_expert_category, notice: 'Expert category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @recommend_expert_category.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9e3eef8f11cd18a61cd3daf5f4856033", "score": "0.5422387", "text": "def update\n @practice_log = PracticeLog.find(params[:id])\n\n respond_to do |format|\n if @practice_log.update_attributes(params[:practice_log])\n format.html { redirect_to(practice_logs_path, :notice => t('ccicc.updated', :model => PracticeLog.model_name.human)) }\n format.xml { head :ok }\n else\n format.html {\n @expertises = Expertise.all.collect{ |e| [e.name, e.id] }\n @practice_log.reset_values!\n render :action => \"edit\"\n }\n format.xml { render :xml => @practice_log.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "24177b5626837a078d82ab2f4fde808e", "score": "0.5422227", "text": "def update_rest\n @entry_question = EntryQuestion.find(params[:id])\n\n respond_to do |format|\n if @entry_question.update_attributes(params[:entry_question])\n flash[:notice] = 'EntryQuestion was successfully updated.'\n format.html { redirect_to(@entry_question) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @entry_question.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38979984bdedacd95706689e25f09f9e", "score": "0.54160625", "text": "def put(document, method='')\n @resource[method].put(document.to_s, :content_type => 'text/xml')\n end", "title": "" }, { "docid": "e74c49af3274c11069adf397289699ba", "score": "0.54159427", "text": "def update\n respond_to do |format|\n if @artist_expertise.update(artist_expertise_params)\n format.html { redirect_to @artist_expertise, notice: 'Artist expertise was successfully updated.' }\n format.json { render :show, status: :ok, location: @artist_expertise }\n else\n format.html { render :edit }\n format.json { render json: @artist_expertise.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9304de5503923dbf61e5cf3ebe7e3c9b", "score": "0.5415422", "text": "def update\n @assist = Assist.find(params[:id])\n\n respond_to do |format|\n if @assist.update_attributes(params[:assist])\n format.html { redirect_to @assist, :notice => 'Assist was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @assist.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "61e7d54be196a12ae646b64377b9fc67", "score": "0.5391192", "text": "def set_expertlead\n @expertlead = Expertlead.find(params[:id])\n end", "title": "" }, { "docid": "dc3ab5da5ab23c883d6b6ea37083aba1", "score": "0.5386755", "text": "def update\n @lexique = Lexique.find(params[:id])\n\n respond_to do |format|\n if @lexique.update_attributes(params[:lexique])\n format.html { redirect_to(@lexique, :notice => 'Lexique was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @lexique.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "825b55e635299885e917e600e085ce23", "score": "0.53865457", "text": "def set_expertise\n @expertise = current_user.expertises.find(params[:id])\n end", "title": "" }, { "docid": "c99238efa98a6e05678c5d303dd5515d", "score": "0.53830254", "text": "def update_ticket(ticket_num)\n \n url = ['/tickets/',ticket_num,'.xml'].join\n result = @connection.put url, \n (\n xml = Builder::XmlMarkup.new( :indent => 2 )\n xml.instruct! :xml, :encoding => \"UTF-8\"\n xml.ticket do |t|\n t.tag! \"solved-at\", Time.now\n t.tag! \"status-id\", \"3\"\n end\n )\n end", "title": "" }, { "docid": "e335843cca0bf6fd075487b23692a490", "score": "0.5374807", "text": "def update\n @exercise_type = ExerciseType.find(params[:id])\n\n respond_to do |format|\n if @exercise_type.update_attributes(params[:exercise_type])\n format.html { redirect_to(@exercise_type, :notice => 'Exercise type was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @exercise_type.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a88bbb05c2bd534001685d017dfedc09", "score": "0.53658026", "text": "def create\n\t\t@expert = Expert.new(params[:expert])\n\t\t@expert.created_by = current_user.email\n\t\t#read_last_page\n\t\trespond_to do |format|\n\t\tif @expert.save\n\t\t\tflash[:success] = 'Der Experte wurde gespeichert.'\n\t\t\tformat.html { redirect_to experts_path }\n\t\t\tformat.json { render json: @expert, status: :created, location: @expert }\n\t\telse\n\t\t\tformat.html { render action: \"new\"}\n\t\t\tformat.json { render json: @expert.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eda0cce709598b113c81ddd431399ec4", "score": "0.5365177", "text": "def update\n @defect = Defect.find(params[:id])\n\n respond_to do |format|\n if @defect.update_attributes(params[:defect])\n format.html { redirect_to @defect, notice: 'Defect was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @defect.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fddf5db4ca5b4fb33dec813140a79779", "score": "0.5361005", "text": "def update\n respond_to do |format|\n if @expert_survey.update(expert_survey_params)\n format.html { redirect_to admin_quarter_expert_survey_path(quarter_id: @quarter.slug), notice: t('shared.msgs.success_updated',\n obj: t('activerecord.models.expert_survey', count: 1)) }\n else\n format.html { render :edit }\n end\n end\n end", "title": "" }, { "docid": "cccedbc650e23974fd4e4a3d738acb54", "score": "0.53536415", "text": "def update\n @especie = Especie.find(params[:id])\n\n respond_to do |format|\n if @especie.update_attributes(params[:especie])\n flash[:notice] = 'Espécie foi atualizada com sucesso.'\n format.html { redirect_to(@especie) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @especie.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f86b7ef861845315a4c12355c90c8434", "score": "0.5349901", "text": "def update\n respond_to do |wants|\n if @education.update_attributes(params[:education])\n flash[:notice] = 'Education was successfully updated.'\n wants.html { redirect_to(@education) }\n wants.xml { head :ok }\n else\n wants.html { render :action => \"edit\" }\n wants.xml { render :xml => @education.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "11b3b4fade43f455ad338a4ed7a05caf", "score": "0.5349802", "text": "def update\n respond_to do |format|\n if @expertlead.update(expertlead_params)\n format.html { redirect_to @expertlead, notice: 'Expertlead was successfully updated.' }\n format.json { render :show, status: :ok, location: @expertlead }\n else\n format.html { render :edit }\n format.json { render json: @expertlead.errors, status: :unprocessable_entity }\n end\n end\n authorize! :update, @expertlead\n end", "title": "" }, { "docid": "782e93fb20139c9c2383ed777c70744c", "score": "0.5343615", "text": "def update\n @exam = @course.exams.find(params[:id])\n\n respond_to do |format|\n if @exam.update_attributes(params[:exam])\n format.html { redirect_to [:teacher, @course, @exam], :notice => 'Exam was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @exam.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4e73139db4bdafe9e0ee1a9dd5a6508a", "score": "0.53341854", "text": "def update\n @exam = Exam.find(params[:id])\n\n if @exam.update!(exam_params)\n render json: @exam, status: :ok\n else\n render json: @exam.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "313d43dbee04c45759fc81d18061c56b", "score": "0.5333296", "text": "def update\n @exercise = Exercise.find(params[:id])\n\n respond_to do |format|\n if @exercise.update_attributes(params[:exercise])\n format.html { redirect_to(@exercise, :notice => 'Exercise was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @exercise.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2e31b445d35752f94361436284b7c095", "score": "0.5323268", "text": "def update\n @exam_type = ExamType.find(params[:id])\n\n respond_to do |format|\n if @exam_type.update_attributes(params[:exam_type])\n format.html { redirect_to @exam_type, notice: 'Exam type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @exam_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a91213a81bb9835043d9ecf8ed7cc4f6", "score": "0.53213525", "text": "def update\n @question = @test.questions.find(params[:id])\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to([@test,@question]) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @question.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cfe4bb0d612ae169188e8ea7a9ae7df0", "score": "0.53186184", "text": "def edit_exam\n @exam = Exam.find(params[:id])\n @questions = @exam.questions.find(:all)\n @all_questions = Question.find(:all)\n end", "title": "" }, { "docid": "15d00dde791897f637ba36b8e30ad34a", "score": "0.5317436", "text": "def update\n @specie = Species.find(params[:id])\n respond_to do |format|\n if @specie.update_attributes(params[:specie])\n format.html { redirect_to(@specie, :notice => 'Specie was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @specie.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1436a31c430982a56b1626b4e2c0482c", "score": "0.5314162", "text": "def update\n @exercise = Exercise.find(params[:id])\n\n respond_to do |format|\n if @exercise.update_attributes(params[:exercise])\n flash[:notice] = 'Exercise was successfully updated.'\n format.html { redirect_to(exercises_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @exercise.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "48ef1d9e16ebb2d139107e75a569469a", "score": "0.53089297", "text": "def update\n update_resource_response(@help_article, help_article_params)\n end", "title": "" }, { "docid": "e284838eb3764bbdcd46b86e7d362af2", "score": "0.5308213", "text": "def update\n @exercise = Exercise.find(params[:id])\n\n respond_to do |format|\n if @exercise.update_attributes(params[:exercise])\n flash[:notice] = 'Exercise was successfully updated.'\n format.html { redirect_to(@exercise) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @exercise.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a70ac24b3788fb2f203c71695df4ebcc", "score": "0.53067356", "text": "def create\n @expertise = Expertise.new(params[:expertise])\n @expertise.user = current_user\n @expertise.positive = 0\n @expertise.negative = 0\n\n respond_to do |format|\n if @expertise.save\n format.html { redirect_to current_user, notice: 'Expertise was successfully created.' }\n format.json { render json: @expertise, status: :created, location: @expertise }\n else\n format.html { render action: \"new\" }\n format.json { render json: @expertise.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4caeb7091b59a197df7f95ce9d80da21", "score": "0.53065187", "text": "def update\n @exam_question = ExamQuestion.find(params[:id])\n\n respond_to do |format|\n if @exam_question.update_attributes(params[:exam_question])\n format.html { redirect_to @exam_question, notice: 'Exam question was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @exam_question.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "60e5d05992da254bac8b2a396e2bb575", "score": "0.53056556", "text": "def update\n @question = @exam.questions.find(params[:id])\n\n respond_to do |format|\n if @question.update_attributes(params[:question])\n format.html { redirect_to [:teacher, @course, @exam, @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", "title": "" }, { "docid": "99892939cfa60fe3c11ad4640df1325a", "score": "0.53024256", "text": "def update\n @people = People.find(params[:id])\n respond_to do |format|\n if @people.update_attributes(params[:people])\n format.html { redirect_to(@people) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @people.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6d33dab8b34dac9d2fe4abfd6f63a459", "score": "0.5299001", "text": "def update\n @exemplar = Exemplar.find(params[:id])\n\n respond_to do |format|\n if @exemplar.update_attributes(params[:exemplar])\n format.html { redirect_to @exemplar, notice: 'Exemplar was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @exemplar.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9022ca8ed3937235b0be5594d370afdf", "score": "0.52979255", "text": "def set_essence\n @essence = Essence.find(params[:id])\n end", "title": "" }, { "docid": "193f2ca8d5f1cc4b248587329ea37aa2", "score": "0.52958405", "text": "def update\n @exercise = Exercise.find(params[:id])\n\n respond_to do |format|\n if @exercise.update_attributes(params[:exercise])\n flash[:notice] = 'Exercise was successfully updated.'\n format.html { redirect_to(:back) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @exercise.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c47bfa32ac5adacb237105ed64501ae8", "score": "0.5287051", "text": "def update\n @exp_perticuler = ExpPerticuler.find(params[:id])\n\n respond_to do |format|\n if @exp_perticuler.update_attributes(params[:exp_perticuler])\n flash[:notice] = 'ExpPerticuler was successfully updated.'\n format.html { redirect_to(@exp_perticuler) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @exp_perticuler.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f838235f82d6811b116276f1c97a950e", "score": "0.52846843", "text": "def update\n @applicant = Person.find(params[:id])\n\n respond_to do |format|\n if @applicant.update_attributes(params[:person])\n flash[:notice] = 'person was successfully updated.'\n format.html { redirect_to general_answer_path }\n format.xml { head :ok }\n else\n format.html { render :action => \"index\" }\n format.xml { render :xml => @general_answer.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1cc707113f3c5fd4b3732a560ee63c60", "score": "0.52766025", "text": "def update\n @expence = Expence.find(params[:id])\n\n respond_to do |format|\n if @expence.update_attributes(params[:expence])\n format.html { redirect_to @expence, notice: 'Expence was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @expence.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "37bb181464f642508c933106d1666838", "score": "0.5275495", "text": "def update\n @exercise = Exercise.find(params[:id])\n @exercise.update_attributes(params[:exercise])\n respond_with(@exercise)\n end", "title": "" }, { "docid": "885bbdf78882cf9a3bcfd4fbc29a9027", "score": "0.52719575", "text": "def update_exam\n @exam = Exam.find(params[:id])\n\n respond_to do |format|\n if @exam.update_attributes(params[:exam])\n flash[:notice] = \"Exam #{@exam.name} was successfully updated.\"\n format.html { redirect_to(:action=>:index) }\n else\n format.html { render :action => \"edit_exam\" }\n end\n end\n end", "title": "" }, { "docid": "9052df9f8c8561d959b3e8cd650b30fb", "score": "0.5270599", "text": "def create\n @expert = current_user.experts.build(params[:expert])\n\n if @expert.save\n flash[:notice] = t('messages.expert.success.create', name: @expert.name)\n redirect_to expert_url(@expert)\n else\n flash.now[:alert] = t('messages.expert.errors.create')\n render_form(:new)\n end\n end", "title": "" }, { "docid": "848024ad9f4d5bee693b3394d4ffdacc", "score": "0.52694136", "text": "def update\n @examtemplate = Examtemplate.find(params[:id])\n\n respond_to do |format|\n if @examtemplate.update_attributes(params[:examtemplate])\n format.html { redirect_to(@examtemplate, :notice => 'Examtemplate was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @examtemplate.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "178de62e692d45b965b7b238763c2782", "score": "0.5268129", "text": "def update\n @fault = Fault.find(params[:id])\n\n respond_to do |format|\n if @fault.update_attributes(params[:fault])\n flash[:notice] = 'Fault was successfully updated.'\n format.html { redirect_to(@fault) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @fault.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "faac8eb10f482b225a48d3eb9ffb60d4", "score": "0.5267237", "text": "def update\n @threat_type = ThreatType.find(params[:id])\n\n respond_to do |format|\n if @threat_type.update_attributes(params[:threat_type])\n format.html { redirect_to(@threat_type, :notice => 'Threat type was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @threat_type.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "71625c07399d744b7c09a9963de67f83", "score": "0.5264033", "text": "def update\n @tool_kit = ToolKit.find(params[:id])\n\n respond_to do |format|\n if @tool_kit.update_attributes(params[:tool_kit])\n format.html { redirect_to(@tool_kit, :notice => 'Tool kit was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tool_kit.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "56e46996b270e5f9b0e163c598c1f067", "score": "0.5263013", "text": "def update\n @exam = Exam.find(params[:id])\n respond_to do |format|\n if @exam.update(exam_params)\n format.html { redirect_to @exam, notice: 'Exam was successfully updated.' }\n format.json { render :show, status: :ok, location: @exam }\n else\n format.html { render :edit }\n format.json { render json: @exam.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "983973f93c01426d56cce96a49cc274e", "score": "0.52627766", "text": "def update\n @threat = Threat.find(params[:id])\n\n respond_to do |format|\n if @threat.update_attributes(params[:threat])\n format.html { redirect_to @threat, notice: 'Threat was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @threat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cde5551416496ed3cd9b3ba6ac01c866", "score": "0.525495", "text": "def destroy\n @expert = Expert.find(params[:id])\n @expert.destroy\n\n respond_to do |format|\n\t flash[:success] = \"User destroyed.\"\n format.html { redirect_to experts_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "f5345d87f477e4a4fef9d5091e32492c", "score": "0.525426", "text": "def update\n @exoplanet = Exoplanet.find(params[:id])\n\n respond_to do |format|\n if @exoplanet.update_attributes(params[:exoplanet])\n format.html { redirect_to @exoplanet, :notice => 'Exoplanet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @exoplanet.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fed2563f983d9391d2837576be98fbfd", "score": "0.5252257", "text": "def update\n @examresult = Examresult.find(params[:id]) \n respond_to do |format|\n if @examresult.update_attributes(params[:examresult])\n format.html { redirect_to(@examresult, :notice => t('examresult.title2')+\" \"+t('created')) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @examresult.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "42284e1151c97a5dad37a0feb7f32869", "score": "0.5252035", "text": "def update\n @exame = Exame.find(params[:id])\n\n respond_to do |format|\n if @exame.update_attributes(params[:exame])\n flash[:notice] = 'Exame was successfully updated.'\n format.html { redirect_to(@exame) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @exame.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "36e54ca64fb2b50983437cc2ca65008f", "score": "0.5251639", "text": "def update\n @assistant = Assistant.find(params[:id])\n\n respond_to do |format|\n if @assistant.update_attributes(params[:assistant])\n format.html { redirect_to(@assistant, :notice => 'Assistant was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @assistant.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "943d5f1ee2cc6ed31bfa626e33828611", "score": "0.52489835", "text": "def update\n @admin_expence = Expence.find(params[:id])\n\n respond_to do |format|\n if @admin_expence.update_attributes(params[:admin_expence])\n format.html { redirect_to @admin_expence, notice: 'Expence was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_expence.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ed092d1c51f3bcfd0668abb5049522b0", "score": "0.5246073", "text": "def update\n @xaction = Xaction.find(params[:id])\n\n respond_to do |format|\n if @xaction.update_attributes(params[:xaction])\n flash[:notice] = 'Xaction was successfully updated.'\n format.html { redirect_to(@xaction) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @xaction.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0993a49859b479e5ffb3319ea5d7ca6c", "score": "0.5244937", "text": "def update\n respond_to do |format|\n if @essence.update(essence_params)\n format.html { redirect_to @essence, notice: 'Essence was successfully updated.' }\n format.json { render :show, status: :ok, location: @essence }\n else\n format.html { render :edit }\n format.json { render json: @essence.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3e1c422b5892c3953bdba823b8753738", "score": "0.5234527", "text": "def update\n #@experiment = Experiment.find(params[:id])\n\n respond_to do |format|\n if @experiment.update_attributes(params[:experiment])\n flash[:notice] = 'Experiment was successfully updated.'\n format.html { redirect_to(@experiment) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @experiment.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "63864aeebe6f50e8bae405706afb75cb", "score": "0.52262324", "text": "def update\n @user_threat = UserThreat.find(params[:id])\n\n respond_to do |format|\n if @user_threat.update_attributes(params[:user_threat])\n format.html { redirect_to(@user_threat, :notice => 'User threat was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user_threat.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6adf7636e95dda14969e72e1d9684904", "score": "0.5224144", "text": "def update\n respond_to do |format|\n if @essential.update(essential_params)\n format.html { redirect_to @essential, notice: 'Essential was successfully updated.' }\n format.json { render :show, status: :ok, location: @essential }\n else\n format.html { render :edit }\n format.json { render json: @essential.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
7e9280392e29d674d36834be0684ad93
Returns an array of 4 String tokens by splitting +query_string+
[ { "docid": "363e93d6e59dba79ee75f4a76bac155d", "score": "0.74627364", "text": "def tokenize(query_string)\n query_string.strip!\n if match = query_string.match(QUERY_PATTERN)\n match.captures\n else\n raise \"Bad query: '#{query_string}'\"\n end\n end", "title": "" } ]
[ { "docid": "9a332bbe48a668c6ea7ce8a0ff00e56b", "score": "0.7650261", "text": "def tokenize(query_string)\n query_string.scan(QUERY_REGEXP).map do |match|\n create_token(*match)\n end\n end", "title": "" }, { "docid": "9993c94929e85d1ee79627386910a7ec", "score": "0.74016154", "text": "def tokenize_query(query)\n if configuration.tokenize_multi_search\n query.split(/\\s+/, 2)\n else\n [query]\n end\n end", "title": "" }, { "docid": "194258eebca9ab89965cb96dca6287e9", "score": "0.70078313", "text": "def parse_query(query_string)\n #@log.debug \"Parsing Query #{query_string}\"\n tokenize(query_string).map {|token| regex_from_token(token)}\n end", "title": "" }, { "docid": "3910351e9b46a7b04d176d3999aef57b", "score": "0.68444014", "text": "def query_splitter(str)\n return str.split('\"')[3]\nend", "title": "" }, { "docid": "1ec552fae4e3a52cc9e0c397aaf00d25", "score": "0.6840533", "text": "def tokenize_query_string(qs)\n tokens = [ ]\n cur = ''\n state = :scan\n \n qs.split('').each_with_index do |c, idx|\n case c\n when '\"'\n case state\n when :scan\n state = :quote\n cur = ''\n when :quote\n tokens << [ :quoted, cur.split(/\\s+/).join(' ').strip ]\n state = :scan\n cur = ''\n else\n raise MalformedQuery.new(qs, idx)\n end\n when '|'\n case state\n when :scan\n tokens << [ :or ]\n cur = ''\n when :quote\n cur << c\n when :token\n tokens << [ :word, cur ]\n tokens << [ :or ]\n state = :scan\n cur = ''\n else\n raise MalformedQuery.new(qs, idx)\n end\n when '&'\n case state\n when :scan\n tokens << [ :and ]\n cur = ''\n when :quote\n cur << c\n when :token\n tokens << [ :word, cur ]\n tokens << [ :and ]\n state = :scan\n cur = ''\n else\n raise MalformedQuery.new(qs, idx)\n end\n when '-', '!'\n case state\n when :scan\n tokens << [ :minus ]\n when :quote\n cur << c\n when :around\n raise MalformedQuery.new(qs, idx) unless c == '-'\n cur = '1'\n when :token\n if c == '-'\n cur << c\n else\n if cur.upcase == 'OR'\n tokens << [ :or ]\n tokens << [ :minus ]\n state = :scan\n elsif cur.upcase == 'AND'\n tokens << [ :and ]\n tokens << [ :minus ]\n state = :scan\n elsif cur.upcase == 'AROUND'\n state = :around\n else\n tokens << [ :word, cur ]\n tokens << [ :minus ]\n state = :scan\n end\n cur = ''\n end\n else\n raise MalformedQuery.new(qs, idx)\n end\n when '<'\n case state\n when :scan\n state = :around\n cur = ''\n when :quote\n cur << c\n when :token\n tokens << [ :word, cur ]\n state = :around\n cur = ''\n else\n raise MalformedQuery.new(qs, idx)\n end\n when '>'\n case state\n when :quote\n cur << c\n when :around\n tokens << [ :around, cur.to_i ]\n state = :scan\n cur = ''\n else\n raise MalformedQuery.new(qs, idx)\n end\n when '('\n case state\n when :scan\n tokens << [ :open ]\n when :token\n if cur.upcase == 'OR'\n tokens << [ :or ]\n tokens << [ :open ]\n state = :scan\n elsif cur.upcase == 'AND'\n tokens << [ :and ]\n tokens << [ :open ]\n state = :scan\n elsif cur.upcase == 'AROUND'\n state = :around\n else\n tokens << [ :word, cur ]\n end\n cur = ''\n end\n when ')'\n case state\n when :scan\n tokens << [ :close ]\n when :token\n tokens << [ :word, cur ]\n tokens << [ :close ]\n when :around\n tokens << [ :around, cur.to_i ]\n end\n state = :scan\n cur = ''\n when ' '\n case state\n when :quote\n cur << c\n when :token\n if cur.upcase == 'OR'\n tokens << [ :or ]\n elsif cur.upcase == 'AND'\n tokens << [ :and ]\n else\n tokens << [ :word, cur ]\n end\n state = :scan\n cur = ''\n when :around\n raise MalformedQuery.new(qs, idx)\n end\n else\n case state\n when :scan\n state = :token\n cur = c\n when :token\n cur << c\n when :quote\n cur << c\n when :around\n raise MalformedQuery.new(qs, idx) unless c =~ /[0-9]/\n cur = c\n end\n end\n end\n\n # we need to adjust based on the final state\n\n case state\n when :token\n if cur.upcase == 'OR'\n tokens << [ :or ]\n elsif cur.upcase == 'AND'\n tokens << [ :and ]\n else\n tokens << [ :word, cur ]\n end\n when :quote\n # let's be lenient\n\n tokens << [ :quoted, cur.split(/\\s+/).join(' ').strip ]\n end\n\n tokens\n end", "title": "" }, { "docid": "d10105882ad390115d0eb8bd98f86b78", "score": "0.67310315", "text": "def parse_query(string, sep=?&)\n unflatten(string.split(sep).map { |s| s.split(?=).map(&method(:decode)) })\n end", "title": "" }, { "docid": "8df33d9e7ed3218a6c330e9f99f301b1", "score": "0.6666778", "text": "def getQueryTerms(query_string)\n # qstr is a series of space delimited terms with logic AND | OR tying each term together. Wild cards '*' are replaced with '%'\n ret_terms = Array.new\n \n andterms = query_string.split(\" AND \")\n andterms.each do |andterm|\n orterms = andterm.split(\" OR \")\n if orterms.length > 1\n orterms.each do |orterm|\n if orterm.include? '*'\n ret_terms << orterm.tr('*',' ').strip\n else\n ret_terms << orterm\n end\n end\n elsif andterm.include? '*'\n ret_terms << andterm.tr('*',' ').strip\n else\n ret_terms << andterm\n end\n end\n return ret_terms\n end", "title": "" }, { "docid": "188c350f8df0e3b3d0d5963d8d5b25d7", "score": "0.65661955", "text": "def split_query(query)\n query.split('&').map do |pairs|\n p = pairs.split('=')\n [CGI.unescape(p[0]), CGI.unescape(p[1] || '')]\n end.flatten\n end", "title": "" }, { "docid": "1b8a06bf2baa18242c4384a7e1bb292b", "score": "0.6261175", "text": "def parse_query(str); end", "title": "" }, { "docid": "1b8a06bf2baa18242c4384a7e1bb292b", "score": "0.6261175", "text": "def parse_query(str); end", "title": "" }, { "docid": "775c05cd8e48cc4e44ed636b33426550", "score": "0.6253458", "text": "def psplit(query)\n split = []\n depth = 0\n current = \"\"\n\n query.chars.each_with_index do |ch, i|\n if i == query.length-1\n split << current+ch\n elsif ch == ' ' && depth == 0\n split << current\n current = \"\"\n else\n current << ch\n\n if ch == '('\n depth += 1\n elsif ch == ')'\n depth -= 1\n end\n end\n end\n\n split\n end", "title": "" }, { "docid": "c38ffa275c8994500e15967e4a268f5f", "score": "0.61779875", "text": "def parse_string\n query.split(/\\band\\b(?=(?:[^']|'[^']*')*$)/i).map do |part|\n column_name, operator, value = get_parts(part)\n if operator == \"\"\n [\"#{column_name}\", value]\n else\n [\"#{column_name}\", [\"#{operator}\", value]]\n end\n end\n end", "title": "" }, { "docid": "599c8827a69875157e4d722d161a77f6", "score": "0.60617983", "text": "def process_query_string(query_string)\n query_list = query_string.split('/')\n raise ArgumentError, 'Query String In Wrong Format' if (query_string.nil?)\n return query_list.reverse\n end", "title": "" }, { "docid": "f45a486caf4e9906d88042e89a39a13c", "score": "0.6011679", "text": "def parse_query(query_string)\n parsed_query=''\n sub_queries = query_string.split(\"&\")\n if sub_queries.nil?\n parsed_query\n else\n sub_queries.each do |sub_query|\n terms = sub_query.split(\"=\")\n if terms[1] != nil\n parsed_query += \"<b>#{I18n.t(terms[0][1,terms[0].length])}</b>: #{terms[1].tr(\"_\", \"\")}<br/>\"\n end\n end\n parsed_query = parsed_query[0,parsed_query.length-6]\n end\n end", "title": "" }, { "docid": "b33ced0ea70a4a654245f97bf9256571", "score": "0.59512055", "text": "def get_tokens(user_input)\n tokens = []\n token = \"\"\n capturing_string = false\n\n user_input.each_char do |char|\n case char\n when /[\\d\\w\\/:@]/\n token << char\n when /[\"']/\n capturing_string = !capturing_string\n when /[\\s]/\n if capturing_string\n token << char\n else\n tokens << token\n token = \"\"\n end\n else\n token << char\n end # case\n end # each\n\n tokens << token unless token.empty?\n raise \"invalid command:unclosed string\" if capturing_string\n\n return tokens\n end", "title": "" }, { "docid": "974facada874af4defcc1b21a15f47d0", "score": "0.59460723", "text": "def query_values(string)\n Addressable::URI.parse(string).query_values\n rescue Addressable::URI::InvalidURIError => e\n nil\n end", "title": "" }, { "docid": "58e8f874c9a8e1f0225af1f1501e0e3e", "score": "0.5945495", "text": "def parse_string(query)\n result = {}\n URI.decode_www_form(query).each do |p|\n if p.first.match(REGEX_MATCH_LIST)\n result[p.first] ||= []\n result[p.first] << p.last\n else\n result[p.first] = p.last\n end\n end\n result\n end", "title": "" }, { "docid": "1f1974543827a3e2cd1baceca157ae51", "score": "0.589833", "text": "def parse_request(req)\n [req.split(\" \")[0], req.split(\" \")[1]]\n end", "title": "" }, { "docid": "336f06e74c855de1fc466a3455a7945e", "score": "0.5892844", "text": "def parse_query_pairs(query_string)\n return {} if query_string.blank?\n\n query_string.split('&').collect do |chunk|\n next if chunk.empty?\n key, value = chunk.split('=', 2)\n next if key.empty?\n value = value.nil? ? nil : CGI.unescape(value)\n [ CGI.unescape(key), value ]\n end.compact\n end", "title": "" }, { "docid": "745f982e5f4721572f5c77b3f054b10f", "score": "0.5817772", "text": "def query(string)\n params = string.split(',')\n get(params.first, params.last)\n end", "title": "" }, { "docid": "745f982e5f4721572f5c77b3f054b10f", "score": "0.5817772", "text": "def query(string)\n params = string.split(',')\n get(params.first, params.last)\n end", "title": "" }, { "docid": "886aca9669c5440c07880fb46ca6a061", "score": "0.5816874", "text": "def tokenizer(string)\n items = []\n while string.size > 0\n if TOKENS.keys.include?(string[0,1])\n end_index = string.index(TOKENS[string[0,1]], 1)\n raise \"bad end_index for #{string}\" if not end_index\n item = string[0..end_index]\n items << item\n string = string[end_index+1..-1]\n while item.count(item[0,1]) > item.count(TOKENS[item[0,1]])\n end_index = string.index(TOKENS[item[0,1]])\n item << string[0..end_index]\n string = string[end_index+1..-1]\n end\n else\n end_index = string.index(/([[({<&*#\"'^\\s]|\\z)/, 1)\n item = string[0..end_index-1].strip\n items << item if not item.empty?\n string = string[end_index..-1]\n end\n end\n items\n end", "title": "" }, { "docid": "69f986d0cc623c4633cc0786d9266767", "score": "0.5780446", "text": "def tokenize(url)\n url.split('')\nend", "title": "" }, { "docid": "218e96a200193f7bdc06c3e720d5456f", "score": "0.5779936", "text": "def tokenizer(string)\n items = []\n while string.size > 0\n if TOKENS.keys.include?(string[0,1])\n end_index = string.index(TOKENS[string[0,1]], 1)\n raise \"bad end_index for #{string}\" if not end_index\n item = string[0..end_index]\n items << item\n string = string[end_index+1..-1]\n while item.count(item[0,1]) > item.count(TOKENS[item[0,1]])\n end_index = string.index(TOKENS[item[0,1]])\n item << string[0..end_index]\n string = string[end_index+1..-1]\n end\n else\n end_index = string.index(/([\\[({<&*#\"'^\\s]|\\z)/, 1)\n item = string[0..end_index-1].strip\n items << item if not item.empty?\n string = string[end_index..-1]\n end\n end\n items\n end", "title": "" }, { "docid": "4186e9a8c89d6b395d5feacbff61f080", "score": "0.5773559", "text": "def parse_query(qs, separator = T.unsafe(nil), &unescaper); end", "title": "" }, { "docid": "e1bce489c5abe392e6dee58b7fa492aa", "score": "0.57700264", "text": "def split_request_authenticity_token\n @token.respond_to?(:[]) ? [@token[0..9], @token[10..-1]] : [nil, nil]\n end", "title": "" }, { "docid": "d71bff18646a911d70282bcfc4941cf4", "score": "0.576585", "text": "def parse_query_string(query_string)\n CGI::parse(query_string).reduce({}) { |params, (name, values)|\n params.merge(name.sub(/\\[\\]\\Z/, \"\") => values) { |_, old, new|\n old.concat(new)\n }\n }\n end", "title": "" }, { "docid": "453d5a4499e504b1a242021c520b5e13", "score": "0.5760847", "text": "def parse_ids_from_query_string(query_string)\n [].tap do |ids|\n CGI.parse(query_string)['id[]'].each do |id|\n ids << Integer(id, 10) rescue ArgumentError\n end\n end\nend", "title": "" }, { "docid": "5320c58aff93891f5c433a50dc16745d", "score": "0.573666", "text": "def get_values (result_string)\n pieces = result_string.split(\"|\")\n pieces[1].split(\",\")\n end", "title": "" }, { "docid": "008f610214311a13300e56d3a56a48b9", "score": "0.5722779", "text": "def tokenize(string=\"\")\n return string.strip.split\n end", "title": "" }, { "docid": "84afe940978d9a8bb47ea2522c08721b", "score": "0.5716349", "text": "def parse_request(request)\n return request.split(':')\n end", "title": "" }, { "docid": "c4947d0ffb92721daf3ba0ea9d4aa851", "score": "0.5708202", "text": "def parse_query(query); end", "title": "" }, { "docid": "c4947d0ffb92721daf3ba0ea9d4aa851", "score": "0.5708202", "text": "def parse_query(query); end", "title": "" }, { "docid": "c4947d0ffb92721daf3ba0ea9d4aa851", "score": "0.5708202", "text": "def parse_query(query); end", "title": "" }, { "docid": "1ed7424b08725bfb6a9dd8407f209c43", "score": "0.5699537", "text": "def query_values\n return nil if query.nil?\n ::URI.decode_www_form(query).each_with_object({}) do |(k, v), hash|\n if k.end_with?('[]')\n k.gsub!(/\\[\\]$/, '')\n hash[k] = Array(hash[k]) + [v]\n else\n hash[k] = v\n end\n end\n end", "title": "" }, { "docid": "834033137b966a8abc576612ade20748", "score": "0.568156", "text": "def split_query(original_query)\n options = []\n query = original_query\n self.class.available_options.keys.each do |o|\n if original_query.include?(o)\n query = query.gsub(o, \"\")\n options << o.strip\n end\n end\n [query, options]\n end", "title": "" }, { "docid": "fe8972a5f6c0c2dec6d5de1c8ac1c683", "score": "0.56793386", "text": "def parse_query_and_cats(search_string)\n query, cats = [], []\n \n search_string.scan(/[\\w$]+/).each do |token|\n if token.starts_with?(\"$\")\n cats = token[1 .. -1]\n else\n query << token\n end\n end\n [ query.join(\" \"), cats ]\n end", "title": "" }, { "docid": "6dbd8077899bc6a69672b62672cdb701", "score": "0.5658025", "text": "def extract_table_parameters_from(str)\n\t\tif str.nil? || str.size < 1 then\n\t\t\treturn []\n\t\tend\n\t\t\n\t\tif !str.include? ',' then\n\t\t\treturn str\n\t\telse\n\t\t\treturn str.split ','\n\t\tend\n\t\t\n\tend", "title": "" }, { "docid": "b228d024691267fdec765bb43ed57cdd", "score": "0.5605171", "text": "def parse(input_string)\n operand_list = input_string.split(/[,|\\n|\\\\n]/)\n operand_list\n end", "title": "" }, { "docid": "f4aa5b785f6cc4cb425d4b7244c8e6e8", "score": "0.5570302", "text": "def queryparse(query)\n params = Hash.new()\n\n query.split(/[&;]/n).each do |pairs|\n key, value = pairs.split('=',2)\n if params.has_key?(key)\n #Error\n else\n params[key] = value\n end\n end\n params\n end", "title": "" }, { "docid": "7bb28ae1255dc90eb600c70d82d83f13", "score": "0.55430263", "text": "def params_array_from(raw_params)\n raw_params.map { |param| param.split %r/=(.+)?/ }\n end", "title": "" }, { "docid": "7bb28ae1255dc90eb600c70d82d83f13", "score": "0.55430263", "text": "def params_array_from(raw_params)\n raw_params.map { |param| param.split %r/=(.+)?/ }\n end", "title": "" }, { "docid": "84c4ed58d3234415f5c06c1e0a867dec", "score": "0.55231667", "text": "def list_split(str, delimiters = [',', 'and'])\n ptn = \"(\\W#{delimiters.join('\\W|\\W')}\\W)\"\n values = []\n str.split(Regexp.new(ptn)).each do |val|\n v = val.strip\n values << v if (v.length > 0 && !delimiters.include?(v))\n end\n values\n end", "title": "" }, { "docid": "cbaef1fe356dfe10627366898e6ac127", "score": "0.5522668", "text": "def __split_string(string, limit)\n result = []\n if @_st_source == \"\"\n slim = string.size\n i = 0\n while i < slim\n result[i] = string[i, 1]\n i = i + 1\n end\n else\n start = 0\n self.all_matches(string).each do |match|\n result << string[start...match.begin(0)]\n start = match.end(0)\n end\n if(start < string.length)\n result << string[start...string.length]\n end\n end\n result\n end", "title": "" }, { "docid": "139d122e0170d151054c9d7ccda946ca", "score": "0.55074465", "text": "def split_to_array\n @input = @input.delete(\" \")\n @input_as_array = @input.split(/(\\*|\\+|\\/|-)/)\n end", "title": "" }, { "docid": "1ea4a0e2638a6810cb7afa86c4eb1270", "score": "0.550614", "text": "def parse_select(query_string)\n strategy = Muster::Strategies::Hash.new(:field => :select)\n results = strategy.parse(query_string)\n\n Array.wrap(results[:select])\n end", "title": "" }, { "docid": "877780165d1a0af3d6ec5672dc300619", "score": "0.5506035", "text": "def splitIntoTokens(rawStr)\n tokenArray = []\n indx = 0\n token = \"\"\n while(indx < rawStr.length) do\n if(rawStr[indx] == ' ')\n if(token.length > 0)\n tokenArray << token\n token = \"\"\n end\n indx = indx + 1\n elsif (rawStr[indx] == \"\\\"\")\n token = \"\\\"\"\n indx = indx + 1\n while (indx < (rawStr.length) && rawStr[indx] != \"\\\"\") do\n token = token + rawStr[indx]\n indx = indx + 1\n end\n token = token + \"\\\"\"\n indx = indx + 1\n tokenArray << token\n token = \"\"\n elsif(indx+5 < rawStr.length && rawStr[indx..indx+3] == \"len(\")\n if(token.length > 0)\n tokenArray << token\n token = \"\"\n end\n while(indx < rawStr.length && rawStr[indx] != ')') do\n token = token + rawStr[indx]\n indx = indx + 1\n end\n token = token + rawStr[indx]\n indx = indx + 1\n tokenArray << token\n token = \"\"\n elsif(rawStr[indx] == '(' || rawStr[indx] == ')' || rawStr[indx] == '!' || rawStr[indx] == '=' )\n if(token.length > 0)\n tokenArray << token\n token = \"\"\n end\n tokenArray << rawStr[indx]\n indx = indx + 1\n elsif(rawStr[indx] == '<' || rawStr[indx] == '>')\n if(token.length > 0)\n tokenArray << token\n end\n token = rawStr[indx]\n indx = indx + 1\n if(indx < rawStr.length && rawStr[indx] == '=')\n token = token + rawStr[indx]\n indx = indx + 1\n end\n tokenArray << token\n token = \"\"\n else\n token = token + rawStr[indx]\n indx = indx + 1\n end\n end\n if (token.length > 0)\n tokenArray << token\n end\n tokenArray \n end", "title": "" }, { "docid": "fb623b1bf77e5a913adce841d2af7ffe", "score": "0.55005825", "text": "def parse_query_parameters(query_string)\n return {} if query_string.blank?\n\n pairs = query_string.split('&').collect do |chunk|\n next if chunk.empty?\n key, value = chunk.split('=', 2)\n next if key.empty?\n value = value.nil? ? nil : CGI.unescape(value)\n [ CGI.unescape(key), value ]\n end.compact\n\n ActionController::UrlEncodedPairParser.new(pairs).result\n end", "title": "" }, { "docid": "06b6b4a8975ebc4057d457d37c81e499", "score": "0.5498753", "text": "def queryparse(query)\n\t\tparams = Hash.new()\n\n \t\tquery.split(/[&;]/n).each do |pairs|\n \t\t\tkey, value = pairs.split('=',2)\n \t\t\tif params.has_key?(key)\n\t\t\t\t#Error\n \t\t\telse\n\t\t\t\tparams[key] = value\n \t\t\tend\n \t\tend\n\t\tparams\n\tend", "title": "" }, { "docid": "e5c51126fca6abef60b12c97e2a40eb5", "score": "0.5497622", "text": "def parse_query_parameters(query_string)\n return {} if query_string.blank?\n\n pairs = query_string.split('&').collect do |chunk|\n next if chunk.empty?\n key, value = chunk.split('=', 2)\n next if key.empty?\n value = value.nil? ? nil : CGI.unescape(value)\n [ CGI.unescape(key), value ]\n end.compact\n\n ActionController::UrlEncodedPairParser.new(pairs).result\n end", "title": "" }, { "docid": "51ee710f3423123c538e44e57ffde753", "score": "0.54823834", "text": "def break_down_qs(qs,separator)\n response = Hashie::Mash.new\n \n # if & is a separator\n if qs.match(/\\&/)\n pieces = qs.split(/\\&/).to_a\n pieces.each_with_index{|data,i|\n if data.match(/\\=/)\n a,b = data.split(/\\=/)\n response[a] = b\n else\n response[separator] = data\n end\n }\n else\n response[separator] = qs\n end\n #puts response.inspect\n return response\nend", "title": "" }, { "docid": "7467aa65ae2b3bc6aa1c969ed595ed72", "score": "0.5480108", "text": "def ids_str_to_array(string)\n string.first.split ','\n end", "title": "" }, { "docid": "b41aa3a83f6d38b91546277cf4cf6177", "score": "0.54789215", "text": "def parse_query_parameters(query_string)\n return {} if query_string.blank?\n\n pairs = query_string.split('&').collect do |chunk|\n next if chunk.empty?\n key, value = chunk.split('=', 2)\n next if key.empty?\n value = value.nil? ? nil : CGI.unescape(value)\n [ CGI.unescape(key), value ]\n end.compact\n\n UrlEncodedPairParser.new(pairs).result\n end", "title": "" }, { "docid": "c0903094a2d768b300fb0a39b8c4bd73", "score": "0.54787385", "text": "def analyze_query(query, field_name)\n ts = Indexer.get_analyzer.token_stream(field_name, query)\n returning [] do |terms|\n while term = ts.next\n terms << term.text\n end\n end\n end", "title": "" }, { "docid": "a919555667612b3447d05934a0e52ac5", "score": "0.54672223", "text": "def query_params\n ref_path = request.path_info;\n ref_query = URI.decode(request.query_string)\n query_options = ref_query.split('&').select{|r| !r.blank?}\n res = []\n query_path = []\n\n query_options[0..-2].each do |qo|\n qo.match(/q\\[(\\w+)\\]\\[\\]=(.+)/)\n attribute = $1\n condition = $2\n found = false\n res << link_to(\"#{attribute.humanize}: #{condition}\", ref_path+\"?\"+query_path.join(\"&\"))\n query_path << qo\n\n end\n\n query_options[-1].match(/q\\[(\\w+)\\]\\[\\]=(.+)/)\n attribute = $1\n condition = $2\n res << \"#{attribute.humanize}: #{condition}\"\n\n return res.join(' > ')\n end", "title": "" }, { "docid": "79279ab0b3ef0c2fc4fc25ad9dc15eb4", "score": "0.54665315", "text": "def processed_terms\n terms = @q.split(/[^a-zA-Z0-9_-]/).reject { |t| t.length <= 2 || STOPWORDS.include?(t) }.join(\" \")\n result = []\n result << terms\n end", "title": "" }, { "docid": "a36862c6c021157c7ab7a525130d2c20", "score": "0.54652345", "text": "def parsed_query(query)\n query ||= \"null\"\n query = JSON.parse(query)\n return {} unless query.is_a?(Array)\n terms = if query.first == \"and\"\n query.select { |e| e.is_a?(Array) }\n else\n [query]\n end\n Hash[terms.map { |e| e[1,2] }]\n end", "title": "" }, { "docid": "be96bb166b5e5d314d20065198341a3c", "score": "0.5460202", "text": "def tokenize\n\t\t\treturn [] unless numeric?\n numbers = to_s.dup\n\n numbers.gsub!(/\\s*,\\s*/, ', ')\n numbers.gsub!(/\\s*-\\s*/, '-')\n numbers.gsub!(/\\s*&\\s*/, ' & ')\n\n numbers.split(/(\\s*[,&-]\\s*)/)\n end", "title": "" }, { "docid": "5aa411908c0f3aa3448bfc8004a519ac", "score": "0.54577816", "text": "def scan(str_data)\n str_data.split\nend", "title": "" }, { "docid": "2a54b9601f0769c301f482b1624b666b", "score": "0.5442322", "text": "def split_strings(array)\n array_of_split_strings = []\n array.each do |x|\n array_of_split_strings << x.split(//)\n end\n return array_of_split_strings\n end", "title": "" }, { "docid": "5ec256220125cc42adf358764b04f382", "score": "0.54272825", "text": "def fielded_query(query, field)\n tokens = query.split(%r{\\s|(\"[^\"]+\")}).delete_if {|a| a.blank?}\n return tokens.collect {|token| \"#{field}:#{token}\"}.join(\" \")\n end", "title": "" }, { "docid": "fab997d08339b158df459a503c9bedd5", "score": "0.54254824", "text": "def tokenize(regex, string)\n string.split(regex)\n end", "title": "" }, { "docid": "d067c2aa331e16a58304aac44ab2e7cd", "score": "0.54156685", "text": "def query_to_terms(query)\n query.scan(/(\\+|or \\-?|and \\-?|\\-)?(\"[^\"]*\"?|[\\w\\-]+)/).collect do |prefix, term|\n term = \"(#{term.scan(/[\\w']+/).join('&')})\" if term[0,1] == '\"'\n term = \"!#{term}\" if prefix =~ /\\-/\n [(prefix =~ /or/) ? '|' : '&', term] \n end\n end", "title": "" }, { "docid": "bd4db62f898c6a616355dc260db5fd6b", "score": "0.54142445", "text": "def params_array_from(raw_params)\n raw_params.map { |param| param.split %r/=(.+)?/ }\n end", "title": "" }, { "docid": "bd4db62f898c6a616355dc260db5fd6b", "score": "0.54142445", "text": "def params_array_from(raw_params)\n raw_params.map { |param| param.split %r/=(.+)?/ }\n end", "title": "" }, { "docid": "268f1d4eb22cfa4496ff164b80efa948", "score": "0.5410564", "text": "def split_by_separator(affi_string, auth_id)\n tokens = []\n if affi_string.include?(\",\") and affi_string.include?(\";\")\n tokens = affi_string.split(\";\")\n tokens.each do |token|\n if token.include?(\",\")\n split_idx = tokens.find_index(token)\n temp_tkns = token.split(\",\")\n tokens = tokens[1..split_idx-1].concat(temp_tkns).concat(tokens[split_idx+1..])\n end\n end\n elsif affi_string.include?(\",\")\n tokens = affi_string.split(\",\")\n elsif affi_string.include?(\";\")\n tokens = affi_string.split(\";\")\n end\n if tokens != []\n return create_affi_obj(tokens, auth_id)\n else\n return nil\n end\nend", "title": "" }, { "docid": "673ccc21dc56e9d60db51b727cb1b633", "score": "0.5409678", "text": "def query_string\n request.query_string.split('&').reject do |part|\n key = part.split('=').first\n\n %w(space_id delivery_token preview_token editorial_features).include?(key)\n end.join('&')\n end", "title": "" }, { "docid": "b45cf57648fe6600b5356d50d3c86c61", "score": "0.5407505", "text": "def requestor_array\n self.requestors.split(\",\").collect { |x| x.strip }\n end", "title": "" }, { "docid": "77331ffdbdb4afa23a6a5a7b3a25c606", "score": "0.53993917", "text": "def tokens(string)\n \t(string.split.map { |i| i.match(/\\d+/) ? i.to_i : i.to_sym})\n end", "title": "" }, { "docid": "7764fafb3169833f4dec77fdfb5b29c8", "score": "0.5371172", "text": "def parse_query_string(query_string)\n\t params = {}\n\t t = query_string.split('&')\n\t t.each_with_index do |v,i|\n\t thisparam = t[i].split('=')\n\t params[thisparam[0]] = thisparam[1]\n\t end\n\t params\n\tend", "title": "" }, { "docid": "bb3e929cfc3ae2162e4e951eeadac708", "score": "0.53642845", "text": "def request_query(req)\n (req.\n request_uri.\n query || ''\n ).\n split(/[;&]/).\n map{|x| x.split('=', 2) }.\n inject({ }) { | h, kv | h[kv[0].to_sym] = kv[1]; h }\n end", "title": "" }, { "docid": "923df728ea87c3892daeaeedda666358", "score": "0.5362154", "text": "def tokens(x)\n token_array = []\n\n x.split.each do |z| \n if z[/\\d+/] # if number\n token_array << z.to_i\n elsif z[/(\\+|\\-|\\*|\\/)/] # if one of those operators\n token_array << z.to_sym\n end\n end\n\n token_array\n end", "title": "" }, { "docid": "243811b9c775489574a6a40d9996fbe4", "score": "0.5358865", "text": "def extract_parameters_from(str)\n\t\tif str.nil? || str.length < 1 then\n\t\t\treturn []\n\t\tend\n\t\t\n\t\tmatchdata = str.scan REGEX_PARAMETRIC_ARG\n\t\tif matchdata.nil? then\n\t\t\treturn []\n\t\telse\n\t\t\tlist = []\n\t\t\tmatchdata.each do |arr|\n\t\t\t\tlist += arr\n\t\t\tend\n\t\t\treturn list\n\t\tend\n\tend", "title": "" }, { "docid": "f66508a2f28837146000d6b904b8a4ab", "score": "0.534812", "text": "def get_array\n get.split(@separator)\n end", "title": "" }, { "docid": "f04804a0042c726a3c07332cc3ec8650", "score": "0.5346677", "text": "def split_order_string(string)\n array = []\n i = 0\n string.split(\",\").each do |part|\n if array[i]\n array[i] << \",\" << part\n else\n # to ensure that array[i] will be String and not Arel::Nodes::SqlLiteral\n array[i] = part.to_s\n end\n i += 1 if array[i].count(\"(\") == array[i].count(\")\")\n end\n array\n end", "title": "" }, { "docid": "3e4e97b4d8b000755972697712075b32", "score": "0.5341169", "text": "def parse_params\n params = []\n while (token = @tokens.shift)\n params << parse_value(token)\n end\n params\n end", "title": "" }, { "docid": "d41c461ff4606998badb35d24edf227e", "score": "0.53397596", "text": "def multiple_query(query)\n result = []\n\n result << @restricted_client.query(query)\n\n while @restricted_client.next_result\n result << @restricted_client.store_result\n end\n\n result\n end", "title": "" }, { "docid": "bc3a93f4fc6ca0d2a03ec554618ed1f2", "score": "0.53186786", "text": "def build_queries(tokens)\n split_by_or_token(tokens).map do |or_less_tokens|\n query_hash = build_query_hash(or_less_tokens.select(&:query?))\n filter_hash = build_filter_hash(or_less_tokens.select(&:filter?))\n create_query(query_hash, filter_hash)\n end\n end", "title": "" }, { "docid": "6fa549ebc88dfeebcd6c1ead5f933c66", "score": "0.5307047", "text": "def fields_to_parse(query_string)\n fields = parse_query_string(query_string)\n\n if self.fields.present?\n fields = fields.select { |key, _| self.fields.include?(key.to_sym) }\n end\n\n fields.with_indifferent_access\n end", "title": "" }, { "docid": "9d8298b3bdc7cee2b86df5c476145330", "score": "0.5304834", "text": "def decode_query_string\n self.split(\"&\").inject({}) { |collector, string|\n pair = string.split('=', 2)\n collector.merge({pair[0] => pair[1]})\n }\n end", "title": "" }, { "docid": "6ef77c9f0beb673b0c564a76ba840d02", "score": "0.5299175", "text": "def parse(query)\n query = query.gsub(/[^\\w\\-\\+'\"]+/, \" \").gsub(\"'\", \"''\").strip.downcase\n query = query.scan(/(\\+|or \\-?|and \\-?|\\-)?(\"[^\"]*\"?|[\\w\\-]+)/).collect do |prefix, term|\n term = \"(#{term.scan(/[\\w']+/).join('&')})\" if term[0,1] == '\"'\n term = \"!#{term}\" if prefix =~ /\\-/\n [(prefix =~ /or/) ? '|' : '&', term] \n end.flatten!\n query.shift\n query.join\n end", "title": "" }, { "docid": "6ef77c9f0beb673b0c564a76ba840d02", "score": "0.5299175", "text": "def parse(query)\n query = query.gsub(/[^\\w\\-\\+'\"]+/, \" \").gsub(\"'\", \"''\").strip.downcase\n query = query.scan(/(\\+|or \\-?|and \\-?|\\-)?(\"[^\"]*\"?|[\\w\\-]+)/).collect do |prefix, term|\n term = \"(#{term.scan(/[\\w']+/).join('&')})\" if term[0,1] == '\"'\n term = \"!#{term}\" if prefix =~ /\\-/\n [(prefix =~ /or/) ? '|' : '&', term] \n end.flatten!\n query.shift\n query.join\n end", "title": "" }, { "docid": "a958b876aee80d2381340dc57513aebd", "score": "0.5295629", "text": "def split_order_string(string)\n array = []\n i = 0\n string.split(',').each do |part|\n if array[i]\n array[i] << ',' << part\n else\n # to ensure that array[i] will be String and not Arel::Nodes::SqlLiteral\n array[i] = '' << part\n end\n i += 1 if array[i].count('(') == array[i].count(')')\n end\n array\n end", "title": "" }, { "docid": "4346cb11c2276df6a433d5fcadea958d", "score": "0.52944696", "text": "def split_complex(affi_string, auth_id)\n if affi_string.include?(\",\") or affi_string.include?(\";\")\n return split_by_separator(affi_string, auth_id)\n else\n return split_by_keywords(affi_string, auth_id)\n end\nend", "title": "" }, { "docid": "e94da6916019f4e91240de9d8c6f145a", "score": "0.529425", "text": "def generate_filter_array_from_data_string(string_data)\n $log.trace(\"SearchFunctionsDSL: #{__method__}\")\n raise Exception.new('Generate filter data was called but no string data is not provided') if string_data == nil\n groups = []\n items = []\n\n string_data.split(\";\").each do |data_val|\n data_val.split(\":\").each_with_index do |f_val, f_i|\n (f_i == 0) ? groups << f_val : items << f_val.split(\",\")\n end\n end\n return groups, items\n end", "title": "" }, { "docid": "4d399203f9e1f2cedc71ca2648a82779", "score": "0.5287082", "text": "def get_query\n\t\tputs \"query>\"\n\t\tquery = gets.chomp\n\t\tquery.sub(/(?<=:)\\s/, '')\n\t\tquery_hash = Hash[query.split(\",\").map(&:strip).map { |p| p.split(\":\") }.map { |k, v| [ k.to_sym, v] }]\n\n\tend", "title": "" }, { "docid": "41165b6da93e57441eeb9e9bbfa1b201", "score": "0.52804184", "text": "def parse(input)\n query = input\n text = \"\"\n while true\n begin\n return [SPARQL.parse(PREFIXES + query, validate: true), text]\n rescue EBNF::LL1::Parser::Error => e\n idx = query.rindex(e.token.to_s)\n if not idx\n raise \"coding error\"\n end\n if idx == 0\n raise \"Invalid query in #{f}:\\n#{input}\"\n end\n if query[0, idx] =~ /(\\s+)$/o\n idx -= $1.length\n end\n text = query[idx, query.length] + text\n query = query[0, idx]\n rescue => e\n raise \"Invalid query in #{f}:\\n#{input}\"\n end\n end\nend", "title": "" }, { "docid": "0d454c303fe6a532c5c1c6fcff702eba", "score": "0.52769786", "text": "def tokenize(text)\n return text.split\nend", "title": "" }, { "docid": "22cdbbd6e8a3c0ff890c17bff01797a0", "score": "0.5268805", "text": "def raw_params(auth)\n auth.sub(TOKEN_REGEX, '').split(/\"\\s*#{AUTHN_PAIR_DELIMITERS}\\s*/)\n end", "title": "" }, { "docid": "dd56d01b2557df40df50c3ece58bcd10", "score": "0.5267325", "text": "def extract_list_from_string (s)\n\n s.split @value_separator\n end", "title": "" }, { "docid": "c60393ad2569b66cbc12cd6ab282a3c4", "score": "0.5266702", "text": "def parse_query(query, delim = nil)\n delim ||= \"&;\"\n params = {}\n (query || \"\").split(/[#{delim}] */n).each do |p|\n k, v = p.split(\"=\", 2).map { |str| str } # NOTE: uri_unescape\n k = k.to_sym\n if (cur = params[k])\n if cur.instance_of?(Array)\n params[k] << v\n else\n params[k] = [cur, v]\n end\n else\n params[k] = v\n end\n end\n params\n end", "title": "" }, { "docid": "0b24caaf23cb13e1ac6cf87bcea6b438", "score": "0.52638257", "text": "def trace_request_query_strings(query_string_array)\n $tracer.trace(\"GameStopAnalyticsFunctions: #{__method__}, Line: #{__LINE__}\")\n query_string_array.each do |rec|\n if rec.class.eql?(Struct::QueryStringData)\n $tracer.trace(\"#{rec.page} => url: #{rec.url}\")\n $tracer.trace(\"#{rec.page} => status: #{rec.status}\")\n rec.query_string_hash.each do |k, v|\n $tracer.trace(\"\\t#{k}: #{v}\")\n end\n else\n raise Exception, \"omniture query string array data must be from get_omniture_request_query_strings_for_url() call\"\n end\n end\n return http_status\n end", "title": "" }, { "docid": "98d493070f002843b25b4299b873f2c4", "score": "0.52508783", "text": "def multi_args\n ss = StringScanner.new(self)\n arr = []\n loop do\n ss.scan(/\\s+/) # advance any spaces that may exist.\n if ss.peek(1) == '\"'\n temp = ss.scan(/\".*?\"/).match(/\"(.*?)\"/).captures[0] rescue nil\n else\n temp = ss.scan_until(/[@A-Za-z0-9._\\-\\/]+/)\n end\n\n break if !temp\n arr << temp.strip\n end\n return arr\n end", "title": "" }, { "docid": "c20c2cde0754e3f2a5d568d4fde273c3", "score": "0.5245586", "text": "def parse_query(query_string)\n @parsed_query ||= Rack::Utils.parse_nested_query(query_string)\n end", "title": "" }, { "docid": "bcfdf7e6525eadfb6405a079947f7bf3", "score": "0.5235876", "text": "def answers\n values.split('|')\n end", "title": "" }, { "docid": "9e6a38e2afdc4f0411215992ab794083", "score": "0.5232952", "text": "def splitInput(user_input)\n input_string = user_input.split \",\"\n end", "title": "" }, { "docid": "f83c8076fcfe9fb554181984bbed2aa0", "score": "0.5229866", "text": "def tokenize(text)\n text.split(\" \")\nend", "title": "" }, { "docid": "609d7db2a83985f4cc29783c1b3f5c09", "score": "0.5224166", "text": "def tokenize\n end", "title": "" }, { "docid": "8989759bd82959b7c9b4c6fa19445ba0", "score": "0.5223839", "text": "def extract_query_params(environment)\n parse_string(environment[ENV_KEY_QUERY])\n end", "title": "" }, { "docid": "1a4fd3c32be9f67348c68dcf1f8086dd", "score": "0.5222664", "text": "def query_values\n parsed_uri.query_values.to_h\n end", "title": "" } ]
6821397268faea69c54e94b57b81cd9e
Find a way to accumulate the :worldwide_grosses and return that Integer using director_data as input
[ { "docid": "5e77566817aab24ce81a5977ddc0fd46", "score": "0.78402203", "text": "def gross_for_director(director_data)\n total = 0\n movies = director_data[:movies]\n movies.length.times do |movie_idx|\n total+=movies[movie_idx][:worldwide_gross]\n end\n return total\nend", "title": "" } ]
[ { "docid": "78129262a5d48c085cf6cb4e93eafdb3", "score": "0.8031094", "text": "def gross_for_director(director_data)\n movie_index = 0\n worldwide_grosses = 0\n while movie_index < director_data[:movies].length\n worldwide_grosses += director_data[:movies][movie_index][:worldwide_gross]\n movie_index += 1\n end\nworldwide_grosses\nend", "title": "" }, { "docid": "e4e9ba4d9fa3f5bb01336cca7bb1adcf", "score": "0.79803103", "text": "def gross_for_director(director_data)\n sum = 0\n\t\n\tdirector_data[:movies].each do |movie|\n\t\tsum += movie[:worldwide_gross]\n\tend\n\t\n\treturn sum\nend", "title": "" }, { "docid": "ebecc3abd3da97763c661f6fbf861fb4", "score": "0.7979809", "text": "def gross_for_director(director_data)\n movie_index = 0\n director_total = 0\n while movie_index < director_data[:movies].length\n director_total += director_data[:movies][movie_index][:worldwide_gross]\n movie_index += 1\n end\n director_total\n\n end", "title": "" }, { "docid": "1873008ef54a7be8deca37b229988d33", "score": "0.7938483", "text": "def gross_for_director(director_data)\n index = 0 \n total = 0 \n while index < director_data[:movies].length do\n total+=director_data[:movies][index][:worldwide_gross]\n index+=1\n end\n total\n end", "title": "" }, { "docid": "3b0b8b06234dfbf840d9ccae9c5e6a84", "score": "0.7927118", "text": "def gross_for_director(director_data)\n\n result = 0\n movie_idx = 0\n while movie_idx < director_data[:movies].count\n result += director_data[:movies][movie_idx][:worldwide_gross]\n movie_idx += 1\n end\n result\nend", "title": "" }, { "docid": "4095852bd32f7881857c54ccbcf14e19", "score": "0.7893617", "text": "def gross_for_director(director_data)\ndirector_gross = 0\n movie_len = director_data[:movies].length\n movie_index = 0\n while movie_index < movie_len do\n director_gross += director_data[:movies][movie_index][:worldwide_gross]\n movie_index += 1\n end\n director_gross\nend", "title": "" }, { "docid": "d682ca8073edecd4d73c73792e644643", "score": "0.77561146", "text": "def gross_for_director(director_data)\n m_index = 0\n director_data = 0\n gross = 0\n while m_index < directors_database[director_data][:movies].length do\n gross += directors_database[director_data][:movies][m_index][:worldwide_gross]\n m_index += 1\nend\ngross\nend", "title": "" }, { "docid": "4beec48a186b993d6e5a257a21811847", "score": "0.77524376", "text": "def gross_for_director(director_data)\n director_gross = 0\n movie_count = 0\n while movie_count < director_data[:movies].length do\n director_gross += director_data[:movies][movie_count][:worldwide_gross]\n movie_count += 1\n end\n director_gross\nend", "title": "" }, { "docid": "ec49f7fb197aab108dc5386a8c7cac40", "score": "0.7717609", "text": "def gross_for_director(director_data)\n gross_for_director=0\n i=0\n while i<director_data[:movies].size\n gross_for_director+=director_data[:movies][i][:worldwide_gross]\n i+=1\n end\n gross_for_director\nend", "title": "" }, { "docid": "90b599c92cfd38519a7b96f8fd0e621b", "score": "0.76706547", "text": "def gross_for_director(director_data)\n i = 0\n tot = 0\n while i < director_data[:movies].count do\n tot += director_data[:movies][i][:worldwide_gross]\n i += 1\n end\n return tot\nend", "title": "" }, { "docid": "af35f6c1d6f66b2fdbab7d49ca9b8e85", "score": "0.7670455", "text": "def gross_for_director(director_data)\n count = 0\n sum = 0\n while director_data[:movies][count] do\n sum += director_data[:movies][count][:worldwide_gross]\n count += 1\n end\n \n return sum\nend", "title": "" }, { "docid": "59f19f8ab744439cef067521f60d56ab", "score": "0.7654349", "text": "def gross_for_director(director_data)\n total_gross = 0\n\n i = 0\n while i < director_data[:movies].length\n worldwide_gross = director_data[:movies][i][:worldwide_gross]\n total_gross += worldwide_gross\n i += 1\n end\n\n total_gross\nend", "title": "" }, { "docid": "eb316bca7dad8695a02da7bfbf0939b4", "score": "0.7608682", "text": "def gross_for_director(director_data)\n movie_count = 0\n total_gross = 0\n while movie_count < director_data[:movies].length do\n total_gross += director_data[:movies][movie_count][:worldwide_gross]\n movie_count += 1\n end\n total_gross\nend", "title": "" }, { "docid": "641d6c0915792c2112c6de7dc23d7df1", "score": "0.76027364", "text": "def gross_for_director(director_data)\n movie_index = 0 \n inner_result = 0 \n while movie_index < director_data[:movies].length do\n inner_result += director_data[:movies][movie_index][:worldwide_gross]\n movie_index += 1 \n end\n inner_result\nend", "title": "" }, { "docid": "b0cd8e877a33150868562cb625e6d76a", "score": "0.7602346", "text": "def gross_for_director(director_data)\n #dir_name = director_data[:name]\n movie_list = director_data[:movies]\n dir_gross = 0\n movie_index = 0\n while movie_index < movie_list.length do\n dir_gross += movie_list[movie_index][:worldwide_gross]\n movie_index += 1\n end\n dir_gross\nend", "title": "" }, { "docid": "edc1509f243d4e57a859f24688488bd6", "score": "0.7588497", "text": "def gross_for_director(director_data)\n row_index = 0\n director_total = 0\n\n while row_index < director_data[:movies].length do\n director_total += director_data[:movies][row_index][:worldwide_gross]\n \n row_index += 1\n end\n\n director_total\nend", "title": "" }, { "docid": "b7c41a5d579aefc702838490a2fe7fef", "score": "0.7581547", "text": "def gross_for_director(director_data)\n total_director_gross = 0\n director_data[:movies].each do |movie|\n total_director_gross += movie[:worldwide_gross]\n end\n total_director_gross\nend", "title": "" }, { "docid": "471ade014924425c4c273b246d69030f", "score": "0.75780565", "text": "def gross_for_director(director_data)\n gross = 0\n director_data[:movies].each do |n|\n gross +=n[:worldwide_gross]\n end\n return gross\nend", "title": "" }, { "docid": "a3c7a0d139e6ae90dc3f4805108334b5", "score": "0.7557646", "text": "def gross_for_director(director_data)\n movie_index = 0 \n total_gross = 0\n while director_data[:movies][movie_index] do \n movie_hash = director_data[:movies][movie_index]\n total_gross += movie_hash[:worldwide_gross]\n movie_index += 1\n end \n total_gross\nend", "title": "" }, { "docid": "99db73bfa276d40a1a191ffe1062deab", "score": "0.75266427", "text": "def gross_for_director(director_data)\ntotal=0\nm= director_data[:movies]\nrow = 0\nwhile row < m.length \n g= m[row][:worldwide_gross]\n row += 1\n total += g\nend\ntotal\n\nend", "title": "" }, { "docid": "d78ecf28f1e4b5ff1880106af5dde2b1", "score": "0.75179535", "text": "def gross_for_director(director_data)\n total=0\n rownum=0\n while rownum< director_data[:movies].length\n total+=director_data[:movies][rownum][:worldwide_gross]\n rownum+=1\nend\nreturn total\nend", "title": "" }, { "docid": "cefde4dd21c5dff0367a017108a13889", "score": "0.75130445", "text": "def gross_for_director(director_data)\n sum = 0\n x = 0\n\n while x < director_data[:movies].length do\n sum += director_data[:movies][x][:worldwide_gross]\n x += 1\n end\n\n sum\nend", "title": "" }, { "docid": "c98ced13c5b10a0031c92c45353a72d3", "score": "0.75070965", "text": "def gross_for_director(director_data)\n #pp director_data\n\n result = []\n movie_index = 0\n\n while movie_index < director_data[:movies].length do\n total_gross = director_data[:movies][movie_index][:worldwide_gross]\n result.push(total_gross)\n movie_index += 1\n end\n puts result\n return result.sum\n end", "title": "" }, { "docid": "661215a3595d470cef71f0bf685b7112", "score": "0.7490392", "text": "def gross_for_director(director_data)\n total = 0\n index = 0\n\n while index < director_data[:movies].length do\n total += director_data[:movies][index][:worldwide_gross]\n index += 1\n end\n\n total\nend", "title": "" }, { "docid": "79cf8c2ba7a1179e7298c9226966878c", "score": "0.7488224", "text": "def director_gross(director_data)\n movies_index = 0\n total = 0\n \n while movies_index < director_data[:movies].count do\n total += director_data[:movies][movies_index][:worldwide_gross] \n movies_index += 1\n end\n total\nend", "title": "" }, { "docid": "e5fff58f3104635d3704aa4a1ad0bd08", "score": "0.74607885", "text": "def gross_for_director(director_data)\ntotal = 0\nmovie_index = 0\n while movie_index<director_data[:movies].length do\n total+=director_data[:movies][movie_index][:worldwide_gross]\n movie_index+=1\n end\ntotal\nend", "title": "" }, { "docid": "2ae0319144eb2b2f1adc609c01f9dd23", "score": "0.7457306", "text": "def gross_for_director(director_data)\n #total gross for director\n director_total = 0\n #movie iterator\n movie_element = 0\n #iterate through movies\n while movie_element < director_data[:movies].length do\n #add movie gross to total for director\n director_total += director_data[:movies][movie_element][:worldwide_gross]\n #increase movie iterator\n movie_element += 1\n end\n return director_total\nend", "title": "" }, { "docid": "3dd9a839cffa52ef0df9659a336744e2", "score": "0.7455809", "text": "def gross_for_director(director_data)\n movies_index = 0\n director_gross = 0\n movies_array = director_data[:movies]\n while movies_index < movies_array.length do\n director_gross += movies_array[movies_index][:worldwide_gross]\n movies_index += 1\n end\n p director_gross\nend", "title": "" }, { "docid": "1c750d501c4691b9750f5fd09536d5f7", "score": "0.74307424", "text": "def gross_for_director(director_data)\n #p director_data\n i = 0\n total = 0\n while i < director_data[:movies].length do\n total += director_data[:movies][i][:worldwide_gross] \n i += 1\n end\n total\nend", "title": "" }, { "docid": "82f8538ce847d22dd5b5bd68f2c1a950", "score": "0.74193025", "text": "def gross_for_director(director_data)\n counter = 0\n #gross = directors_database[:movies].count()\n # len = directors_database[director_data][:movies].length\n# while counter < len do \n# gross = directors_database[0][:movies][0][:worldwide_gross]\n# end\n\n# counter += 1\n # while\n new = 0\n limit = director_data[:movies].size\n while counter < limit do\n new += director_data[:movies][counter][:worldwide_gross]\n \n counter += 1\nend \n \n new\nend", "title": "" }, { "docid": "9fc45a69c3c3611cc850be5dac02c9a6", "score": "0.7405065", "text": "def gross_for_director(director_data)\n i = 0 \n total = 0\n while i < director_data[:movies].length do \n total += director_data[:movies][i][:worldwide_gross]\n i += 1 \n end \n total \nend", "title": "" }, { "docid": "393ebc59bd671adec3d421cbe32aa981", "score": "0.7342975", "text": "def gross_for_director(director_data)\n \n total = 0\n i = 0 \n while i < director_data[:movies].length do\n total += director_data[:movies][i][:worldwide_gross]\n i += 1\n\n\nend\n\nreturn total\nend", "title": "" }, { "docid": "4d2d491ac240da84595dc79568200ccc", "score": "0.73382807", "text": "def gross_for_director(director_data)\n # index = 0\n coordinate_total = 0\n # while index < director_data.length do\n totalindex = 0\n while totalindex < director_data[:movies].length do\n coordinate_total += director_data[:movies][totalindex][:worldwide_gross]\n totalindex += 1\n # end\n # index += 1\n end\n coordinate_total\n\nend", "title": "" }, { "docid": "49f3bf56a6bc416f271498c1317196b1", "score": "0.73297834", "text": "def gross_for_director(director_data)\nmovieNum = 0\ntotalGross = 0\nwhile movieNum < director_data[:movies].length do\n totalGross += director_data[:movies][movieNum][:worldwide_gross]\n movieNum += 1\nend\ntotalGross\nend", "title": "" }, { "docid": "718a43ef24f05e71a81de96c580cc507", "score": "0.73172987", "text": "def gross_for_director(nds)\n\n sum=0\n idx2 = 0\n while idx2 < nds[:movies].length\n # p director_database[idx1][:movies][idx2][:worldwide_gross]\n sum += nds[:movies][idx2][:worldwide_gross]\n idx2 +=1\n end\n # puts sum\n # puts \"-\"\n sum\nend", "title": "" }, { "docid": "d7423da82ac98994421565b91de0fe06", "score": "0.73011154", "text": "def gross_for_director(d)\n total = 0\n index = 0\n while index < d[:movies].length do\n total += d[:movies][index][:worldwide_gross]\n index += 1\n end\n total\nend", "title": "" }, { "docid": "d95de3020be1f3f7afbaa8b347fd555d", "score": "0.7245815", "text": "def gross_for_director(director_data)\n grand_total = 0\n row_index = 0\n column_index = 0\n while column_index < directors_database[row_index][:movies].length do\n grand_total += directors_database[row_index][:movies][column_index][:worldwide_gross]\n column_index += 1\n end\n grand_total\nend", "title": "" }, { "docid": "6079e421feb271f9f293c921f05e655d", "score": "0.71271217", "text": "def gross_for_director(director_data)\nfilmsMade = director_data[:movies].length\n movies_index = 0 \n gross_index = 0\n\n while gross_index < filmsMade do\n director_gross = director_data[:movies][gross_index][:worldwide_gross]\n movies_index += director_gross \n gross_index += 1\n end \n\n movies_index\nend", "title": "" }, { "docid": "8826c2bb87202e829522381ea7e5ddd9", "score": "0.7111531", "text": "def gross_for_director(director_data)\n earnings = 0\n which_mov = 0\n while which_mov < director_data[:movies].length do\n earnings += director_data[:movies][which_mov][:worldwide_gross]\n which_mov += 1\n end\n earnings \nend", "title": "" }, { "docid": "0cc89cfefc3edfd5a1940339d742275b", "score": "0.71051204", "text": "def gross_for_director(director_data)\n\n \n col = 0\n value = 0\n \n while col < director_data[:movies].length do\n \n value = value + director_data[:movies][col][:worldwide_gross]\n # puts director_data[row][:movies][col][:worldwide_gross]\n # puts value\n col += 1\n end\n # puts value\n value \nend", "title": "" }, { "docid": "a39a161717afaedb8bc220e49aed4a47", "score": "0.7100903", "text": "def gross_for_director(director_data)\ntotal = 0\nindex_movies = 0\nmovie = director_data[:movies]\nwhile index_movies < movie.length do\n puts movie[index_movies][:worldwide_gross]\n total = total + movie[index_movies][:worldwide_gross]\n index_movies += 1\n \nend\ntotal\nend", "title": "" }, { "docid": "30f6a13174f13f3e8fc0b59735d6078c", "score": "0.7088414", "text": "def gross_for_director(director_data)\ntotal=0 \ncolumn_index=0\nwhile column_index<director_data[:movies].length do \ntotal+=director_data[:movies][column_index][:worldwide_gross]\ncolumn_index+=1\nend\ntotal\nend", "title": "" }, { "docid": "b9136727225f4cd4862e01cc319a52d4", "score": "0.70537496", "text": "def gross_for_director(nds, element_index)\n total = 0\n new_index = 0\n \n #extract numbers\n while new_index < nds[element_index][:movies].length do\n total = total + nds[element_index][:movies][new_index][:worldwide_gross]\n new_index += 1\n end\n total\nend", "title": "" }, { "docid": "c56c27bf41065f70729bd26866477e01", "score": "0.7034285", "text": "def gross_for_director(director_data)\n\ntotal = 0 \nindex = 0 \n while index < director_data[:movies].length \n director_gross = director_data[:movies][index][:worldwide_gross]\n total += director_gross\n index += 1 \n end \n\n#binding.pry \n\nreturn total\nend", "title": "" }, { "docid": "b470b53b3bb9f6d07b6fe22afdb877c6", "score": "0.70110697", "text": "def gross_for_director(director_data)\n director_total = 0 #intialization\n row_index = 0 # intialization\n\n while row_index < director_data[:movies].length do # \n \n director_total += director_data[:movies][row_index][:worldwide_gross] # adds each movies gross to a value director_total \n \n # puts \" World wide gross for the #{row_index + 1} movie is #{director_total}\" \n row_index += 1 \n end\n return director_total\nend", "title": "" }, { "docid": "35579d9186da7558547f2d248230641f", "score": "0.70058215", "text": "def gross_for_director(director_data)\n new_array = director_data[:movies]\n i = 0 \n total_gross = 0\n while i < new_array.length do\n anotha_array = new_array[i]\n gross = anotha_array[:worldwide_gross]\n total_gross += gross\n i+=1\n end\n total_gross\nend", "title": "" }, { "docid": "c76ccc5d618b881ca599017f88301945", "score": "0.68818974", "text": "def gross_for_director(director_data)\n \n result = {}\n movie_gross = 0\n movie_index = 0\n \n director_movies = director_data[:movies] # this is pointing to an array of hashes\n puts director_movies\n director_name = director_data[:name] # √\n \n while movie_index < director_movies.count do\n movie_gross += director_movies[movie_index][:worldwide_gross]\n movie_index +=1\n end\n \n movie_gross \nend", "title": "" }, { "docid": "c02af6d1c4fc249081e7b82c2f7dcd1b", "score": "0.67901564", "text": "def gross_for_director(director_data)\n array = director_data[:movies]\n i = 0 \n total = 0\n \n while i < array.length do\n obj = array[i]\n income = obj[:worldwide_gross]\n \n total += income\n i+=1\n end\n \n return total\nend", "title": "" }, { "docid": "9f8ee97617cd5f6a0ea66ff3ae469ee1", "score": "0.65614986", "text": "def total_gross(source)\n total =0 \n name_key = list_of_directors(source)\n individual_gross_hash = directors_totals(source)\n dir_index=0\n while dir_index < name_key.length\n total+= individual_gross_hash[name_key[dir_index]]\n dir_index+=1 \n end\n total\nend", "title": "" }, { "docid": "af26b8e38fe424e93e8bc25501c2d85e", "score": "0.6450366", "text": "def total_gross(source)\n # Write this implementation\n #\n # Should use methods:\n # 1. directors_totals: returns a Hash of { dir_name => gross }\n # 2. list_of_directors: names provides an Array of directors names (use\n \n total_all_directors = 0\n idx_dir = 0\n # Array de string\n noms_de_dirs = list_of_directors(source)\n # Hash donde las llaves son string y los valores son Integer\n money_dirs = directors_totals(source)\n \n while idx_dir < noms_de_dirs.length\n # Key is a string\n key = noms_de_dirs[idx_dir]\n total_all_directors += money_dirs[key]\n idx_dir += 1 \n end\n \n return total_all_directors\n \n #\n # Visit each key (i.e. director name), look up the value in the hash\n # returned by directors_totals, and add it to a running total. When done,\n # return the total\nend", "title": "" }, { "docid": "b3437ae62e797a541f30d91caefaa3e3", "score": "0.6174805", "text": "def gross_for_director(director_data)\nend", "title": "" }, { "docid": "b3437ae62e797a541f30d91caefaa3e3", "score": "0.6174805", "text": "def gross_for_director(director_data)\nend", "title": "" }, { "docid": "e6bad6e564c212c6609e8f2d97ed134b", "score": "0.61691153", "text": "def directors_totals(nds)\n # Remember, it's always OK to pretty print what you get *in* to make sure\n # that you know what you're starting with!\n #\n #\n # The Hash result be full of things like \"Jean-Pierre Jeunet\" => \"222312123123\"\n\n #\n # Use loops, variables and the accessing method, [], to loop through the NDS\n # and total up all the\n # ...\n # ...\n # ...\n #\n #\n # Be sure to return the result at the end!\n\n result = {}\n\n director_index = 0\n movie_index = 0\n\n while director_index < nds.size do\n director = nds[director_index][:name]\n result[director] = 0\n while movie_index < nds[director_index][:movies].size do\n result[director] += nds[director_index][:movies][movie_index][:worldwide_gross]\n movie_index += 1\n end\n director_index += 1\n movie_index = 0\n end\n\n result\nend", "title": "" }, { "docid": "7abea0074e54c1a2337458e2a99f0c19", "score": "0.6123935", "text": "def directors_totals(nds)\n result = {} \n directors_index = 0 \n while directors_index < nds.length do \n directors = nds[directors_index][:name]\n result[directors] = 0 \n movie_index = 0\n totalmade = 0 \n while movie_index < nds[directors_index][:movies].length do\n directors_gross = nds[directors_index][:movies][movie_index][:worldwide_gross]\n result[directors] += directors_gross\n movie_index += 1 \n end \n directors_index += 1 \n end \n result\nend", "title": "" }, { "docid": "69b4be63b063ab042105ce7bc847165a", "score": "0.5980127", "text": "def directors_totals(nds)\n total = {}\n i = 0\n while i < nds.length do\n director = nds[i][:name]\n total[director] = gross_for_director(nds[i])\n i += 1 \n end\n return total \nend", "title": "" }, { "docid": "e184f190aa5fae79a9cf30cd74ec9e33", "score": "0.5973894", "text": "def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend", "title": "" }, { "docid": "e184f190aa5fae79a9cf30cd74ec9e33", "score": "0.5973502", "text": "def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend", "title": "" }, { "docid": "e184f190aa5fae79a9cf30cd74ec9e33", "score": "0.5973502", "text": "def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend", "title": "" }, { "docid": "e184f190aa5fae79a9cf30cd74ec9e33", "score": "0.5973502", "text": "def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend", "title": "" }, { "docid": "e184f190aa5fae79a9cf30cd74ec9e33", "score": "0.5973502", "text": "def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend", "title": "" }, { "docid": "e184f190aa5fae79a9cf30cd74ec9e33", "score": "0.5973502", "text": "def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend", "title": "" }, { "docid": "e184f190aa5fae79a9cf30cd74ec9e33", "score": "0.5973502", "text": "def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend", "title": "" }, { "docid": "e184f190aa5fae79a9cf30cd74ec9e33", "score": "0.5973502", "text": "def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend", "title": "" }, { "docid": "e184f190aa5fae79a9cf30cd74ec9e33", "score": "0.5973502", "text": "def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend", "title": "" }, { "docid": "e184f190aa5fae79a9cf30cd74ec9e33", "score": "0.5973502", "text": "def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend", "title": "" }, { "docid": "e184f190aa5fae79a9cf30cd74ec9e33", "score": "0.5973502", "text": "def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend", "title": "" }, { "docid": "e184f190aa5fae79a9cf30cd74ec9e33", "score": "0.5973502", "text": "def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend", "title": "" }, { "docid": "e184f190aa5fae79a9cf30cd74ec9e33", "score": "0.5973502", "text": "def studios_totals(nds)\n a_o_a_movies_with_director_names = movies_with_directors_set(nds)\n movies_with_director_names = flatten_a_o_a(a_o_a_movies_with_director_names)\n return gross_per_studio(movies_with_director_names)\nend", "title": "" }, { "docid": "85941d3fa27654fb3282eeb27aa105c7", "score": "0.59608614", "text": "def gross_for_director(director_data)\n\nend", "title": "" }, { "docid": "023094104aa386c40a44130908eaedbe", "score": "0.5955702", "text": "def gross_per_studio(collection)\n result = {}\n i = 0\n while i < collection.size do\n studio = collection[i][:studio]\n total_earnings = collection[i][:worldwide_gross]\n if !result[studio]\n result[studio] = total_earnings\n else\n result[studio] += total_earnings\n end\n i += 1\n end\n \n # GOAL: Given an AoH where each Hash is a movie, return a Hash that includes\n # the total worldwide_gross of all the movies from each studio.\n #\n # INPUT: (collection) AoH where each Hash represents a movie\n #\n # RETURN: Hash where the keys are the studios and the values are the sum of\n # all the worldwide_gross numbers for every movie in the input Hash\n \n result\nend", "title": "" }, { "docid": "e25dbd156388c90ccce2704916cb3f88", "score": "0.59445286", "text": "def get_gross_for(title, movies)\n movie = movies.find{|movie| movie[:title] == title}\n movie = movie[:gross].gsub(/[$,]/, '').to_i\nend", "title": "" }, { "docid": "25b9f83168ca973aff9ad95f1eca68de", "score": "0.5901632", "text": "def directors_totals(nds)\nresult = []\n r_index=0 \n while r_index < nds.length \n i=0 \n total=0 \n\n n= nds[r_index][:name]\n t= nds[r_index][:movies]\n while i < t.length\n \n k= t[i][:worldwide_gross]\n total += k\n \n i += 1\n end\n r_index += 1\n result << [n , total]\n end\n result.to_h\n end", "title": "" }, { "docid": "8718ed9be424608f2b880dde21f9f499", "score": "0.58542395", "text": "def directors_totals(source)\n result = {}\n director_index = 0\n while director_index < source.size do\n director = source[director_index]\n result[director[:name]] = gross_for_director(director)\n director_index += 1\n end\n result\nend", "title": "" }, { "docid": "cd28165aba00f1c228594815e57bfe81", "score": "0.58192456", "text": "def determine_winner game\n winner = game.max_by {|team| team[:score]}\n team_standings = get_team_by_name(winner)\n team_standings[:winnings] += 3\nend", "title": "" }, { "docid": "1218c9da1aeabbde8b114ed4b4215ed2", "score": "0.5805637", "text": "def gross_per_studio(collection)\n new_hash = {}\n counter = 0 \n while counter < collection.length do \n studio_name = collection[counter][:studio]\n ww_gross = collection[counter][:worldwide_gross]\n if !new_hash[studio_name]\n new_hash[studio_name] = ww_gross\n else \n new_hash[studio_name] += ww_gross\n end \n counter += 1 \nend\nreturn new_hash\nend", "title": "" }, { "docid": "d3ab536db19587875b8d852dcc00138e", "score": "0.5773283", "text": "def cumulative_gross(array)\n #gave the franchise total of 0\n bond_franchise = 0\n #loop through the array of each movie\n array.each {|movie|\n #get the movie to be an integer and put that as a variable of the gross\n the_gross = movie[:gross].delete('$').split(',').join.to_i\n #the total of the franchise will add the gross of each movie\n #as it loops it will continue adding all the gross together\n bond_franchise = bond_franchise + the_gross\n }\n #this will output the total gross in integer that is converted back into $ with , to read the total $ about better\n puts \"#{bond_franchise.to_s.reverse.scan(/.{1,3}/).join(',').reverse.insert(0,'$')}\"\nend", "title": "" }, { "docid": "53c46c425dcc1358fc8f9004ebb3e001", "score": "0.5750204", "text": "def gross(movie_name)\n for m in movies\n if m.title == movie_name\n return m.gross\n end\n end\n return -1\n end", "title": "" }, { "docid": "f88a498375c4e44d45f3bb30f917742e", "score": "0.57047683", "text": "def total_medals_per_team(olympic_data)\n\n team_medals_hash = {}\n\n olympic_data.each do |data|\n\n if team_medals_hash.key?(data[\"Team\"])\n if [\"Gold\", \"Silver\", \"Bronze\"].include?(data[\"Medal\"]) #SAME TEAM, MEDAL\n team_medals_hash[data[\"Team\"]] += 1\n end\n else\n\n if [\"Gold\", \"Silver\", \"Bronze\"].include?(data[\"Medal\"]) # NEW TEAM, MEDAL\n team_medals_hash[data[\"Team\"]] = 1\n else\n team_medals_hash[data[\"Team\"]] = 0\n\n end\n end\n end\n return team_medals_hash\nend", "title": "" }, { "docid": "f5032a993cd9ae08dc3b892e3731234d", "score": "0.56717676", "text": "def battlers_number\n return @battlers_number.sum\n end", "title": "" }, { "docid": "568d4f8f95531aadbb77f89e4e952814", "score": "0.55998516", "text": "def count_contestants_by_hometown(data, hometown)\n home_town = 0\n data.each do |season_iteration, stats|\n stats.each do |town|\n if town[\"hometown\"] == hometown\n home_town = home_town + 1\n end\n end\n end\n return home_town\nend", "title": "" }, { "docid": "ffbd3c08a19c0386f5bac76f611d6f47", "score": "0.5562344", "text": "def lift_total_for_gym\n total = 0\n lifters.each do |lifter|\n total += lifter.lift_total\n end\n total\n end", "title": "" }, { "docid": "1c08f9ea804d006cdb7c7a04797c6375", "score": "0.5509787", "text": "def week_1_total\n total = 0\n rostered_players.each do |rostered_player|\n total += rostered_player.player.week_1_score\n end\n return total\n end", "title": "" }, { "docid": "c3000a767a7e1648259df6a45fd8e533", "score": "0.5499239", "text": "def its_a_tie game\n game.each do |team|\n team_standings = get_team_by_name(team)\n team_standings[:winnings] += 1\n end\nend", "title": "" }, { "docid": "c533178d608ac4ae1faa5b6b0512d0fa", "score": "0.5497839", "text": "def big_shoe_rebounds\n big_foot = 0\n boards = 0\n\n game_hash.values.each do |roster|\n roster[:players].each do |player|\n if player[:shoe] > big_foot\n big_foot = player[:shoe]\n boards = player[:rebounds]\n end\n end\n end\n return boards\nend", "title": "" }, { "docid": "bfec5bf495f55bddecb1835e2ccbd9d3", "score": "0.54870695", "text": "def occupation\n occupation_sum = 0\n team_roles.each do |team_role|\n occupation_sum += team_role.occupancy\n end\n return occupation_sum\n end", "title": "" }, { "docid": "ce08eb35b1ecce9e39a1ab19a5faad5e", "score": "0.54865295", "text": "def total\n wins + losses\n end", "title": "" }, { "docid": "ed396542b7cb1d2693917fbdfd740d99", "score": "0.54856676", "text": "def determine_possible_num_moves(gm, rd, md)\n puts \"Determining possible total moves...\"\n min = [ md[:max_val], rd[:num_regions] * 2 - 1 ].max\n max = gm[:x] * gm[:y]\n poss_ms = []\n for i in min..max do\n if i % rd[:num_regions] == 0 or (i + 1) % rd[:num_regions] == 0\n poss_ms.push(i)\n end\n end\n puts \"poss_ms = \" + poss_ms.to_s\n return poss_ms\nend", "title": "" }, { "docid": "c35f0a08cf8dfb5f88be68056a500f67", "score": "0.54692435", "text": "def moneys_total\n moneys_total = 0\n mini_maps.each do |map|\n moneys_total += map.moneys_total\n end\n return moneys_total\n end", "title": "" }, { "docid": "a305667681190b1185247b335e9844ca", "score": "0.54657096", "text": "def num_points_scored(player)\n game_hash.each do |location, team_data| #location returns away, team_data returns hash\n # binding.pry\n team_data.each do |attribute, data|\n # binding.pry\n if attribute == :players\n data.each do |player_name, categories|\n # binding.pry\n if player_name == player\n # binding.pry\n return categories[:points]\n end\n end\n end\n end\n end\nend", "title": "" }, { "docid": "727c4c3a182775afe692514ae93474a3", "score": "0.54564446", "text": "def number( gm )\n num = nil\n gm.players.each_with_index{|pl, i| num = i if (pl == self) }\n (num + 1) if num.is_a? Integer\n end", "title": "" }, { "docid": "03fb3cfdced9fc71271a32ed8fd9cee4", "score": "0.5451575", "text": "def num_points_scored(player_name)\npoints_scored = 0\ngame_hash.each do |location, team_data|\n team_data.each do |attribute, data|\n if attribute == :players\n data.each do |player, stats|\n if player == player_name\n points_scored = stats[:points]\n end\n end\n end\n end\nend\npoints_scored\nend", "title": "" }, { "docid": "c79d29572d1a9f97162c2ccbcb6b8d26", "score": "0.54369634", "text": "def count_losses\n loss_no = 0\n Battle.where(\"movie_loser\" => self.id).each do\n loss_no += 1 \n end\n return loss_no\n end", "title": "" }, { "docid": "25d7e6fabe45d9932f4b1a22e10d18ca", "score": "0.5427193", "text": "def lift_total_for_gym\n total = 0\n self.lifters.each do |lifter|\n total += lifter.lift_total\n end\n total\n end", "title": "" }, { "docid": "e8ecc7135e1ca87142e8e04d91281b10", "score": "0.54168975", "text": "def total_medals_per_team(olympic_data)\n counts = olympic_data.group_by{ |x| x[:\"Team\"] }.map{ |x,y| [x,y.count] }\n counts = Hash[counts]\n return counts\nend", "title": "" }, { "docid": "6101a5cd8683e101b56830d2204f56a5", "score": "0.5408306", "text": "def get_gross_for(title,array)\n #loops the array and locates each hash in the array\n array.each {|movie|\n #if the title of the move matches the symbol title in the hash then\n if title == movie[:title]\n #gives the movie gross by deleting the $ sign and removing the , to join it and return the integer only\n puts \"#{movie[:gross].delete('$').split(',').join.to_i}\"\n end\n }\nend", "title": "" }, { "docid": "6fe27ac2fa96ccee24ae9d42144a2c55", "score": "0.5407796", "text": "def num_points_scored(player_name)\n\ngame_hash.each do |location, team_data|\n team_data.each do |attribute, values|\n if attribute == :players\n values.each do |person, data|\n if person.to_s == player_name\n return game_hash[location][:players][person][:points]\n end\n end\n end\n end\n end\nend", "title": "" }, { "docid": "89e641805e19e7c12e015fc9888c7512", "score": "0.54059726", "text": "def count_contestants_by_hometown(data, hometown)\n all_seasons(data).reduce(0) do |sum, contestant|\n if contestant[\"hometown\"] == hometown \n sum + 1 \n else \n sum \n end\n end\nend", "title": "" }, { "docid": "1b94cc73634469381dfb37e33bfdb94e", "score": "0.54009634", "text": "def total_games_by_coach_by_season\n @total_games_by_coach = Hash.new{ |hash, key| hash[key] = 0}\n @by_season_game_team_objects.each do |game_by_season|\n @total_games_by_coach[game_by_season[\"head_coach\"]] += 1\n end\n end", "title": "" }, { "docid": "44e3cf24374d42c5d92233aa30346f1c", "score": "0.5396148", "text": "def combined_lift_total\n clt = 0\n Membership.all.select do |membership_instance|\n if membership_instance.gym == self\n clt += membership_instance.member.lift_total\n end\n end\n clt\n end", "title": "" }, { "docid": "2009a9768659f07625b08c8e7993465f", "score": "0.5395128", "text": "def winning_team\n final_scores = player_collection.reduce(home: 0, away: 0) { |teams_points, next_player|\n case \n when next_player[:location] === :away\n teams_points[:away] += next_player[:points];\n when next_player[:location] === :home\n teams_points[:home] += next_player[:points];\n end\n teams_points; \n }\n winner = final_scores.reduce { |highest_points, team_points| \n highest_points[1] > team_points[1] ? highest_points : team_points; \n }\n game_hash[winner[0]][:team_name]; \nend", "title": "" } ]
f8665ed6d8395b38fea489257ee9c17b
Create an application for the group and start it
[ { "docid": "72ba1b20acdb46c3aa8d0a8dbbe831ff", "score": "0.6464211", "text": "def exec(name)\n create_resource(name, type: 'application', binary_path: name)\n\n e_uid = SecureRandom.uuid\n\n e_name = \"#{self.name}_application_#{name}_created_#{e_uid}\"\n\n resource_group_name = \"#{self.id}_application\"\n\n def_event e_name do |state|\n state.find_all { |v| v[:hrn] == name && v[:membership] && v[:membership].include?(resource_group_name)}.size >= self.members.uniq.size\n end\n\n on_event e_name do\n resources[type: 'application', name: name].state = :running\n end\n end", "title": "" } ]
[ { "docid": "e2ec0c650d0874e700023a94b3596996", "score": "0.71195596", "text": "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", "title": "" }, { "docid": "f33ad91d0bdece25a00a176d9c412e2f", "score": "0.700193", "text": "def startApplication(name)\n ctxt = @applications[name]\n raise OEDLIllegalArgumentException.new(:group, :name) unless ctxt\n ctxt.startApplication(self)\n \n# raise \"SHOULDN'T #{ctxt}\"\n# debug(\"Starting application '\", name, \"'\")\n# if (ctxt == nil)\n# raise \"Unknown application '#{name}' (#{@applications.keys.join(', ')})\"\n# end\n#\n# # With OMLv2 the collection server can be started as soon as EC is running\n# # Thus we comment this line and start the OML Server in the main nodehandler.rb file\n# #OmlApp.startCollectionServer\n#\n# app = ctxt[:app]\n# bindings = ctxt[:bindings]\n# env = ctxt[:env]\n# appDef = app.appDefinition\n# procName = \"app:#{name}\"\n# cmd = [procName, 'env', '-i']\n# if (env != nil)\n# env.each {|name, value|\n# cmd << \"#{name}=#{value}\"\n# }\n# end\n#\n# cmd << appDef.path\n# pdef = appDef.properties\n# # check if bindings contain unknown parameters\n# if (bindings != nil)\n# if (diff = bindings.keys - pdef.keys) != []\n# raise \"Unknown parameters '#{diff.join(', ')}'\" \\\n# + \" not in '#{pdef.keys.join(', ')}'.\"\n# end\n# cmd = appDef.getCommandLineArgs(procName, bindings, self, cmd)\n# end\n# send(:exec, *cmd)\n end", "title": "" }, { "docid": "20f689d4137821cd64053bf7cf609515", "score": "0.6815102", "text": "def start_apps\n check_apps\n remove_sockets\n _start_apps(ARGV[1])\nend", "title": "" }, { "docid": "d141493259a6b682e06813bed490478e", "score": "0.6639834", "text": "def exec(command, show_std=true)\n name = SecureRandom.uuid\n\n self.synchronize do\n @execs << name\n end\n\n create_application(name, {binary_path: command}) do\n info \"Sending app start for command '#{command}' in group '#{@name}'\"\n after(2) {\n run_application(name, show_std)\n }\n end\n end", "title": "" }, { "docid": "93bcbbfc05c9a6f37a839b49fa50d382", "score": "0.66239583", "text": "def add_app_group(group,app)\n\t\tresults = submit_cmd('create app group',:db,\" -env #{self.env} -domain #{self.domain} -plant #{self.plant} -group #{group} -app_instance #{app}\")\n\t puts results\n\tend", "title": "" }, { "docid": "2210cb83f1bd12c65d49cb2b1565a892", "score": "0.6559857", "text": "def startApplications(show_std=true)\n if @app_contexts.empty?\n warn \"No applications defined in group #{@name}. Nothing to start\"\n else\n @applications.each { |app|\n run_application(app[:name], show_std)\n }\n end\n end", "title": "" }, { "docid": "8f95e7a016ecdfb94bb81a1a79d5f94d", "score": "0.64444804", "text": "def create_app()\n app = OpenShift::TestApplication.new(self)\n\n $logger.info(\"Created new application #{app.name} for account #{@name}\")\n\n @apps << app\n app\n end", "title": "" }, { "docid": "6eb0e2df0d404d841dc087439e981a2d", "score": "0.6328973", "text": "def application(name, options = {}, &blk)\n add_child(:applications, Hubcap::Application.new(self, name, options, &blk))\n end", "title": "" }, { "docid": "888439cf75f5a4dabb3657ada94e8430", "score": "0.6253399", "text": "def roby_app_start(*args, silent: false, **options)\n pid = roby_app_spawn(*args, silent: silent, **options)\n interface = assert_roby_app_is_running(pid)\n [pid, interface]\n end", "title": "" }, { "docid": "83622a97fcec8a2746e0c55cf3f17929", "score": "0.6223246", "text": "def start_app\nend", "title": "" }, { "docid": "38ea7e173ef4e39d445a88214f5eac3d", "score": "0.6184946", "text": "def start app, &block\n # run available process types\n app[\"ps\"].each do |type,ps|\n ps[\"scale\"].times do |index|\n host = GV::Valley::Runner.random_service \n app[\"ps\"][type][\"containers\"] << host.start(app[\"name\"], type, index, &block)\n end\n end\n end", "title": "" }, { "docid": "ce514011d413926bcb3672792952b0fa", "score": "0.6118034", "text": "def run!(options = {})\n Celluloid.boot\n @instance = AppSupervisor.new(registry, options)\n end", "title": "" }, { "docid": "aa6011cdc11e21b6cc6a7d2af2cf934f", "score": "0.6104859", "text": "def start\n puts \"Starting #{@resource[:name]}\"\n return if running?\n cmd = [command(:instance_manager)]\n cmd += [\"start\"]\n cmd += [@resource[:name]]\n run(cmd)\n end", "title": "" }, { "docid": "d935f768254b2516e8d70d6f90bd31dc", "score": "0.6101434", "text": "def run_application\n if Souffle::Config[:daemonize]\n Souffle::Config[:server] = true\n Souffle::Daemon.daemonize(\"souffle\")\n end\n @app.run\n end", "title": "" }, { "docid": "ae47039fd75cee865ef221ba8d4eb0d1", "score": "0.60836416", "text": "def run\n @pid = fork do \n initialize_sandbox\n exec(@app)\n end\n\n _, @exit_status = Process.wait2(@pid)\n @pid\n end", "title": "" }, { "docid": "fe2bc451aa35f0efe85b8b8cee5bd0ea", "score": "0.601079", "text": "def setup_application\n Souffle::Daemon.change_privilege\n Souffle::Config[:server] = true if Souffle::Config[:daemonize]\n @app = Souffle::Server.new\n end", "title": "" }, { "docid": "146de1fa6a1c3c6faf5dbcb6b37806df", "score": "0.59884536", "text": "def launch_app\n @bridge.launch_app\n end", "title": "" }, { "docid": "04e51e1380a3f457cae29f8422a0612e", "score": "0.5954625", "text": "def create(name, type)\n configure [\"aaa group server #{type} #{name}\", 'exit']\n end", "title": "" }, { "docid": "3307550b0d67b1bf206205c2e7ebbec7", "score": "0.5917975", "text": "def new(name)\n ARGV.shift\n #@log.debug \"command 'new' with arguments: #{ARGV.join(', ')}\"\n Generator::Application.start ARGV\n end", "title": "" }, { "docid": "ffa1eb19efb64ef161988201fbfb9c0b", "score": "0.59084296", "text": "def run\n reconfigure\n setup_application\n run_application\n end", "title": "" }, { "docid": "ec91cd0714cf84aac8846d162affae30", "score": "0.59008414", "text": "def addApplication(app)\n super(app)\n eachGroup { |g|\n # inform all enclosed groups, but do not request another install\n g.addApplication(app)\n }\n end", "title": "" }, { "docid": "ca0f49ee9f4aa01433a903c38e8e53e1", "score": "0.588989", "text": "def create_app_root\n puts \"Create app root named #{name}\"\n end", "title": "" }, { "docid": "a52371815643b56fb9dd5164fcf14bd2", "score": "0.5866718", "text": "def launch(app_id, args)\n runcmd 'launch', \"#{app_id} #{args}\" \n end", "title": "" }, { "docid": "9125f41319bd8b609d31b64025a5547a", "score": "0.5852595", "text": "def create_group\n group new_resource.group do\n gid new_resource.gid\n system true\n end\n end", "title": "" }, { "docid": "418cbeedf0b2ebe781c391353c7dd271", "score": "0.5831319", "text": "def start\n if !autoscaling_group.exists?\n @task.warn { \"Autoscaling group #{@name} doesn't exist\" }\n return\n end\n\n if autoscaling_group.suspended_processes.empty?\n @task.debug { \"Scaling group #{@name} already running\" }\n else\n start_instances\n\n @task.unsafe(\"Resuming #{@name} processes\") do\n autoscaling_group.resume_all_processes\n end\n end\n end", "title": "" }, { "docid": "5ac76513b223ea4469fa0274b43f477e", "score": "0.5804558", "text": "def app_with_pid pid\n AX::Application.new pid\n end", "title": "" }, { "docid": "8338a5b0d677f2ea7d3f7f952c7b4812", "score": "0.57963735", "text": "def run\n unless !@valid_name || File.exists?(@project_name) || File.directory?(@project_name)\n $stdout.puts \"Creating goliath application under the directory #{@project_name}\"\n FileUtils.mkdir @project_name\n \n create_base_dirs\n copy_files_to_target\n setup_api_module\n copy_files_to_dir 'application.rb','config'\n copy_files_to_dir 'database.yml','config'\n $stdout.puts \"\\e[1;32m \\trun\\e[0m\\tbundle install\"\n Dir.chdir(\"#{@project_name}\")\n system(\"bundle install\")\n else \n unless !@valid_name\n $stdout.puts \"\\e[1;31mError:\\e[0m The directory #{@project_name} already exists, aborting. Maybe move it out of the way before continuing.\"\n end\n end\n end", "title": "" }, { "docid": "1bb91e78b14b0f5b5ef2e352e2819922", "score": "0.5795395", "text": "def create(cli = false)\n $logger.info(\"Creating new gear #{@uuid} for application #{@app.name}\")\n\n if cli\n command = %Q(oo-devel-node app-create -c #{uuid} -a #{@app.uuid} --with-namespace #{@app.account.domain} --with-app-name #{@app.name} --with-secret-token=DEADBEEFDEADBEEFDEADBEEFDEADBEEF)\n $logger.info(%Q(Running #{command}))\n results = %x[#{command}]\n assert_equal(0, $?.exitstatus, %Q(#{command}\\n #{results}))\n end\n\n # Create the container object for use in the event listener later\n begin\n @container = OpenShift::Runtime::ApplicationContainer.new(@app.uuid, @uuid, nil, @app.name, @app.name, @app.account.domain, nil, nil)\n rescue Exception => e\n $logger.error(\"#{e.message}\\n#{e.backtrace}\")\n raise\n end\n\n unless cli\n @container.create('DEADBEEFDEADBEEFDEADBEEFDEADBEEF')\n end\n end", "title": "" }, { "docid": "84eeaed0b75809fb8cb9127eb294949a", "score": "0.5779886", "text": "def start\n puts \"Starting clusters...\"\n for app in @apps\n if @env == :deployment\n #need to check if application has a pid file so we don't start\n pid_file = \"#{APP_PATH}/log/doozer.#{app[:port]}.pid\"\n raise \"pid file already exists for #{pid_file}\" if File.exist?(pid_file)\n cmd = \"rackup #{@config} -p #{app[:port]} -E #{@env.to_s} -s #{@server} -o #{app[:ip]} #{@daemonize} -P #{pid_file}\" \n puts \"=> #{cmd}\"\n system(cmd)\n else\n cmd = \"rackup #{@config} -p #{app[:port]} -E #{@env.to_s} -s #{@server} -o #{app[:ip]}\" \n puts \"=> #{cmd}\"\n system(cmd)\n break\n end\n end\n puts \"Did they start?\"\n system(\"ps -aux | grep rackup\")\nend", "title": "" }, { "docid": "92b5ad131963c2ab018c19d11d93c0f4", "score": "0.5754172", "text": "def startApplications()\n debug(\"Start all applications\")\n @applications.each_key { |name|\n startApplication(name)\n }\n end", "title": "" }, { "docid": "267f049413748e09402be2fd6c200d4d", "score": "0.57120925", "text": "def roby_app_spawn(*args, silent: false, **options)\n if silent\n options[:out] ||= \"/dev/null\"\n options[:err] ||= \"/dev/null\"\n end\n pid = spawn(roby_bin, *args, chdir: app_dir, **options)\n @spawned_pids << pid\n pid\n end", "title": "" }, { "docid": "b2edb1dea9817beeb25349fbdc1fc0ee", "score": "0.5694098", "text": "def application!\n res = get!(APPLICATION_PATH)\n build_application(res)\n end", "title": "" }, { "docid": "203f66cac7528a146002ad8712aa92f0", "score": "0.56581247", "text": "def start_app_manager_server\n @state = \"Starting up AppManager\"\n env_vars = {}\n start_cmd = [\"/usr/bin/python #{APPSCALE_HOME}/AppManager/app_manager_server.py\"]\n stop_cmd = \"/usr/bin/pkill -9 app_manager_server\"\n port = [AppManagerClient::SERVER_PORT]\n MonitInterface.start(:appmanagerserver, start_cmd, stop_cmd, port, env_vars)\n end", "title": "" }, { "docid": "02f2c0b9e9e6fd8c2a61ec6dc8cbaf0b", "score": "0.5633257", "text": "def run file_name \n application = select_app file_name \n system \"#{application} #{file_name}\" \n end", "title": "" }, { "docid": "1a2c2570bac9b34b9bf226709fef1cde", "score": "0.5624864", "text": "def run file_name\n application = select_app file_name\n system \"#{application} #{file_name}\"\n end", "title": "" }, { "docid": "1a2c2570bac9b34b9bf226709fef1cde", "score": "0.5624864", "text": "def run file_name\n application = select_app file_name\n system \"#{application} #{file_name}\"\n end", "title": "" }, { "docid": "af796027bd066371ce17e9aab3cbaca3", "score": "0.56165576", "text": "def run file_name \n\t\tapplication = select_app file_name \n\t\tsystem \"#{application} #{file_name}\" \n\tend", "title": "" }, { "docid": "c5180eb1132cf1517d095e4dbb9f32ac", "score": "0.56073034", "text": "def new\n puts \"Creating new blank Praxis app under #{app_name}\"\n create_root_files\n create_config\n create_app\n create_design\n create_spec\n create_docs\n end", "title": "" }, { "docid": "1da9ae8b19d75e834e92ebf161790de0", "score": "0.56009185", "text": "def start_monit\n pidfile = \"/var/run/lock/#{app['shortname']}/puma.pid\"\n context.execute \"monit start #{adapter}_#{app['shortname']}\" do\n retries 3\n creates pidfile\n end\n end", "title": "" }, { "docid": "dc690001314fa224b28dc4643ee51cbf", "score": "0.5588583", "text": "def run_app(command, arguments)\nend", "title": "" }, { "docid": "e4aa793ced7f635f21a1c7571a408baf", "score": "0.55881137", "text": "def run file_name\n\t\tapplication = select_app file_name\n\t\tsystem \"#{application} #{file_name}\"\n\tend", "title": "" }, { "docid": "43f5a57b770358b079a8225b230c58c8", "score": "0.55844706", "text": "def run( file_name )\n application = select_app( file_name )\n system( \"#{application} #{file_name}\" )\n end", "title": "" }, { "docid": "8edeaf0e56bb3bf381d40b0b2cbdc87c", "score": "0.5552433", "text": "def run_on_appgroup_in_zone(zone_name, appgroup_name, appgroup_data)\n $log.debug(\"Creating specs for appgroup #{appgroup_name}\")\n\n # check controller\n controller_data = appgroup_data[:controller]\n if controller_data[:type] == 'fig'\n # get fig file name\n figfile_part = controller_data[:file] || \"#{zone_name}/fig.yaml\"\n figfile = File.join(File.expand_path(@target_dir), figfile_part)\n\n template = SpecTemplatesContainers.build_template__fig_file_is_valid\n erb = ERB.new(template, nil, '%')\n @spec_code << erb.result(binding)\n\n template = SpecTemplatesContainers.build_template__fig_containers_are_up\n erb = ERB.new(template, nil, '%')\n @spec_code << erb.result(binding)\n end\n\n $log.debug(\"Done for appgroup #{appgroup_name}\")\n end", "title": "" }, { "docid": "4cba0729051ac5c6153356f0a1d4c3b3", "score": "0.55436397", "text": "def start *args\n return self if attached? or running?\n @pid = ::Process.spawn Nutcracker.executable, *command\n Process.detach(@pid)\n sleep 2\n raise \"Nutcracker failed to start\" unless running?\n Kernel.at_exit { kill if running? }\n self\n end", "title": "" }, { "docid": "c354b75e59acb9ac45fb951d79d75efd", "score": "0.5542295", "text": "def create_application(name)\n store_dir = File.join(@path, name)\n FileUtils.mkdir_p store_dir\n \n ApplicationConfiguration.new name, store_dir\n end", "title": "" }, { "docid": "9fb7c09902e1c2ac059809890e26f08c", "score": "0.55298656", "text": "def createGroup\n call :createGroup\n end", "title": "" }, { "docid": "26dfc4adfb4c32ff2c20b2aa30032453", "score": "0.551268", "text": "def create_app(name, url)\n JSON.parse((@cloudvox_api[\"/applications/create.json\"].post :call_flow => {:name => name}, :agi => {:url => url}).body)\n end", "title": "" }, { "docid": "9a13cb4170ac09850b77c67d1bd8c623", "score": "0.54983187", "text": "def run(app, *args)\n opts = args.extract_options!\n @main_app = app\n @build.run(app)\n end", "title": "" }, { "docid": "fcabfa32c7a2e9f287e026dcfc4769a6", "score": "0.5492705", "text": "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", "title": "" }, { "docid": "23636a9423eb22236024cd9b3726f0a3", "score": "0.54802597", "text": "def main\n @app.main\n end", "title": "" }, { "docid": "e1a467ebd19e9cc58037aac870c417a7", "score": "0.548013", "text": "def set_present_and_running\n if active_instance_dir_exists?\n return if running?\n elsif inactive_instance_dir_exists?\n activate_instance_dir\n else\n make_instance\n end\n start\n end", "title": "" }, { "docid": "5b133969ca9cd522dfbf114ff04f51d4", "score": "0.54382414", "text": "def start\n if !autoscaling_group.exists?\n @task.warn { \"Autoscaling group #{@name} doesn't exist\" }\n return\n end\n \n suspended = load_from_s3(@task.bucket)\n\n # FIXME: This won't work if we reinstate suspended processes...\n #if autoscaling_group.suspended_processes.empty?\n #@task.debug { \"Scaling group #{@name} already running\" }\n #else\n start_instances\n\n @task.unsafe(\"Resuming #{@name} processes\") do\n autoscaling_group.resume_all_processes\n autoscaling_group.suspend_processes suspended.keys\n end\n #end\n end", "title": "" }, { "docid": "0d56c05d31622cfb0f14a43bed5fbc3e", "score": "0.54338545", "text": "def start_none\n unless options[:ontop]\n Daemonize.daemonize(output_logfile, @group.app_name)\n else\n Daemonize.simulate(output_logfile)\n end\n\n @pid.pid = Process.pid\n\n # We need this to remove the pid-file if the applications exits by itself.\n # Note that <tt>at_text</tt> will only be run if the applications exits by calling\n # <tt>exit</tt>, and not if it calls <tt>exit!</tt> (so please don't call <tt>exit!</tt>\n # in your application!\n #\n at_exit do\n begin; @pid.cleanup; rescue ::Exception; end\n\n # If the option <tt>:backtrace</tt> is used and the application did exit by itself\n # create a exception log.\n if options[:backtrace] && !options[:ontop] && !$daemons_sigterm\n begin; exception_log; rescue ::Exception; end\n end\n\n end\n\n # This part is needed to remove the pid-file if the application is killed by\n # daemons or manually by the user.\n # Note that the applications is not supposed to overwrite the signal handler for\n # 'TERM'.\n #\n trap(SIGNAL) do\n begin; @pid.cleanup; rescue ::Exception; end\n $daemons_sigterm = true\n\n if options[:hard_exit]\n exit!\n else\n exit\n end\n end\n end", "title": "" }, { "docid": "e24e8b0ac1d957bd6f1eda3dd628c300", "score": "0.5425086", "text": "def create_application\n unless self.has_current_application?\n Application.create_for_student self\n end\n end", "title": "" }, { "docid": "c5be8749913c08f038db48bff2230390", "score": "0.5417891", "text": "def assign_group_to_application(app_id, group_id, options = {})\n put(\"/apps/#{app_id}/groups/#{group_id}\", options)\n end", "title": "" }, { "docid": "cf4b176daedda827308515beca5aaea8", "score": "0.5403337", "text": "def gen_app\n unless File.exists?(app_dir)\n original_dir = FileUtils.pwd\n Dir.mkdir(root_dir) unless (!root_dir or File.exists?(root_dir))\n FileUtils.cd(root_dir) if root_dir\n `#{rails_str}`\n FileUtils.cd(original_dir)\n true\n end\n end", "title": "" }, { "docid": "f4b4a791e11acf8fa566a6316965fd33", "score": "0.53991705", "text": "def app_with_name name\n AX::Application.new name\n end", "title": "" }, { "docid": "fd17f6be70cf8c9a64cb884c2f952734", "score": "0.53967696", "text": "def create(name=nil, options={})\n\t\tparams = {}\n\t\tparams['app[name]'] = name if name\n\t\txml(post('/apps', params)).elements[\"//app/name\"].text\n\tend", "title": "" }, { "docid": "9f4902c14808de6040921b8c5c31d074", "score": "0.53964376", "text": "def start \n `killall gammu-smsd` && puts(\"Killing Daemons!\")\n puts \"Loading Daemons......\"\n @phones.values.each do |provider|\n fork do\n exec \"gammu-smsd -c #{@datafolder+provider} &\"\n end\n end\n end", "title": "" }, { "docid": "d2bbcbc82f8c4388b58482ecab3790ef", "score": "0.53864825", "text": "def register_app(apk, bundle_id, env = \"dev\")\n if apk.nil?\n UI.error(\"Specify the APK you want to run and register in crashlytics. Provide the filename only, not the full path.\")\n exit(1)\n end\n\n if bundle_id.nil?\n UI.error(\"Specify the bundle_id of the app you want to run and register in crashlytics.\")\n exit(1)\n end\n\n avd = getAvdEmulator\n\n # Register the app in crashlytics by starting it\n sh(\"./register.sh #{apk} #{bundle_id} #{avd} #{env}\")\nend", "title": "" }, { "docid": "45e12c98982932e855d844c3e06af5e7", "score": "0.53819454", "text": "def create(name=nil, options={})\n\t\toptions[:name] = name if name\n\t\txml(post('/apps', :app => options)).elements[\"//app/name\"].text\n\tend", "title": "" }, { "docid": "e176073204d836bcc94bab179d9fb1fe", "score": "0.5378956", "text": "def start\n flags = \"--config config/puma.rb --pidfile #{PID_FILE}\"\n system \"puma #{flags} > /dev/null 2>&1\"\n sleep(0.1)\n rails?\n end", "title": "" }, { "docid": "32649c2904ccade07a12c39bce54d8c0", "score": "0.53780097", "text": "def run\n if @initializer.nil?\n @initializer = new\n \n yield @initializer.configuration if block_given?\n @initializer.process\n \n start_app\n else\n yield @initializer.configuration if block_given?\n end\n end", "title": "" }, { "docid": "4a5aa7025b552af58274d321af68fd2f", "score": "0.5368858", "text": "def application(label = nil, &block)\n new_application = Hsquare::Application.new(label: label)\n\n @default_application ||= new_application\n applications.push(new_application) unless applications.include?(new_application)\n\n yield new_application\n end", "title": "" }, { "docid": "74128bf6f664e8efcbe2addbd6c3a2d4", "score": "0.5363507", "text": "def run(file_name)\n application = select_app(file_name)\n system \"#{application} #{file_name}\"\n end", "title": "" }, { "docid": "e5428c901892f1460c003faf987b59ec", "score": "0.5358111", "text": "def run\n begin\n puts \" [*] Running #{self.class.config[:application_name]} with pid #{Process.pid}\"\n puts \" [*] Running in #{self.class.env} environment\"\n puts \" [*] To exit press CTRL+C or send a SIGINT\"\n self.start\n loop do\n sleep(1)\n end\n rescue SystemExit, Interrupt => _\n self.stop\n end\n end", "title": "" }, { "docid": "69d7f535db37e8d2c7e9a1463437398c", "score": "0.5357151", "text": "def run\n # rubocop:disable Style/SignalException\n # Parameter 'id' should be of type String\n\n id = unsafe_params[:id]\n fail \"App ID is not a string\" unless id.is_a?(String) && id != \"\"\n\n # Name should be a nonempty string\n name = unsafe_params[:name]\n fail \"Name should be a non-empty string\" unless name.is_a?(String) && name != \"\"\n\n # Inputs should be a hash (more checks later)\n inputs = unsafe_params[\"inputs\"]\n fail \"Inputs should be a hash\" unless inputs.is_a?(Hash)\n\n job_limit = params[:job_limit].to_f.zero? ? current_user.job_limit : params[:job_limit].to_f\n fail \"Job limit exceeds maximum user setting - #{current_user.job_limit}\" if job_limit > current_user.job_limit\n\n run_instance_type = unsafe_params[:instance_type]\n\n fail I18n.t(\"app_instance_type_forbidden\") unless current_user.resources.include?(run_instance_type)\n\n # App should exist and be accessible and runnable by a user.\n @app = App.find_by!(uid: id)\n\n fail I18n.t(\"app_not_accessible_or_runnable\") unless @app.runnable_by?(current_user)\n\n # Check if asset licenses have been accepted\n unless @app.assets.all? { |a| a.license.blank? || a.licensed_by?(@context) }\n fail \"Asset licenses must be accepted\"\n end\n\n # Call JupiterLab service if https app is running\n if @app.https?\n https_apps_client = DIContainer.resolve(\"https_apps_client\")\n input_info = input_spec_preparer.run(@app, inputs)\n\n fail input_spec_preparer.first_error unless input_spec_preparer.valid?\n\n result =\n begin\n https_apps_client.app_run(\n @app.dxid,\n name: name,\n instanceType: run_instance_type,\n jobLimit: job_limit,\n scope: Scopes::SCOPE_PRIVATE,\n input: input_info.run_inputs,\n )\n rescue HttpsAppsClient::Error => e\n fail e.message\n end\n\n job = Job.find_by!(dxid: result[\"dxid\"])\n\n render(json: { id: job.uid }) && return\n end\n\n space_id = unsafe_params[:space_id]\n\n fail \"Invalid space_id\" if space_id && !@app.can_run_in_space?(@context.user, space_id)\n\n space = Space.find_by(id: space_id)\n # Inputs should be compatible\n # (The following also normalizes them)\n input_info = input_spec_preparer.run(@app, inputs, space&.accessible_scopes)\n\n fail input_spec_preparer.first_error unless input_spec_preparer.valid?\n\n if space\n project = space.project_for_user(@context.user)\n permission = space.have_permission?(project, @context.user)\n fail \"You don't have permissions to run app in space #{space.name}\" unless permission\n else\n project = @context.user.private_files_project\n end\n\n job = job_creator(project).create(\n app: @app,\n name: name,\n input_info: input_info,\n run_instance_type: run_instance_type,\n job_limit: job_limit,\n scope: space&.uid,\n )\n\n SpaceEventService.call(space_id, @context.user_id, nil, job, :job_added) if space&.review?\n # rubocop:enable Style/SignalException\n\n render json: { id: job.uid }\n end", "title": "" }, { "docid": "412926222e03ef709f1aab07217089bd", "score": "0.53519046", "text": "def create_new_app\n rake 'install --trace'\n FileUtils.rm_rf(rails_app)\n sh \"relevance_rails new #{rails_app} --database=#{database} --relevance-dev\"\n end", "title": "" }, { "docid": "9ace2c8ddd9192ac85e6717633147171", "score": "0.5351518", "text": "def initialize(id, cmd, map_std_err_to_out = false, working_directory = nil, &observer)\n\n @id = id || self.object_id\n @observer = observer\n @@all_apps[@id] = self\n @exit_status = nil\n @threads = []\n\n pw = IO::pipe # pipe[0] for read, pipe[1] for write\n pr = IO::pipe\n pe = IO::pipe\n\n logger.debug \"Starting application '#{@id}' - cmd: '#{cmd}'\"\n #@observer.call(:STARTED, id, cmd)\n call_observer(:STARTED, cmd)\n @pid = fork {\n # child will remap pipes to std and exec cmd\n pw[1].close\n STDIN.reopen(pw[0])\n pw[0].close\n\n pr[0].close\n STDOUT.reopen(pr[1])\n pr[1].close\n\n pe[0].close\n STDERR.reopen(pe[1])\n pe[1].close\n\n begin\n pgid = Process.setsid # Create a new process group\n # which includes all potential child processes\n STDOUT.puts \"INTERNAL WARNING: Assuming process_group_id == pid\" unless pgid == $$\n Dir.chdir working_directory if working_directory\n exec(cmd)\n rescue => ex\n cmd = cmd.join(' ') if cmd.kind_of?(Array)\n STDERR.puts \"exec failed for '#{cmd}' (#{$!}): #{ex}\"\n end\n # Should never get here\n exit!\n }\n\n pw[0].close\n pr[1].close\n pe[1].close\n monitor_pipe(:stdout, pr[0])\n monitor_pipe(map_std_err_to_out ? :stdout : :stderr, pe[0])\n # Create thread which waits for application to exit\n @threads << Thread.new(id, @pid) do |id, pid|\n Process.waitpid(pid)\n # Exit status is sometimes nil (OSX 10.8, ping)\n @exit_status = $?.exitstatus || 0\n if @exit_status > 127\n @exit_status = 128 - @exit_status\n end\n @@all_apps.delete(@id)\n # app finished\n if (@exit_status == 0) || @clean_exit\n logger.debug \"Application '#{@id}' finished\"\n else\n logger.debug \"Application '#{@id}' failed (code=#{@exit_status})\"\n end\n end\n @stdin = pw[1]\n\n # wait for done in yet another thread\n Thread.new do\n @threads.each {|t| t.join }\n call_observer(\"EXIT\", @exit_status)\n end\n logger.debug \"Application is running with PID #{@pid}\"\n end", "title": "" }, { "docid": "a84b09bc6c12fa9ea0dff6bede7d4b53", "score": "0.53477484", "text": "def create_android\n `android create project -t 5 -k #{ @pkg } -a #{ @name } -n #{ @name } -p #{ @path }`\n end", "title": "" }, { "docid": "4a03dfa2523718dca80141ab494dafa7", "score": "0.5344875", "text": "def start(feature=nil)\n result_io = ResultIO.new\n op_group = nil\n if feature.nil?\n op_group = PendingAppOpGroup.new(op_type: :start_app, user_agent: self.user_agent)\n else\n op_group = PendingAppOpGroup.new(op_type: :start_feature, args: {\"feature\" => feature}, user_agent: self.user_agent)\n end\n Application.run_in_application_lock(self) do\n self.pending_op_groups.push op_group\n self.run_jobs(result_io)\n result_io\n end\n end", "title": "" }, { "docid": "89faccd1cb9450a49fd114671e692353", "score": "0.53290236", "text": "def run\n check_args\n Application::InstanceMethods.instance_method(:sandbox).bind(@app).call.\n instance_eval(&@block)\n end", "title": "" }, { "docid": "f5ec6db42ffb20927464bda1cf9b900c", "score": "0.5325187", "text": "def start\n @process = ChildProcess.build(*parameters)\n process.start\n end", "title": "" }, { "docid": "0cea898704d5ea8d3fcf3dd41f8e1a40", "score": "0.5322662", "text": "def default_start_program\n _init_command('start')\n end", "title": "" }, { "docid": "1fe11158dbbc25ddbf4d734d90b36c9e", "score": "0.5308816", "text": "def setup\n @applications = find_applications(pidfile_dir())\n end", "title": "" }, { "docid": "6a9b0e75d8e1761788a4ab0127bb29c7", "score": "0.53009534", "text": "def start\n parse_options\n\n if @daemon\n require \"facets/daemonize\"\n\n daemonize()\n\n # Save a process sentinel file.\n FileUtils.touch(File.join(\".temp\",\"d#{Process.pid}.pid\"))\n end\n setup_drb()\n end", "title": "" }, { "docid": "e6b3130687f17e4290d94f774948fd1c", "score": "0.52954465", "text": "def boot\n Thread.new do\n sleep 1 until EM.reactor_running?\n\n begin\n log.info \"Loading application...\"\n app_init\n load_settings\n Fastr::Plugin.load(self)\n load_app_classes\n setup_router\n setup_watcher unless RbConfig::CONFIG['host_os'] =~ /mswin|mingw/\n\n log.info \"Application loaded successfully.\"\n\n @booting = false\n\n plugin_after_boot\n rescue Exception => e\n log.error \"#{e}\"\n puts e.backtrace\n log.fatal \"Exiting due to previous errors...\"\n exit(1)\n end\n end\n end", "title": "" }, { "docid": "7757738a52a3cb4599a25d2db50e8841", "score": "0.5291181", "text": "def create(optional_params = {})\n response = Network.post(['Applications'], optional_params)\n Application.new(response)\n end", "title": "" }, { "docid": "6c5f513b8f85f92e716403c3b10ddbff", "score": "0.5279699", "text": "def start\n create('start')\n end", "title": "" }, { "docid": "8cc4137d1aadb2304062472b9c0e6dcd", "score": "0.5268265", "text": "def new_app(opts)\n api.app_new(\n applet: opts[:applet_dxid],\n name: AppSeries.construct_dxname(user.username, opts[:name], opts[:scope]),\n title: \"#{opts[:title]} \",\n summary: \" \",\n description: \"#{opts[:readme]} \",\n version: \"r#{opts[:revision]}-#{SecureRandom.hex(3)}\",\n resources: opts[:asset_dxids],\n details: { ordered_assets: opts[:asset_dxids] },\n openSource: false,\n billTo: bill_to,\n access: opts[:internet_access] ? { network: [\"*\"] } : {},\n )[\"id\"]\n end", "title": "" }, { "docid": "65436be43cc29a8243af5767dbc36274", "score": "0.52655214", "text": "def start\n configure\n run\n end", "title": "" }, { "docid": "4cafb6d4562ea64fbea8a3d5a9ed4a36", "score": "0.5263858", "text": "def create_application(client, options)\n if options[:name].nil? or options[:description].nil?\n puts \"Missing arguments\"\n end\n \n application = client.applications.create({\n name: options[:name],\n description: options[:description]\n })\n puts \"Application created.\"\n\n #TODO: Add exception handling\nend", "title": "" }, { "docid": "603d548cbb97c842387631ef583edeb3", "score": "0.52615625", "text": "def start_monit(pidfile = nil)\n context.execute \"monit start #{adapter}_#{app['shortname']}\" do\n retries 3\n creates pidfile unless pidfile.to_s.empty?\n end\n end", "title": "" }, { "docid": "813746c9f207e3e48af36c1be0610093", "score": "0.52501696", "text": "def start\n system 'docker-compose up -d'\n end", "title": "" }, { "docid": "e603e631b737e97a70bc7198616cdeda", "score": "0.5243109", "text": "def create_app(opts)\n app = nil\n scope = select_scope(opts[:scope])\n\n assets = Asset.accessible_by_user(user).\n where(\n state: Asset::STATE_CLOSED,\n uid: opts[:ordered_assets],\n )\n\n App.transaction do\n app_series = create_app_series(opts[:name], scope)\n release = opts.fetch(:release, UBUNTU_16)\n revision = app_series.latest_revision_app.try(:revision).to_i + 1\n\n applet_dxid = new_applet(\n opts.slice(\n :input_spec,\n :output_spec,\n :code,\n :instance_type,\n :packages,\n :internet_access,\n ),\n release,\n )\n\n app_dxid = new_app(\n opts.slice(\n :name,\n :title,\n :internet_access,\n :readme,\n ).merge(\n applet_dxid: applet_dxid,\n asset_dxids: assets.map(&:dxid),\n revision: revision,\n scope: scope,\n ),\n )\n\n api.project_remove_objects(project, [applet_dxid])\n\n app = App.create!(\n dxid: app_dxid,\n version: nil,\n revision: revision,\n title: opts[:title],\n readme: opts[:readme],\n entity_type: opts[:entity_type] || App::TYPE_REGULAR,\n user: user,\n scope: scope,\n app_series: app_series,\n input_spec: opts[:input_spec],\n output_spec: opts[:output_spec],\n internet_access: opts[:internet_access],\n instance_type: opts[:instance_type],\n ordered_assets: opts[:ordered_assets],\n packages: opts[:packages],\n code: opts[:code].strip,\n assets: assets,\n release: release,\n )\n\n app_series.update!(latest_revision_app: app)\n app_series.update!(latest_version_app: app) if Space.valid_scope?(scope)\n app_series.update!(deleted: false) if app_series.deleted?\n\n Event::AppCreated.create_for(app, user)\n end\n\n app\n end", "title": "" }, { "docid": "de76282dff109cb5693cf118a50a39c8", "score": "0.52391917", "text": "def start\n system(\"ruby #{DAEMON} &\")\n end", "title": "" }, { "docid": "99d588584cc7d9b9c24ccefc52e6c7e2", "score": "0.52380896", "text": "def run(argv = [])\n @opts.parse!(argv)\n\n path = argv.delete_at(0)\n proto = __DIR__('../../proto')\n\n abort 'You need to specify a name for your application' if path.nil?\n\n if File.directory?(path) and @options[:force] === false\n abort 'The specified application already exists, use -f to overwrite it'\n end\n\n if File.directory?(path) and @options[:force] === true\n FileUtils.rm_rf(path)\n end\n\n begin\n FileUtils.cp_r(proto, path)\n puts \"The application has been generated and saved in #{path}\"\n rescue\n abort 'The application could not be generated'\n end\n end", "title": "" }, { "docid": "da94a973ecc01fff15df0d80ae6d53ff", "score": "0.523644", "text": "def setup_appengine_application(app, is_new_app)\n initialize_scaling_info_for_app(app)\n uac = UserAppClient.new(@userappserver_private_ip, @@secret)\n app_data = uac.get_app_data(app)\n loop {\n Djinn.log_info(\"Waiting for app data to have instance info for app named #{app}: #{app_data}\")\n\n app_data = uac.get_app_data(app)\n if app_data[0..4] != \"Error\"\n break\n end\n Kernel.sleep(5)\n }\n\n my_public = my_node.public_ip\n my_private = my_node.private_ip\n app_language = app_data.scan(/language:(\\w+)/).flatten.to_s\n \n if is_new_app and @app_info_map[app].nil?\n @app_info_map[app] = {}\n @app_info_map[app]['language'] = app_language\n end\n\n shadow = get_shadow\n shadow_ip = shadow.private_ip\n ssh_key = shadow.ssh_key\n app_dir = \"/var/apps/#{app}/app\"\n app_path = \"/opt/appscale/apps/#{app}.tar.gz\"\n FileUtils.mkdir_p(app_dir)\n \n # First, make sure we can download the app, and if we can't, throw up a\n # dummy app letting the user know there was a problem.\n if !copy_app_to_local(app)\n place_error_app(app, \"ERROR: Failed to copy app: #{app}\")\n app_language = \"python27\"\n end\n\n # Next, make sure their app has an app.yaml or appengine-web.xml in it,\n # since the following code assumes it is present. If it is not there\n # (which can happen if the scp fails on a large app), throw up a dummy\n # app.\n if !HelperFunctions.app_has_config_file?(app_path)\n place_error_app(app, \"ERROR: No app.yaml or appengine-web.xml for app \" +\n app)\n app_language = \"python27\"\n end\n\n HelperFunctions.setup_app(app)\n\n if is_new_app\n maybe_start_taskqueue_worker(app)\n end\n\n if is_new_app\n if @app_info_map[app]['nginx'].nil?\n @app_info_map[app]['nginx'] = find_lowest_free_port(Nginx::START_PORT)\n @app_info_map[app]['haproxy'] = find_lowest_free_port(\n HAProxy::START_PORT)\n @app_info_map[app]['nginx_https'] = Nginx.get_ssl_port_for_app(\n @app_info_map[app]['nginx'])\n end\n\n @app_info_map[app]['appengine'] = []\n end\n\n # Only take a new port for this application if there's no data about\n # this app. Use the existing port if there is info about it.\n nginx_port = @app_info_map[app]['nginx']\n https_port = @app_info_map[app]['nginx_https']\n proxy_port = @app_info_map[app]['haproxy']\n\n port_file = \"/etc/appscale/port-#{app}.txt\"\n if my_node.is_login?\n HelperFunctions.write_file(port_file, \"#{@app_info_map[app]['nginx']}\")\n Djinn.log_debug(\"App #{app} will be using nginx port #{nginx_port}, \" +\n \"https port #{https_port}, and haproxy port #{proxy_port}\")\n\n @nodes.each { |node|\n if node.private_ip != my_node.private_ip\n HelperFunctions.scp_file(port_file, port_file, node.private_ip,\n node.ssh_key)\n end\n }\n else\n loop {\n if File.exists?(port_file)\n Djinn.log_debug(\"Got port file for app #{app}\")\n break\n else\n Djinn.log_debug(\"Waiting for port file for app #{app}\")\n Kernel.sleep(5)\n end\n }\n end\n\n # TODO(cgb): Make sure we don't add the same cron lines in twice for the same\n # app, and only start xmpp if it isn't already started\n if my_node.is_shadow?\n CronHelper.update_cron(my_public, nginx_port, app_language, app)\n start_xmpp_for_app(app, nginx_port, app_language)\n end\n\n # We only need a new full proxy config file for new apps, on the machine\n # that runs the login service (but not in a one node deploy, where we don't\n # do a full proxy config).\n login_ip = get_login.private_ip\n if my_node.is_login?\n begin\n static_handlers = HelperFunctions.parse_static_data(app)\n Djinn.log_run(\"chmod -R +r #{HelperFunctions.get_cache_path(app)}\")\n rescue Exception => e\n # This specific exception may be a json parse error\n error_msg = \"ERROR: Unable to parse app.yaml file for #{app}.\" + \\\n \" Exception of #{e.class} with message #{e.message}\" \n place_error_app(app, error_msg)\n static_handlers = []\n end\n\n Nginx.write_fullproxy_app_config(app, nginx_port, https_port, my_public,\n my_private, proxy_port, static_handlers, login_ip)\n\n loop {\n Kernel.sleep(5)\n success = uac.add_instance(app, my_public, nginx_port)\n Djinn.log_debug(\"Add instance returned #{success}\")\n if success\n # tell ZK that we are hosting the app in case we die, so that\n # other nodes can update the UserAppServer on its behalf\n ZKInterface.add_app_instance(app, my_public, nginx_port)\n break\n end\n }\n end\n\n if my_node.is_appengine?\n # send a warmup request to the app to get it loaded - can shave a\n # number of seconds off the initial request if it's java or go\n # go provides a default warmup route\n # TODO: if the user specifies a warmup route, call it instead of /\n warmup_url = \"/\"\n\n app_manager = AppManagerClient.new(my_node.private_ip)\n # TODO(cgb): What happens if the user updates their env vars between app\n # deploys?\n if is_new_app\n @num_appengines.times { |index|\n appengine_port = find_lowest_free_port(STARTING_APPENGINE_PORT)\n Djinn.log_info(\"Starting #{app_language} app #{app} on \" +\n \"#{HelperFunctions.local_ip}:#{appengine_port}\")\n\n xmpp_ip = get_login.public_ip\n\n pid = app_manager.start_app(app, appengine_port,\n get_load_balancer_ip(), app_language, xmpp_ip,\n [Djinn.get_nearest_db_ip()], HelperFunctions.get_app_env_vars(app))\n\n if pid == -1\n place_error_app(app, \"ERROR: Unable to start application \" + \\\n \"#{app}. Please check the application logs.\")\n end\n\n # Tell the AppController at the login node (which runs HAProxy) that a\n # new AppServer is running.\n acc = AppControllerClient.new(get_login.private_ip, @@secret)\n loop {\n result = acc.add_appserver_to_haproxy(app, my_node.private_ip,\n appengine_port)\n if result == NOT_READY\n Djinn.log_info(\"Login node is not yet ready for AppServers to \" +\n \"be added - trying again momentarily.\")\n Kernel.sleep(5)\n else\n Djinn.log_info(\"Successfully informed login node about new \" +\n \"AppServer for #{app} on port #{appengine_port}.\")\n break\n end\n }\n }\n else\n Djinn.log_info(\"Restarting AppServers hosting old version of #{app}\")\n result = app_manager.restart_app_instances_for_app(app)\n end\n\n if is_new_app\n # now doing this at the real end so that the tools will\n # wait for the app to actually be running before returning\n done_uploading(app, app_path, @@secret)\n end\n end\n\n APPS_LOCK.synchronize {\n if @app_names.include?(\"none\")\n @apps_loaded = @apps_loaded - [\"none\"]\n @app_names = @app_names - [\"none\"]\n end\n\n if is_new_app\n @apps_loaded << app\n else\n @apps_to_restart.delete(app)\n end\n }\n end", "title": "" }, { "docid": "109d46f6fae4e5bc8066feb330e72db7", "score": "0.52358645", "text": "def driver\n start_app_if_needed\n @driver\n end", "title": "" }, { "docid": "4b76dddb3bff0e81d3b01d835f1a583a", "score": "0.5227344", "text": "def start\n ucommand(:start)\n end", "title": "" }, { "docid": "6a3b343b0de8cf1525bb49ddecb84f51", "score": "0.52265114", "text": "def start\n inherit_listeners!\n # this pipe is used to wake us up from select(2) in #join when signals\n # are trapped. See trap_deferred.\n SELF_PIPE.replace(Unicorn.pipe)\n @master_pid = $$\n\n # setup signal handlers before writing pid file in case people get\n # trigger happy and send signals as soon as the pid file exists.\n # Note that signals don't actually get handled until the #join method\n QUEUE_SIGS.each { |sig| trap(sig) { SIG_QUEUE << sig; awaken_master } }\n trap(:CHLD) { awaken_master }\n\n # write pid early for Mongrel compatibility if we're not inheriting sockets\n # This is needed for compatibility some Monit setups at least.\n # This unfortunately has the side effect of clobbering valid PID if\n # we upgrade and the upgrade breaks during preload_app==true && build_app!\n self.pid = config[:pid]\n\n build_app! if preload_app\n bind_new_listeners!\n\n spawn_missing_workers\n self\n end", "title": "" }, { "docid": "76a078cc640db1512828c06e8e1a6ead", "score": "0.522552", "text": "def start(*args, &block)\n rc = 1\n begin\n rc = run(*args, &block)\n rescue\n log(FATAL, \"#{@appname} detected an exception: #{$!}\\n#{$@.qp}\")\n msg = \"#{@appname} was unsuccessful: #{$!}.\"\n msg += \"\\nSee the log #{Log.instance.file} for more information.\" if Log.instance.file\n $stderr.puts msg\n ensure\n log(INFO, \"#{@appname} completed with status #{rc}.\")\n end\n end", "title": "" }, { "docid": "0ba5efa970319d90131b67cc419dbf27", "score": "0.52251977", "text": "def setup\n @applications = find_applications(pidfile_dir)\n end", "title": "" }, { "docid": "1b2001c74b3f448639511360b819a58d", "score": "0.52172613", "text": "def setup!\n return self if @app_is_setup\n puts \"Hatchet setup: #{name.inspect} for #{repo_name.inspect}\"\n create_app\n set_labs!\n # heroku.put_config_vars(name, 'BUILDPACK_URL' => @buildpack)\n buildpack_list = @buildpacks.map {|pack| { buildpack: pack }}\n platform_api.buildpack_installation.update(name, updates: buildpack_list)\n @app_is_setup = true\n self\n end", "title": "" }, { "docid": "345421067467d4ce167eb46bf7aadeb6", "score": "0.5207593", "text": "def run\n assign_process_name!\n\n wrap_chain(:start) do\n STDOUT.sync = true\n\n logger.info(\"Engine \\##{id} Running\")\n \n switch_to_effective_user! if (self.class.user)\n\n @state = :running\n end\n end", "title": "" }, { "docid": "0f126ba6244f7a455e49807da10c0bb1", "score": "0.5204933", "text": "def start\n if @options[:\"disable-watcher\"]\n bootup\n else\n @server_job = fork {\n Signal.trap(::Middleman::WINDOWS ? :KILL : :TERM) { exit! }\n bootup\n }\n end\n end", "title": "" }, { "docid": "a00994f610806a5955da75e0f58d490f", "score": "0.51998794", "text": "def app\n no_autostart\n puts \"Running Plezi version: #{::Plezi::VERSION}\"\n Plezi::Base::Router.call_method\n end", "title": "" }, { "docid": "f9ffb803d9b71709f8a14dae40b61af4", "score": "0.5199461", "text": "def find_or_create_app(app_name)\n create_app(app_name)\n rescue\n @heroku.app.info(app_name)\n end", "title": "" }, { "docid": "ecea03b64b604ea5c933b66550489bd9", "score": "0.5189246", "text": "def generate_app(os, type = nil, template = nil, sfdx = nil)\n UI.crash!('Error: Cannot generate app without type or template.') unless(type or template)\n\n system('rm -rf tmp*/')\n system('rm -rf Android/app/build/')\n generate_command = \"./SalesforceMobileSDK-Package/test/test_force.js --os=#{os}\"\n if type\n UI.header \"Generating #{type} App\"\n generate_command.concat(\" --apptype=#{type}\")\n\n if type.start_with?('hybrid')\n generate_command.concat(' --no-plugin-update')\n end\n else\n UI.header 'Generating App from Template'\n generate_command.concat(\" --templaterepouri=#{template}\")\n end\n\n if sfdx\n generate_command.concat(' --use-sfdx')\n end\n \n result = silence_output(true) { system(generate_command) }\n UI.user_error!('Test app was not successfully created.') unless(result)\nend", "title": "" }, { "docid": "4078f7c01744062dee2c9393d952cfbb", "score": "0.5188247", "text": "def start (bundleId)\n execute(:start, bundleId)\n end", "title": "" } ]
f9b54372977f73c43a72d6365d4c8b4e
Timeout the task after the given time.
[ { "docid": "cec36d55a7410924c97a15467b1af35d", "score": "0.81887186", "text": "def timeout_after (time)\n @timeout = time\n\n pool.timeout_for self, time\n\n self\n end", "title": "" } ]
[ { "docid": "24873beae4b7fd94b94fae06952080d6", "score": "0.8216288", "text": "def timeout_after time\n @timeout = time\n \n pool.timeout_for self, time\n \n self\n end", "title": "" }, { "docid": "6cb6f0d0b0856a057f2a23fc0bb70808", "score": "0.80103004", "text": "def timeout_after (time)\n\t\t\t@timeout = time\n\n\t\t\tpool.timeout_for self, time\n\n\t\t\tself\n\t\tend", "title": "" }, { "docid": "ec6b0c039c1ba0358bcb50bfc1941994", "score": "0.7718704", "text": "def timeout(time = nil); self.class.timeout(time); end", "title": "" }, { "docid": "32bb5db932623cadc6b7bf6a25ed66b4", "score": "0.7491865", "text": "def timeout(time, *args)\n cancel_timeout\n @timeout_timer = EM::Timer.new(time) do\n fail(*args) unless completed?\n end\n end", "title": "" }, { "docid": "5c3f945082c666488e4e8f61b01764b0", "score": "0.7296336", "text": "def timeout(time, *args); end", "title": "" }, { "docid": "378566dd10a45de7ded675a2d1e67874", "score": "0.69792026", "text": "def timeout_for task, timeout\n unless @timeout\n spawn_timeout_thread\n end\n \n @mutex.synchronize {\n @timeouts[task] = timeout\n \n wake_up_timeout\n }\n end", "title": "" }, { "docid": "85821d287ea0515c24b9962dc8fe7179", "score": "0.68913734", "text": "def timeout(time)\n self << \"Timeout #{time}\"\n end", "title": "" }, { "docid": "d554dfc14333ddbd7f9f707bd244fa62", "score": "0.68563557", "text": "def timeout!\n warn(\"Task #{name} has timedout.\")\n self.status = :timedout\n stopped?\n end", "title": "" }, { "docid": "fd86b4df56c8352a44054ff6bca5006f", "score": "0.67957383", "text": "def sleep(time)\n task = self.task(ActionCoordination::TaskFromAsPlan.new(Tasks::Timeout.with_arguments(delay: time), Tasks::Timeout))\n start task, explicit_start: true\n wait task.stop_event\n end", "title": "" }, { "docid": "d73f626b58dc61c36a0ac2c40c1e6dee", "score": "0.6690153", "text": "def execute(timeout)\n sleep timeout\n end", "title": "" }, { "docid": "4ab3fe2f39cec58f1b8b4fd24703ce3a", "score": "0.6686094", "text": "def timeout(seconds, *args); end", "title": "" }, { "docid": "c097eeae145136dc544b9143a8391be6", "score": "0.66797125", "text": "def timeout_lock_after(new_time)\n @lock_timeout = new_time\n end", "title": "" }, { "docid": "98fc85c4fcaedb2e33aa4d4e2f1b6fd2", "score": "0.6579369", "text": "def timeout(time, interval, &job)\n @runner = async_run(time, interval)\n job.()\n @runner.join\n end", "title": "" }, { "docid": "fafc115bb5a843b8c86270542db0ccbe", "score": "0.65602994", "text": "def timeout!\n terminate! Timeout\n end", "title": "" }, { "docid": "39d52b995e426b26f7dcf088d821a427", "score": "0.65531343", "text": "def timeout_for (task, timeout)\n unless @timeout\n spawn_timeout_thread\n end\n\n @mutex.synchronize {\n @timeouts[task] = timeout\n\n wake_up_timeout\n }\n end", "title": "" }, { "docid": "bcc4ce639ee467e270a926b027ecee3f", "score": "0.6530949", "text": "def timeout(*) end", "title": "" }, { "docid": "bcc4ce639ee467e270a926b027ecee3f", "score": "0.6530949", "text": "def timeout(*) end", "title": "" }, { "docid": "2dcab43152c5703831d940a148075936", "score": "0.65251046", "text": "def try_with_timeout(time)\n begin \n Timeout.timeout(time) { yield }\n rescue Timeout::Error\n puts \"Took too long!\"\n end\nend", "title": "" }, { "docid": "854f497fc086d12aa87d7013fde5adb2", "score": "0.6518302", "text": "def after!(time, &block)\n Delay.new(@native, time, &block)\n end", "title": "" }, { "docid": "5555378d21c6effa222b826c9c84303c", "score": "0.6504597", "text": "def with_timeout(time=@options[:timeout])\n raise ArgumentError, \"Block required\" if !block_given?\n if Munin::TIMEOUT_CLASS.respond_to?(:timeout_after)\n Munin::TIMEOUT_CLASS.timeout_after(time) { yield }\n else\n Munin::TIMEOUT_CLASS.timeout(time) { yield }\n end\n end", "title": "" }, { "docid": "a58bc14cead486cf03d97f2a60f2cda9", "score": "0.6492601", "text": "def timeout_for (task, timeout)\n\t\tunless @timeout\n\t\t\tspawn_timeout_thread\n\t\tend\n\n\t\t@mutex.synchronize {\n\t\t\t@timeouts[task] = timeout\n\n\t\t\twake_up_timeout\n\t\t}\n\tend", "title": "" }, { "docid": "d558d0b6cb4348d71f180b8bdbd348d9", "score": "0.6489555", "text": "def timeout!\n terminate! Timeout\n end", "title": "" }, { "docid": "7007b9050d36b331899ed208103054df", "score": "0.6483037", "text": "def timeout\n @timeout || 5\n end", "title": "" }, { "docid": "bac97dec62ffb30cc2dfc9900f9e58b9", "score": "0.64670634", "text": "def timeout_time\n 300\n end", "title": "" }, { "docid": "97c7d51e340ad784aeec35931e09c91c", "score": "0.6450581", "text": "def timeout!\n\t\t\tterminate! Timeout\n\t\tend", "title": "" }, { "docid": "bd67b150a638f152d94bd870e8232346", "score": "0.64428306", "text": "def set_timeout(timeout)\n default_timeout(timeout)\n end", "title": "" }, { "docid": "ae088875c255f58f0ae043eb8755a8d5", "score": "0.64191735", "text": "def timeout=(timeout); end", "title": "" }, { "docid": "1216e561d7e40719a6d3c5798e63407b", "score": "0.6403138", "text": "def timeout(n, e = nil, &block) # :nodoc:\n Timeout::timeout(n, e, &block)\n end", "title": "" }, { "docid": "d6562ea3335a30ecba490bef5d545fd5", "score": "0.63976264", "text": "def timeout(value)\n @timeout = value\n end", "title": "" }, { "docid": "c9671d4f26bfc93210fea9873a560c4b", "score": "0.6379625", "text": "def set_timeout(timeout)\n @timeout = timeout\n end", "title": "" }, { "docid": "292b73a8361c33462a0743d243de5e31", "score": "0.6361217", "text": "def timeout(secs, &block)\n Timeout::timeout(secs, &block)\n end", "title": "" }, { "docid": "5f478701054fcb4c6fd07efc5157a4bf", "score": "0.63584614", "text": "def timeout(n, e = nil, &block) # :nodoc:\n Timeout::timeout(n, e, &block)\nend", "title": "" }, { "docid": "c296819ae107f1efb953d3ab379c9fa6", "score": "0.6357339", "text": "def set_timeout(timeout)\t\n @timeout = timeout\n end", "title": "" }, { "docid": "e5e8b646e026dd31afca6864d709fabf", "score": "0.63558", "text": "def timeout\n @timeout\n end", "title": "" }, { "docid": "e5e8b646e026dd31afca6864d709fabf", "score": "0.63558", "text": "def timeout\n @timeout\n end", "title": "" }, { "docid": "deae967a29c69b22742628e6f89e2a7b", "score": "0.63516086", "text": "def set_timeout(timeout)\n default_timeout(timeout)\n end", "title": "" }, { "docid": "9b63e344249123cca979fc873c8a95bf", "score": "0.63501287", "text": "def with_timeout(duration, exception = T.unsafe(nil), message = T.unsafe(nil), &block); end", "title": "" }, { "docid": "9b63e344249123cca979fc873c8a95bf", "score": "0.63501287", "text": "def with_timeout(duration, exception = T.unsafe(nil), message = T.unsafe(nil), &block); end", "title": "" }, { "docid": "bd3ec7db156e2a48cb757c3efe176fa0", "score": "0.6343387", "text": "def timeout_at; end", "title": "" }, { "docid": "1e986c107bd064253fc7d9567359da71", "score": "0.6334557", "text": "def timeout(n, e = nil, &block)\n Timeout::timeout(n, e, &block)\nend", "title": "" }, { "docid": "026f92c750b414aa8ab7e741e5b6aadc", "score": "0.629784", "text": "def timeout(num = nil)\n if num\n @timeout = num\n else\n @timeout || nil\n end\n end", "title": "" }, { "docid": "026f92c750b414aa8ab7e741e5b6aadc", "score": "0.629784", "text": "def timeout(num = nil)\n if num\n @timeout = num\n else\n @timeout || nil\n end\n end", "title": "" }, { "docid": "72c89d98148577a6f8443a01762dd9a2", "score": "0.62960035", "text": "def timeout\n @timeout || 15\n end", "title": "" }, { "docid": "d8f409ededf3af48b1a8ab6a715956ed", "score": "0.6290906", "text": "def run_with_timeout(&block)\n Timeout.timeout(@timeout) do\n yield\n end\n end", "title": "" }, { "docid": "a29722675687b2e992404daace87e935", "score": "0.62651867", "text": "def timeout\n @timeout ||= 5000\n end", "title": "" }, { "docid": "0a3bffe987cd064504ceaf2d3f808c8d", "score": "0.6262835", "text": "def set_timeout(timeout)\n do_command(\"setTimeout\", [timeout,])\n @timeout = timeout\n end", "title": "" }, { "docid": "4f65f2683d165f250e2b1115c2202638", "score": "0.6254193", "text": "def set_timeout(timeout)\n @timeout_timer = EM::Timer.new(timeout) do\n @timed_out = true\n close_connection\n end\n end", "title": "" }, { "docid": "d00a3e3736cff75cbd3f5ff990046899", "score": "0.6241016", "text": "def timeout(ms = 0)\n `setTimeout(function(){#{yield}},#{ms})`\n end", "title": "" }, { "docid": "3f1fa1a903be6052b453edd6ee90605c", "score": "0.62403786", "text": "def wait_or_cancel(timeout); end", "title": "" }, { "docid": "3f1fa1a903be6052b453edd6ee90605c", "score": "0.62403786", "text": "def wait_or_cancel(timeout); end", "title": "" }, { "docid": "64cc8702d470c96f2541be878f873906", "score": "0.6228981", "text": "def timeout(n, e=Timeout::Error, &block) # :nodoc:\n Timeout::timeout(n, e, &block)\nend", "title": "" }, { "docid": "23c4eaddcf9f5bef2ec73aae1d0db9ff", "score": "0.62211174", "text": "def timeout=(*) end", "title": "" }, { "docid": "c21177a377b437eb6259e8d2495bdc91", "score": "0.6204248", "text": "def quiet_timeout(time, default = nil)\n begin\n Timeout.timeout(time) do\n yield\n end\n rescue Timeout::Error\n if default.is_a?(Class) && default < Exception\n raise default\n else\n default\n end\n end\n end", "title": "" }, { "docid": "e96460e19a47ffeab048cdd8faf24b62", "score": "0.6191175", "text": "def set_timeout\n @pending_timeout = EM::Timer.new(@timeout) do\n @timeout_happend = true\n end\n end", "title": "" }, { "docid": "381be41a555d82cb3070bb9fc8dab6c9", "score": "0.6178803", "text": "def after_timeout\n Scheduler.in WaitTime do\n yield\n end\nend", "title": "" }, { "docid": "994d6213642210336c61970f0e65e6fa", "score": "0.61708254", "text": "def with_timeout(timeout)\n start_time = ::NATS::MonotonicTime.now\n yield\n end_time = ::NATS::MonotonicTime.now\n duration = end_time - start_time\n raise ::NATS::IO::Timeout.new(\"nats: timeout\") if duration > timeout\n end", "title": "" }, { "docid": "7cdab61b2dd9a16a226d418b72594093", "score": "0.6159644", "text": "def timeout; end", "title": "" }, { "docid": "7cdab61b2dd9a16a226d418b72594093", "score": "0.6159644", "text": "def timeout; end", "title": "" }, { "docid": "7cdab61b2dd9a16a226d418b72594093", "score": "0.6159644", "text": "def timeout; end", "title": "" }, { "docid": "7cdab61b2dd9a16a226d418b72594093", "score": "0.6159644", "text": "def timeout; end", "title": "" }, { "docid": "7cdab61b2dd9a16a226d418b72594093", "score": "0.6159644", "text": "def timeout; end", "title": "" }, { "docid": "7cdab61b2dd9a16a226d418b72594093", "score": "0.6159644", "text": "def timeout; end", "title": "" }, { "docid": "7cdab61b2dd9a16a226d418b72594093", "score": "0.6159644", "text": "def timeout; end", "title": "" }, { "docid": "7cdab61b2dd9a16a226d418b72594093", "score": "0.6159644", "text": "def timeout; end", "title": "" }, { "docid": "7cdab61b2dd9a16a226d418b72594093", "score": "0.6159644", "text": "def timeout; end", "title": "" }, { "docid": "7cdab61b2dd9a16a226d418b72594093", "score": "0.6159644", "text": "def timeout; end", "title": "" }, { "docid": "bf21fbef8f7f34aa00bcc2906412aeb6", "score": "0.6159267", "text": "def timeout=(timeout)\n @timeout = timeout\n end", "title": "" }, { "docid": "bf21fbef8f7f34aa00bcc2906412aeb6", "score": "0.6159267", "text": "def timeout=(timeout)\n @timeout = timeout\n end", "title": "" }, { "docid": "bf21fbef8f7f34aa00bcc2906412aeb6", "score": "0.6159267", "text": "def timeout=(timeout)\n @timeout = timeout\n end", "title": "" }, { "docid": "8c1a685c4566bb494c8c8ca44495dc73", "score": "0.61576736", "text": "def try_with_timeout(duration)\n begin\n Timeout.timeout(duration) { yield }\n rescue Timeout::Error\n puts \"Took too long!\"\n end\nend", "title": "" }, { "docid": "65bca4f31c6848305b009cd360989bf7", "score": "0.61060447", "text": "def timeout\n @timeout_secs\n end", "title": "" }, { "docid": "a537875a4f52762bd38fc67f438e7caa", "score": "0.6105729", "text": "def timeout\n 30\n end", "title": "" }, { "docid": "a5d127dfbaebe371ec7419f349ebb260", "score": "0.6088612", "text": "def set_timeout!(timeout)\n @wait_time=timeout\n\n return self\n end", "title": "" }, { "docid": "a5d127dfbaebe371ec7419f349ebb260", "score": "0.6088612", "text": "def set_timeout!(timeout)\n @wait_time=timeout\n\n return self\n end", "title": "" }, { "docid": "a5e1c95a9ae7a5d23532924ccd78db06", "score": "0.60873777", "text": "def timeout *args\n @evented_example.timeout *args\n end", "title": "" }, { "docid": "7f9d68e02e50489fdc2b0b20a0f8bc85", "score": "0.60831475", "text": "def timeout(seconds, err, &block)\n if RUBY_VERSION =~ /1.8/\n require 'system_timer'\n SystemTimer.timeout_after(seconds, err) { block.call }\n else\n require 'timeout'\n ::Timeout.timeout(seconds, err) { block.call }\n end\n end", "title": "" }, { "docid": "165ae03485f3eac546b1f7c5d843f190", "score": "0.6073715", "text": "def timeout(delay=-1)\n wtimeout(@win, delay)\n end", "title": "" }, { "docid": "8a4c1b1212a477484861f3959c9235fb", "score": "0.6065132", "text": "def shutdown_after timeout\n Thread.new {\n sleep timeout\n \n shutdown\n }\n \n self\n end", "title": "" }, { "docid": "76d4a25cceada5c434637a4fb1f230d6", "score": "0.6057323", "text": "def timeout(arg=nil)\n set_or_return(\n :timeout,\n arg,\n :kind_of => [ Fixnum ]\n )\n end", "title": "" }, { "docid": "1fb3e7092083082ac6bc5fcca2fb2ef1", "score": "0.6051191", "text": "def timeout=(timeout)\n @timeout = timeout\n end", "title": "" }, { "docid": "b1b73a0589a14b9d9ea40b08486732d4", "score": "0.60448194", "text": "def timeout(seconds, &block)\n Timeout::timeout(seconds, Timeout::Error) do\n yield\n end\n end", "title": "" }, { "docid": "a9c3b24a700b9a7ed73fdfb70c25e242", "score": "0.60439056", "text": "def timeout\n @timeout ||= (options[:timeout] || 5)\n end", "title": "" }, { "docid": "a888848a6ac569dde5a9c09fd82b8067", "score": "0.6037961", "text": "def try_with_timeout (second)\n begin\n Timeout.timeout(second) do\n yield\n end\n rescue Timeout::Error\n puts \"Took too long…\"\n end\nend", "title": "" }, { "docid": "c4bd36613844a4ad4f7bdf725409d5d8", "score": "0.6036088", "text": "def schedule_timer(timeout)\n @io_loop.schedule_timer(timeout)\n end", "title": "" }, { "docid": "6c68b8369597af362b2d0875c027d76c", "score": "0.6036063", "text": "def timeout(seconds)\n super(seconds)\n self\n end", "title": "" }, { "docid": "8f98c2bc05eab1e84712ad542e9ccf55", "score": "0.60274994", "text": "def set_Timeout(value)\n set_input(\"Timeout\", value)\n end", "title": "" }, { "docid": "8f98c2bc05eab1e84712ad542e9ccf55", "score": "0.60274994", "text": "def set_Timeout(value)\n set_input(\"Timeout\", value)\n end", "title": "" }, { "docid": "8f98c2bc05eab1e84712ad542e9ccf55", "score": "0.60274994", "text": "def set_Timeout(value)\n set_input(\"Timeout\", value)\n end", "title": "" }, { "docid": "5429a75944d9c66bc4f81e76ebba4aad", "score": "0.6026465", "text": "def time(&job)\n if timeout?\n time = Float(@timeout)\n interval = Float(@interval)\n @scheduler.timeout(time, interval, &job)\n else\n job.()\n end\n rescue Timeout::Error\n end", "title": "" }, { "docid": "78383895b28bcdab78efcb7350869bd2", "score": "0.6003333", "text": "def on_timeout\n # since its possible that the timestep will be too large, it needs\n # to re-trigger the callback until the @time is greater than 0\n until @time > 0\n trigger_callback\n restart\n end\n end", "title": "" }, { "docid": "f863bdf8b85db5ba94c536c4d389627e", "score": "0.59997773", "text": "def set_Timeout(value)\n set_input(\"Timeout\", value)\n end", "title": "" }, { "docid": "f863bdf8b85db5ba94c536c4d389627e", "score": "0.59978443", "text": "def set_Timeout(value)\n set_input(\"Timeout\", value)\n end", "title": "" }, { "docid": "f863bdf8b85db5ba94c536c4d389627e", "score": "0.59978443", "text": "def set_Timeout(value)\n set_input(\"Timeout\", value)\n end", "title": "" }, { "docid": "f863bdf8b85db5ba94c536c4d389627e", "score": "0.59978443", "text": "def set_Timeout(value)\n set_input(\"Timeout\", value)\n end", "title": "" }, { "docid": "f863bdf8b85db5ba94c536c4d389627e", "score": "0.59978443", "text": "def set_Timeout(value)\n set_input(\"Timeout\", value)\n end", "title": "" }, { "docid": "f863bdf8b85db5ba94c536c4d389627e", "score": "0.59978443", "text": "def set_Timeout(value)\n set_input(\"Timeout\", value)\n end", "title": "" }, { "docid": "f863bdf8b85db5ba94c536c4d389627e", "score": "0.59978443", "text": "def set_Timeout(value)\n set_input(\"Timeout\", value)\n end", "title": "" }, { "docid": "f863bdf8b85db5ba94c536c4d389627e", "score": "0.59978443", "text": "def set_Timeout(value)\n set_input(\"Timeout\", value)\n end", "title": "" }, { "docid": "f863bdf8b85db5ba94c536c4d389627e", "score": "0.59978443", "text": "def set_Timeout(value)\n set_input(\"Timeout\", value)\n end", "title": "" }, { "docid": "f863bdf8b85db5ba94c536c4d389627e", "score": "0.59978443", "text": "def set_Timeout(value)\n set_input(\"Timeout\", value)\n end", "title": "" } ]
bfd22d553f358e2f115bf8710e7ffed9
converts a & surrounded by optional whitespace or a nonbreaking space to the HTML entity and surrounds it in a span with a styled class
[ { "docid": "4ee6c04f11772ef45e16a840aae90847", "score": "0.51684463", "text": "def amp(text)\n # $1 is an excluded HTML tag, $2 is the part before the caps and $3 is the amp match\n text.gsub(/<(code|pre).+?<\\/\\1>|(\\s|&nbsp;)&(\\s|&nbsp;)/) {|str|\n $1 ? str : $2 + '<span class=\"amp\">&amp;</span>' + $3 }\n end", "title": "" } ]
[ { "docid": "09549b3ad36408fd5f617212cfbab1c5", "score": "0.61944", "text": "def smart_quote_entity(el); end", "title": "" }, { "docid": "af475d624aaec013871f3fd7e9337274", "score": "0.6166944", "text": "def clean(text = nil, escape_ampersands_twice = false)\n text.gsub!(\"&nbsp;\", \" \")\n converted = convert_html(text)\n entity_converted = convert_entities(converted)\n # puts \"entity_converted: #{entity_converted}\"\n escaped = escape(entity_converted)\n # escaped = escaped.gsub(/&/, '\\\\\\\\&')\n escaped = escaped.gsub(\"&\", \"\\&\")\n escaped = escaped.gsub(/&/, '\\\\\\\\&') if escape_ampersands_twice\n # puts \"escaped: #{escaped}\"\n # puts \"\\n\"\n escaped\n end", "title": "" }, { "docid": "5ef17136259cdd9bd0b560ab3b897223", "score": "0.6140977", "text": "def parse_html_entity; end", "title": "" }, { "docid": "9855fd8f7fe289cb9bac2bc8361b0ea0", "score": "0.6006806", "text": "def test_regular_ampersand\n filter = TypogrubyFilter.new \\\n \t\"one & two\"\n\n assert_equal %(one <span class=\"amp\">&amp;</span>&nbsp;two),\n filter.call\n end", "title": "" }, { "docid": "eed1390d8853465cc36484a0e93008fa", "score": "0.5903743", "text": "def wrap_in_spans(**options)\n safe_join(options.fetch(:value, []).map { |v| content_tag(:span, html_escape(v)) })\n end", "title": "" }, { "docid": "b4cd79fe2a8c609c33d5f389129406e2", "score": "0.5875723", "text": "def simple_format_span(text, html_options={}, options={})\n text = '' if text.nil?\n text = text.dup\n start_tag = tag('span', html_options, true)\n text = sanitize(text) unless options[:sanitize] == false\n text = text.to_str\n text.gsub!(/\\r\\n?/, \"\\n\") # \\r\\n and \\r -> \\n\n text.gsub!(/\\n\\n+/, \"</p>\\n\\n#{start_tag}\") # 2+ newline -> paragraph\n text.gsub!(/([^\\n]\\n)(?=[^\\n])/, '\\1<br />') # 1 newline -> br\n text.insert 0, start_tag\n text.html_safe.safe_concat(\"</span>\")\n end", "title": "" }, { "docid": "e70d0a32c434efe3e9d9397cf365c47e", "score": "0.58735853", "text": "def span_tag(class_name, token)\n \"<span class='#{class_name}'>#{token}</span>\"\n end", "title": "" }, { "docid": "b5241af0cfa72c64354a721a306dedc9", "score": "0.58584243", "text": "def to_s\r\n \"&#{wrap}\"\r\n end", "title": "" }, { "docid": "7712e9d2a239751eea0f91346682edd6", "score": "0.5847954", "text": "def test_entity_encoding_and_whatnot\n body = \"<p>&#49;&#50;&#51; what's up</p>\"\n html_tag = '<span class=\"numerical-word-123\">123</span>'\n assert_equal \"<p>#{html_tag} what's up</p>\", Filter.call(body).to_html\n end", "title": "" }, { "docid": "b9df6360e197b1c02efcb1ebf95fb9b0", "score": "0.58423287", "text": "def span(stylename, content)\n %Q(<text:span text:style-name=\"#{stylename}\">#{ERB::Util.h(content)}</text:span>)\n end", "title": "" }, { "docid": "d830fe41a205170ffe9ccf4d3e57d5ea", "score": "0.5834982", "text": "def escape(target)\n new(target.to_s.gsub(/[#{Entities}]/) {|m| \"&#{Encode[m]};\" })\n end", "title": "" }, { "docid": "c5e14abe3d2bb90a2a3bbdaf73779ef1", "score": "0.5787449", "text": "def to_html_entities\n unpack('U*').map! {|c| \"&##{c};\"}.join\n end", "title": "" }, { "docid": "4368a0bd34099ca4e5eaef4245351985", "score": "0.57815546", "text": "def entity_gsub!(chars)\n mapping = {\n '&' => '&amp;',\n '<' => '&lt;',\n '>' => '&gt;',\n '\"' => '&quot;',\n \"'\" => '&apos;'\n }\n re = /&(?!amp;)|[<>'\"]/\n chars.gsub!(re, mapping)\n chars\n end", "title": "" }, { "docid": "d19a4afce0f9721446c3449d34400c13", "score": "0.57511663", "text": "def mark_text(str)\n\t str = clean_html(str)\n\t \n\t return str\n end", "title": "" }, { "docid": "22a6c20fe01e3edb5c114e2ffb715ae0", "score": "0.5712463", "text": "def escape_html(html)\n html.to_s.gsub(/&/n, '&amp;').gsub(/\\\"/n, '&quot;').gsub(/>/n, '&gt;').gsub(/</n, '&lt;').gsub(/\\//, '&#47;')\n end", "title": "" }, { "docid": "9c2839bd5ebdc2180bba2b3747879e5c", "score": "0.56930214", "text": "def prepare_eds_payload(str, html_safe = false)\n return str if str.blank?\n \n unless configuration.highlighting\n str = str.html_safe if html_safe \n return str\n end\n \n parts = \n str.split(%r{(</?highlight>)}).collect do |substr|\n case substr\n when \"<highlight>\" then \"<b class='bento_search_highlight'>\".html_safe\n when \"</highlight>\" then \"</b>\".html_safe\n # Yes, EDS gives us HTML in the literals, we're choosing to trust it. \n else substr.html_safe\n end\n end\n \n return helper.safe_join(parts, '') \n end", "title": "" }, { "docid": "4cce9ac37a9abbd4dda2645cd577c352", "score": "0.56872284", "text": "def convert_entity(text)\n text = Iconv.new('iso-8859-15', 'utf-8').iconv(text) \n \n feed = text.inspect[1...-1]\n\n feed.gsub!(/\\\\([0-7]+)|(.)/m) do\n if $2\n $&\n else\n '&#%s;' % $1.to_i(8).to_s(10)\n end\n end\n \n feed.gsub!('\\\"', '&quot;')\n\n return feed\nend", "title": "" }, { "docid": "af065889dd4a09a6648a21b51cff3288", "score": "0.56795746", "text": "def HTMLEsc( str )\n\tstr.gsub!( /\\&/, \"&amp;\" )\n\tstr.gsub!( /\\\"/, \"&quot;\" )\n\tstr.gsub!( /</, \"&lt;\" )\n\tstr.gsub!( />/, \"&gt;\" )\n\tstr.gsub!( /\\n/, \"<br>\" )\n\tstr.gsub( /\\t/, \"&nbsp;\" )\nend", "title": "" }, { "docid": "9eea25a74489406e792847fc047d6831", "score": "0.56621474", "text": "def escape_to_html(data)\n { 1 => :bold,\n 2 => :nothing,\n 4 => :underline,\n 5 => :blink,\n 7 => :nothing,\n 30 => :black,\n 31 => :red,\n 32 => :green,\n 33 => :yellow,\n 34 => :blue,\n 35 => :magenta,\n 36 => :cyan,\n 37 => :white,\n 40 => :black_background,\n 41 => :green_background,\n 43 => :yellow_background,\n 44 => :blue_background,\n 45 => :magenta_background,\n 46 => :cyan_background,\n 47 => :white_background,\n }.each do |key, value|\n if value != :nothing\n data.gsub!(/\\e\\[#{key}m/,\"<span class=\\\"#{value}\\\">\")\n else\n data.gsub!(/\\e\\[#{key}m/,\"<span>\")\n end\n end\n data.gsub!(/\\e\\[0m/,'</span>')\n return data\nend", "title": "" }, { "docid": "675fa04ce9e4a80963ea8aad559b3403", "score": "0.5651019", "text": "def html_escape(str)\r\n str.gsub('&', '&amp;').str('<', '&lt;').str('>', '&gt;').str('\"', '&quot;')\r\nend", "title": "" }, { "docid": "059b89120441a530ce22e0447d1ea10b", "score": "0.5647842", "text": "def html_escape\n return to_s\n end", "title": "" }, { "docid": "059b89120441a530ce22e0447d1ea10b", "score": "0.5647842", "text": "def html_escape\n return to_s\n end", "title": "" }, { "docid": "d1daf9f6663b5af010c16885fe8b9178", "score": "0.560421", "text": "def html_escape(s)\n s.to_s.gsub(/&/, \"&amp;\").gsub(/\\\"/, \"&quot;\").gsub(/>/, \"&gt;\").gsub(/</, \"&lt;\")\n end", "title": "" }, { "docid": "05e3cde1d9622af44c5518dc53465019", "score": "0.5586942", "text": "def html_escape(clean_me)\n clean_me.to_s.gsub(/[&\"<>]/) do |special|\n { '&' => '&amp;',\n '>' => '&gt;',\n '<' => '&lt;',\n '\"' => '&quot;' }[special]\n end\n end", "title": "" }, { "docid": "cba934f452c028da3015892db8c2fc79", "score": "0.5576493", "text": "def esc_ht str\n\t\treturn Escape.html str\n\tend", "title": "" }, { "docid": "a086f08c994acf4464745eac86c99ea3", "score": "0.5562197", "text": "def tagging_symbol\n '&'\n end", "title": "" }, { "docid": "d270d9b5a7618f964e6fbd5a0f862b27", "score": "0.55509603", "text": "def e(content, params = {})\n clazz = params.fetch(:class, 'emoji')\n content.gsub(Unicode::Emoji::REGEX, '<span class=\"' + clazz + '\">\\0</span>')\nend", "title": "" }, { "docid": "20177cdf2577ac33217c5a4aa36080a0", "score": "0.55386907", "text": "def span_wrap tag, text\n \"<span class='#{tag}' markdown='1'>#{text}</span>\"\nend", "title": "" }, { "docid": "5028112132ad985921945070f39d5421", "score": "0.5517236", "text": "def html_safe(phrase)\n return h(phrase).gsub(/'/,'&#39;').gsub(/\\r\\n/,\"<br/>\")\n end", "title": "" }, { "docid": "f558d896c0c51d9f1ad980d3449f660a", "score": "0.55158836", "text": "def replace_entities(text)\n return text if text.blank?\n\n text = text.gsub('&nbsp;', ' ').gsub('\\u00a0', ' ').gsub('&zwnj;', '')\n text\n end", "title": "" }, { "docid": "0f867368a6bc12290cb3a1daa9b12c87", "score": "0.55000687", "text": "def esc(word)\n word.gsub(\"&\", \"&amp;\").gsub(\"<\", \"&lt;\")\n end", "title": "" }, { "docid": "452748bcd4f41b2723cd76758ff4f9a0", "score": "0.54910266", "text": "def escape_html(str, type = T.unsafe(nil)); end", "title": "" }, { "docid": "6635313b59f9681500b1c262fa16e888", "score": "0.5472848", "text": "def escape_content(content)\n # first, find any pre-escaped entities and \"mark\" them by replacing & with @@\n # so something like &lt; becomes @@lt;\n # and &#1234 becomes @@#1234\n\n content.gsub!(/&\\w+;/) {|t| t.gsub('&', '@@')}\n content.gsub!(/&#\\d{4}/) {|t| t.gsub('&', '@@')}\n content.gsub!(/&#\\d{3}/) {|t| t.gsub('&', '@@')}\n\n # now we know that all & characters remaining are not part of some pre-escaped entity, and we can escape them safely\n content.gsub!('&', '&amp;')\n\n # 'unmark' our pre-escaped entities\n content.gsub!(/@@\\w+;/) {|t| t.gsub('@@', '&')}\n content.gsub!(/@@#\\d{4}/) {|t| t.gsub('@@', '&')}\n content.gsub!(/@@#\\d{3}/) {|t| t.gsub('@@', '&')}\n\n return content\n end", "title": "" }, { "docid": "2ffef2b8b7b1c0e33e78a687ff370261", "score": "0.5471637", "text": "def markup_escape(text)\n table_for_escape = {\n \"&\" => \"&amp;\",\n \"<\" => \"&lt;\",\n \">\" => \"&gt;\",\n }\n text.gsub(/[&<>]/, table_for_escape)\n end", "title": "" }, { "docid": "530ef1da8d82c72a5ab7c304602e21c1", "score": "0.547158", "text": "def html_escape(s)\n s = s.to_s\n if s.html_safe?\n s\n else\n s.to_s.gsub(/&/, \"&amp;\").gsub(/\\\"/, \"&quot;\").gsub(/>/, \"&gt;\").gsub(/</, \"&lt;\").html_safe\n end\n end", "title": "" }, { "docid": "3c0620d396fb089a8ae6456a7ea2c8a8", "score": "0.5454268", "text": "def _gestalt_escape_entities(s)\n s.to_s.gsub(/&/, '&amp;').\n gsub(/\"/, '&quot;').\n gsub(/'/, '&apos;').\n gsub(/</, '&lt;').\n gsub(/>/, '&gt;')\n end", "title": "" }, { "docid": "e3aa3f7ebf8bf0d2f134d369d355b40c", "score": "0.5440482", "text": "def convert_smart_quote(el)\r\n t = case el.value\r\n when :lsquo\r\n \"\\u2018\"\r\n when :rsquo\r\n \"\\u2019\"\r\n when :ldquo\r\n \"\\u201C\"\r\n when :rdquo\r\n \"\\u201D\"\r\n end\r\n #puts \"smartquote sub #{t}\"\r\n %{para(\"#{t}\", :margin_left => 0, :margin_right => 0)}\r\n end", "title": "" }, { "docid": "2766a8f4c89be664d516014164f69b3b", "score": "0.5419846", "text": "def format_as_span_html(name, attr, body); end", "title": "" }, { "docid": "2f5f4ee8e99840625d8ad45df1e8513e", "score": "0.5405615", "text": "def conv_html(txt)\n txt.\n gsub(/&gt;/, '>').\n gsub(/&lt;/, '<').\n gsub(/&quot;/, '\"').\n gsub(/&amp;/, '&')\n \n end", "title": "" }, { "docid": "91ab590ee59c3ba9313eb8745b9a631d", "score": "0.5405589", "text": "def hsc(str)\n str.gsub(/&/, \"&amp;\")\n .gsub(/</, \"&lt;\")\n .gsub(/>/, \"&gt;\")\n .gsub(/\"/, \"&quot;\")\n .gsub(/'/, \"&#039;\")\n end", "title": "" }, { "docid": "0d86f998af7229c46a328d1af26ee2c8", "score": "0.5398985", "text": "def escape_entities(str)\n CGI.escapeHTML(str).gsub(/[\\n\\r]/) {|c| '&#x' + c.unpack('h').first + ';'}\n end", "title": "" }, { "docid": "58ffb3366c84229b33728f878984a2af", "score": "0.53968084", "text": "def html_span(*args, &block)\n html_tag(:span, *args, &block)\n end", "title": "" }, { "docid": "5602b8902fba8335f960cf3b3f60b585", "score": "0.53949267", "text": "def to_slack\n input.gsub('&', '&amp;')\n .gsub('<', '&lt;')\n .gsub('>', '&gt;')\n end", "title": "" }, { "docid": "aa3857696e6831eefe5d4f54f7a5367c", "score": "0.53823584", "text": "def highlight(search_str, text)\n text.gsub!(search_str, \"<strong>#{search_str}</strong>\")\n end", "title": "" }, { "docid": "87a634d6c59780b299568d81f88b6969", "score": "0.53676105", "text": "def encode_html( str )\n\t\t\t#str.gsub( /&(?!#?[x]?(?:[0-9a-f]+|\\w+);)/i, \"&amp;\" ).\n\t\t\t\t#gsub( %r{<(?![a-z/?\\$!])}i, \"&lt;\" )\n\t\t\t\treturn str\n\t\tend", "title": "" }, { "docid": "90c1429f30de21e94edeb250ca6cdd55", "score": "0.53568476", "text": "def convert_html_safe(str)\n return str.html_safe\n end", "title": "" }, { "docid": "862bb7f91fa74d311231ee11a277830d", "score": "0.5354433", "text": "def html_escape(text)\n text.to_s.gsub(/[\\\"><&]/) { |s| HTML_ESCAPE[s] }\n end", "title": "" }, { "docid": "a1ac8eeb437be22de58db50368b8056e", "score": "0.53429043", "text": "def htmlEscape(string)\n return string.gsub('&', '&amp;').gsub('>', '&gt;').gsub('<', '&lt;')\nend", "title": "" }, { "docid": "9b085a61a4bec952f451a5764ed85c6e", "score": "0.53341144", "text": "def h_(str)\n str.to_s.gsub(/['&\\\"<>]/, {\"'\"=>\"&#39;\", \"&\"=>\"&amp;\", '\"'=>\"&quot;\", \"<\"=>\"&lt;\", \">\"=>\"&gt;\"})\n end", "title": "" }, { "docid": "0c92a7061dfbc220c29acd87f319cb66", "score": "0.532785", "text": "def as_html_deprecated #use TextEncoder.convert_to_html instead.\n return self if self.blank?\n mytext = self\n #mytext = CGI.escapeHTML(mytext)\n mytext.gsub!(NpbConstants::URL_DETECTION){|web_link| %{ <a href=\"#{web_link.strip}\">#{web_link.strip}</a> }}\n #mytext.gsub!(NpbConstants::EMAIL_DETECTION){|email| %{\\1<a href=\"mailto:#{email.strip}\">#{email.strip}</a>}}\n mytext.gsub!(NpbConstants::EMAIL_DETECTION){|email| %{#{$1}<a href=\"mailto:#{email.strip}\">#{email.strip}</a>}}\n mytext.gsub!(/\\A +/) {|l_spaces| (\"&nbsp;\"*l_spaces.size)} \n mytext.gsub!(/\\n +/) {|l_spaces| (\"\\n\" + (\"&nbsp;\"*(l_spaces.size-1)))}\n mytext.gsub!(/\\n{2,}/,'</p><p>')\n mytext.gsub!(/(\\n)([^\\n])/, '<br/>\\2')\n mytext\n end", "title": "" }, { "docid": "0cc8467c765fb1f3c1f988b394606ed2", "score": "0.53274757", "text": "def format_token(token)\n content_tag(:span, token.split(\"\").inject(\"\") {|memo,char| memo += \"-\" if memo.size > 0 and memo.gsub(\"-\",\"\").size % 3 == 0; memo += char }, :class => \"monospace\")\n end", "title": "" }, { "docid": "d4b798e531a5ce90feab82efc86103a9", "score": "0.5313735", "text": "def end_style\n \"</span>\"\n end", "title": "" }, { "docid": "b21d06f969c5b1d886cec901157c5594", "score": "0.53043", "text": "def apply_span_transforms( str, rs )\n\t\t\t@log.debug \"Applying span transforms to:\\n %p\" % str\n\n\t\t\tstr = transform_code_spans( str, rs )\n\t\t\tstr = transform_auto_links( str, rs )\n\t\t\tstr = encode_html( str )\n\t\t\tstr = transform_images( str, rs )\n\t\t\tstr = transform_anchors( str, rs )\n\t\t\tstr = transform_italic_and_bold( str, rs )\n\n\t\t\t# Hard breaks\n\t\t\tstr.gsub!( / {2,}\\n/, \"<br#{EmptyElementSuffix}\\n\" )\n\n\t\t\t@log.debug \"Done with span transforms:\\n %p\" % str\n\t\t\treturn str\n\t\tend", "title": "" }, { "docid": "6a0ddc3a132bf31d4d491a2a5fa8a177", "score": "0.5303723", "text": "def carets(str)\n \"&#60;#{str.to_s}&#62;\"\n end", "title": "" }, { "docid": "b072c1a7667a76d5b6a6e9b2ecbc7642", "score": "0.5273033", "text": "def escape_content\n content.to_s.gsub(/&/, \"&amp;\").gsub(/\\\"/, \"&quot;\").gsub(/>/, \"&gt;\").gsub(/</, \"&lt;\") \n end", "title": "" }, { "docid": "dd4e37e4293688e3c1112f71aea594c9", "score": "0.5269229", "text": "def escape(s)\n s.gsub(/[&<>`]/, \"&\" => \"&amp;\", \"<\" => \"&lt;\", \">\" => \"&gt;\", \"`\" => \"`\")\n end", "title": "" }, { "docid": "96166da9cf74dfc4b96b1ae1c933aa13", "score": "0.5233785", "text": "def escape_xml(string) \n string.gsub(/[&<>\\'\\\"]/) do | match |\n case match\n when '&' then '&amp;'\n when '<' then '&lt;'\n when '>' then '&gt;'\n when '\"' then '&quot;'\n when \"'\" then '&apos;'\n end\n end \n end", "title": "" }, { "docid": "410a1002a868a2bf15c28e6bdc0de25f", "score": "0.5227731", "text": "def escape_field( field )\n return html_escape( field ).gsub( \"\\\\\", \"&#92;\" )\n end", "title": "" }, { "docid": "52cdd32025cc94972fb5d8bb55a0862a", "score": "0.52250713", "text": "def tooltip_markup(markup)\n content_tag :span, markup.html_safe\n end", "title": "" }, { "docid": "b254967b433982a51ee0ece3e24e72eb", "score": "0.5224905", "text": "def html_safe\n self\n end", "title": "" }, { "docid": "eab23839604165e4432ed2ef1762324a", "score": "0.52081406", "text": "def h(s)\n case s\n when Raw\n s\n when Tag\n s.to_s\n else\n escape_html(s)\n end\n end", "title": "" }, { "docid": "3349157ccdc4dcf81110455a92f8b87b", "score": "0.51975054", "text": "def escape_ansi_to_html(data)\n {1 => :nothing,\n 2 => :nothing,\n 4 => :underline,\n 5 => :nothing,\n 7 => :nothing,\n 30 => :black,\n 31 => :red,\n 32 => :green,\n 33 => :yellow,\n 34 => :blue,\n 35 => :magenta,\n 36 => :cyan,\n 37 => :white,\n 39 => :bold,\n 40 => :nothing\n }.each do |key, value|\n if value != :nothing\n data.gsub!(/\\e\\[#{key}m/, \"<span class=\\\"#{value}\\\">\")\n else\n data.gsub!(/\\e\\[#{key}m/, \"<span>\")\n end\n end\n data.gsub!('[39;1m', '')\n data.gsub!(/\\e\\[0m/, '</span>')\n data\n end", "title": "" }, { "docid": "3dbcbedb0fbca87de1637f105877bb47", "score": "0.5191443", "text": "def convert_link(url)\n url.gsub('&', '&amp;')\nend", "title": "" }, { "docid": "fa0112213b596d96205a0449e5e22375", "score": "0.5190822", "text": "def fix(text)\n NLP.htmlentities.decode text\n end", "title": "" }, { "docid": "8fdc80a8aea2871569608d84385668c6", "score": "0.51869667", "text": "def html_escape(s)\n s.to_s.gsub(/[&\"><]/) { |special| HTML_ESCAPE[special] }\n end", "title": "" }, { "docid": "34cedf0cddcc69f58afb8c7d46101ca0", "score": "0.5181998", "text": "def html_escape(html)\n html.to_s.gsub(/[&\"><]/) { |special| HTML_ESCAPE[special] }\n end", "title": "" }, { "docid": "5f2ce8c0ca2666eb4d315f4c8d89bb26", "score": "0.5170118", "text": "def html_encode\n require 'htmlentities'\n \n coder = HTMLEntities.new\n \n ret = coder.encode(self, :named)\n \n return ret\n end", "title": "" }, { "docid": "22833e052f1da8dd7a701238cc0396c7", "score": "0.5164333", "text": "def htmlify(text, markup = T.unsafe(nil)); end", "title": "" }, { "docid": "bd68740a8a008b4e5f5bac74f1dfc7a9", "score": "0.5152239", "text": "def slugorize\n result = self.downcase\n result.gsub!(/&(\\d)+;/, '') # Ditch Entities\n result.gsub!('&', 'and') # Replace & with 'and'\n result.gsub!(/['\"]/, '') # replace quotes by nothing\n result.gsub!(/\\W/, ' ') # strip all non word chars\n result.gsub!(/\\ +/, '-') # replace all white space sections with a dash\n result.gsub!(/(-)$/, '') # trim dashes\n result.gsub!(/^(-)/, '') # trim dashes\n result\n end", "title": "" }, { "docid": "baca33b730587211c158195c5bc6e4a1", "score": "0.5145962", "text": "def normalize_entities(string)\n # Convert '&' to '&amp;' only if it's not followed by an entity.\n string.gsub(/&(?!lt|gt|amp|quot|apos)/, '&amp;')\n end", "title": "" }, { "docid": "93ad99e857f138dadc2541e4b00c2aa8", "score": "0.5143325", "text": "def html_escape(s) # rubocop:disable Lint/DuplicateMethods\n unwrapped_html_escape(s).html_safe\n end", "title": "" }, { "docid": "4a5520f7544db337935f79c8488d0f5a", "score": "0.51415294", "text": "def parse_span_html; end", "title": "" }, { "docid": "8c70e9f388b5074a8a1e3ad01628ca7b", "score": "0.51412433", "text": "def escape_xml(xml_in) \n return xml_in.gsub(/&/,'&amp;').gsub(/</,'&lt;')\n end", "title": "" }, { "docid": "0fd3599c2811a9f6c95d4d06e5b0d184", "score": "0.5130255", "text": "def nbsp(value)\n raw(value.html_escape.gsub(/ /,'&#160;'))\n end", "title": "" }, { "docid": "f4abb0b2d9c6cc3a2d1c576065a2e3fe", "score": "0.5125569", "text": "def convert_text(el, opts)\n if opts[:raw_text]\n el.value\n else\n el.value.gsub(/\\A\\n/) do\n opts[:prev] && opts[:prev].type == :br ? '' : \"\\n\"\n end#.gsub(/\\s+/, ' ').gsub(ESCAPED_CHAR_RE) { \"\\\\#{$1 || $2}\" }\n end\n end", "title": "" }, { "docid": "272fe15ada3350b931fc5845d5390aa4", "score": "0.512232", "text": "def markup\n self.text.sub(/^(.*)$/,'<b>\\1</b>')\n end", "title": "" }, { "docid": "cbaa3019cbd91f351358109d33a78a0a", "score": "0.51208615", "text": "def escape_html(str)\n\t\t\t#table = HTML_ESC # optimize\n\t\t\t#str.gsub(/[&\"<>]/) {|s| table[s] }\n\t\t\treturn str\n\t\tend", "title": "" }, { "docid": "e8705b53e6a04186468d26af1e4b7823", "score": "0.51188767", "text": "def html_text(str)\n str.gsub(/[&<>]/) {|ch| HTML_TEXT_ESCAPE_HASH[ch] }\n end", "title": "" }, { "docid": "d31001a9f795539caeb1d5ba88006f6d", "score": "0.51157224", "text": "def _wp_specialchars(string, quote_style = :ENT_NOQUOTES, charset = false, double_encode = false)\n string = string.to_s\n\n return '' if string == ''\n\n # Don't bother if there are no specialchars - saves some processing\n return string unless string =~ /[&<>\"']/\n\n \t# Account for the previous behaviour of the function when the $quote_style is not an accepted value\n if quote_style.blank?\n quote_style = :ENT_NOQUOTES\n elsif ![0, 2, 3, 'single', 'double' ].include? quote_style\n quote_style = :ENT_QUOTES\n end\n\n # TODO continue implement function _wp_specialchars\n\t # Store the site charset as a static to avoid multiple calls to wp_load_alloptions()\n\t unless charset\n\t \t# static $_charset = null;\n\t# \tif ( ! isset( $_charset ) ) {\n\t# \t\t$alloptions = wp_load_alloptions();\n\t# \t\t$_charset = isset( $alloptions['blog_charset'] ) ? $alloptions['blog_charset'] : '';\n\t# \t}\n\t# \t$charset = $_charset;\n charset = get_option('blog_charset')\n\t end\n\n charset = 'UTF-8' if ['utf8', 'utf-8', 'UTF8'].include?(charset)\n\n\t_quote_style = quote_style\n\n\tif quote_style == 'double'\n\t\tquote_style = :ENT_COMPAT\n\t\t_quote_style = :ENT_COMPAT\n\t elsif quote_style == 'single'\n\t\tquote_style = :ENT_NOQUOTES\n\tend\n\n\tunless double_encode\n\t\t# Guarantee every &entity; is valid, convert &garbage; into &amp;garbage;\n\t\t# This is required for PHP < 5.4.0 because ENT_HTML401 flag is unavailable.\n\t\tstring = wp_kses_normalize_entities(string)\n\tend\n\n string = h(string)\n\t# TODO string = @htmlspecialchars( $string, $quote_style, $charset, $double_encode )\n\n\t# Back-compat.\n\tif 'single' == _quote_style\n\t\tstring = string.gsub(\"'\", '&#039;')\n end\n\n string\n end", "title": "" }, { "docid": "9bfd541c01e5085f6408731701474991", "score": "0.51108485", "text": "def ansi_to_html(string); end", "title": "" }, { "docid": "049dae8419872e1ce79987600778bd9c", "score": "0.5103838", "text": "def escape(content)\n return content if content.html_safe?\n content.gsub(/[&><\"]/) { |char| ESCAPE_SEQUENCE[char] }\n end", "title": "" }, { "docid": "fc243e89c2f27a09e83dddcc92d817a9", "score": "0.51006", "text": "def test_entity_replacement\n\tt = NQXML::Tokenizer.new('')\n\n\t# add a method that lets us set the internal entity hash\n\tclass << t\n\t def testSetInternalEntities(h); @internalEntities = h; end\n\tend\n\n\tt.testSetInternalEntities({ # as if we saw <!ENTITY...> tags\n\t 'a' => '&b;',\n\t 'b' => '&foo;',\n\t 'foo' => '&bar;',\n\t 'bar' => 'bletch',\n\t 'ugly' => 'An ampersand (&#38;) may be escaped' +\n\t\t\t' numerically (&#38;#38;) or with a general' +\n\t\t\t' entity (&amp;amp;).'\n\t})\n\n\tassert_equal('x <&> x', t.replaceAllRefsButParams('x &lt;&amp;&gt; x'))\n\tassert_equal('x \"\\' x', t.replaceAllRefsButParams('x &quot;&apos; x'))\n\tassert_equal('x A x', t.replaceAllRefsButParams('x &#65; x'))\n\tassert_equal('x A x', t.replaceAllRefsButParams('x &#x41; x'))\n\tassert_equal('&&', t.replaceAllRefsButParams('&amp;&#38;'))\n\n\tassert_equal('&amp', t.replaceAllRefsButParams('&amp'))\n\tassert_equal('&', t.replaceAllRefsButParams('&amp;'))\n\n\tassert_equal('bletch', t.replaceAllRefsButParams('&bar;'))\n\tassert_equal('bletch', t.replaceAllRefsButParams('&foo;'))\n\tassert_equal('bletch', t.replaceAllRefsButParams('&b;'))\n\tassert_equal('bletch', t.replaceAllRefsButParams('&a;'))\n\n\tassert_equal('An ampersand (&) may be escaped' +\n\t\t ' numerically (&#38;) or with a general' +\n\t\t ' entity (&amp;).', t.replaceAllRefsButParams('&ugly;'))\n\n\t# Make sure unknown entities raise an error\n\texpect_error('x &huh; x', /entity reference '&huh;' is undefined/)\n end", "title": "" }, { "docid": "fcbba52c0d8e78e63ae708bf3906ab6c", "score": "0.50948757", "text": "def rm_html_entities(str)\n str.gsub(/&\\w+;/, \"\")\n end", "title": "" }, { "docid": "511994512e381efcc030596ce763e525", "score": "0.5089655", "text": "def html_escape(s)\n CGI.escapeHTML(s.to_s)\n end", "title": "" }, { "docid": "efb36671cf5d8b6ba3428f0e11ff2c9e", "score": "0.50850344", "text": "def cleanup(str)\n return str.gsub(/([ &])/, '\\\\\\\\\\1')\nend", "title": "" }, { "docid": "efb36671cf5d8b6ba3428f0e11ff2c9e", "score": "0.50850344", "text": "def cleanup(str)\n return str.gsub(/([ &])/, '\\\\\\\\\\1')\nend", "title": "" }, { "docid": "efb36671cf5d8b6ba3428f0e11ff2c9e", "score": "0.50850344", "text": "def cleanup(str)\n return str.gsub(/([ &])/, '\\\\\\\\\\1')\nend", "title": "" }, { "docid": "669e821bb5b849245267aa8cd7f617ee", "score": "0.50735086", "text": "def escape(text)\n if !text.kind_of?(String)\n if text.respond_to?(:to_str)\n text = text.to_str\n else\n text = test.to_s\n end\n end\n # TODO: Verify that this is sufficient, gut feeling says no.\n text.gsub(/\\</, \"&lt;\")\n end", "title": "" }, { "docid": "3c2ec9a29614153ecf4195492f785237", "score": "0.5068016", "text": "def convert_string_fancy(item)\n # convert ampersand before doing anything else\n item.gsub(/&/, '&amp;').\n\n # convert -- to em-dash, (-- to en-dash)\n gsub(/---?/, '&#8212;'). #gsub(/--/, '&#8211;').\n\n # convert ... to elipsis (and make sure .... becomes .<elipsis>)\n gsub(/\\.\\.\\.\\./, '.&#8230;').gsub(/\\.\\.\\./, '&#8230;').\n\n # convert single closing quote\n gsub(%r{([^ \\t\\r\\n\\[\\{\\(])\\'}, '\\1&#8217;'). # }\n gsub(%r{\\'(?=\\W|s\\b)}, '&#8217;').\n\n # convert single opening quote\n gsub(/'/, '&#8216;').\n\n # convert double closing quote\n gsub(%r{([^ \\t\\r\\n\\[\\{\\(])\\\"(?=\\W)}, '\\1&#8221;'). # }\n\n # convert double opening quote\n gsub(/\"/, '&#8220;').\n\n # convert copyright\n gsub(/\\(c\\)/, '&#169;').\n\n # convert registered trademark\n gsub(/\\(r\\)/, '&#174;')\n end", "title": "" }, { "docid": "dd1f8eca76cf856439e6aa7d2df2b8b2", "score": "0.50645703", "text": "def test_entity_insertions\n assert_equal(\"&amp;\", REXML::Text.new(\"&amp;\", false, nil, true).to_s)\n #assert_equal(\"&\", REXML::Text.new(\"&amp;\", false, false).to_s)\n end", "title": "" }, { "docid": "91a840c7a4d58d2b7ccd775829452ee2", "score": "0.5064113", "text": "def replace_and(business)\n return business.gsub(\"&\", \"and\")\n end", "title": "" }, { "docid": "14cb80541438d920fe41ed712a369253", "score": "0.5058318", "text": "def to_html(formatting, text)\n text\n end", "title": "" }, { "docid": "62c6156ca240e03e6bcd4abb97aeaaab", "score": "0.5041861", "text": "def h(s)\n Rack::Utils.escape_html(s.to_s)\n end", "title": "" }, { "docid": "a7971e19842a8615e3be59f1fe70689d", "score": "0.5035996", "text": "def to_html\n html = @text\n html = html_tag(:em, content: html) if italicized?\n html = html_tag(:strong, content: html) if bolded?\n styles = {}\n styles['text-decoration'] = 'underline' if underlined?\n # No need to be granular with font size down to the span level if it doesn't vary.\n #styles['font-size'] = \"#{font_size}pt\" if font_size != @font_size\n html = html_tag(:span, content: html, styles: styles) if styles.present?\n return html\n end", "title": "" }, { "docid": "00b9980b8097cce86c6fd6367125e053", "score": "0.5035336", "text": "def beautify(txt)\n #txt.gsub!(/\\*(.*)\\*/, \"<span style=\\\"font-weight: bold;\\\">\\\\1</span>\")\n #txt.gsub!(/\\/(.*)\\//, \"<em>\\\\1</em>\") # Italic\n #txt.gsub!(/\\_(.*)\\_/, \"<span style=\\\"font-decoration: underline;\\\">\\\\1</span>\")\n #txt.gsub!(/\\-(.*)\\-/, \"<span style=\\\"font-decoration: line-through;\\\">\\\\1</span>\")\n # <span style=\"font-size: large;\">ok?</span>\n # <span style=\"color: #FF0000;\">ok?</span>\n txt\n end", "title": "" }, { "docid": "a267c24034bfda023bff35d7828e52db", "score": "0.50339305", "text": "def convert_string(text)\n CGI.escapeHTML text\n end", "title": "" }, { "docid": "39dc62801bc17b023daa2a5cefdaa699", "score": "0.50332224", "text": "def fix_double_escape(escaped)\n escaped.gsub(/&amp;([a-z]+|(#\\d+));/i) { \"&#{$1};\" }\n end", "title": "" }, { "docid": "bb9b33555d5854e23a30a998b6d0db8d", "score": "0.5030976", "text": "def slugorize\n\t result = self.downcase\n\t result.gsub!(/&(\\d)+;/, '') # Ditch Entities\n\t result.gsub!('&', 'and') # Replace & with 'and'\n\t result.gsub!(/['\"]/, '') # replace quotes by nothing\n\t result.gsub!(/\\W/, ' ') # strip all non word chars\n\t result.gsub!(/\\ +/, '-') # replace all white space sections with a dash\n\t result.gsub!(/(-)$/, '') # trim dashes\n\t result.gsub!(/^(-)/, '') # trim dashes\n\t result\n\tend", "title": "" }, { "docid": "6d72e5f802fae4d8733aba9a43595034", "score": "0.5029893", "text": "def escape_html(html)\n html.to_s.gsub(/[&\\\"<>\\/]/, ESCAPE_HTML)\n end", "title": "" }, { "docid": "0cb417176dddff97568d1b8015aae7d9", "score": "0.5020272", "text": "def escape_html( string )\n\t\t\treturn \"nil\" if string.nil?\n\t\t\tstring = string.inspect unless string.is_a?( String )\n\t\t\tstring.\n\t\t\t\tgsub(/&/, '&amp;').\n\t\t\t\tgsub(/</, '&lt;').\n\t\t\t\tgsub(/>/, '&gt;').\n\t\t\t\tgsub(/\\n/, '&#8629;').\n\t\t\t\tgsub(/\\t/, '&#8594;')\n\t\tend", "title": "" } ]
37fe2ab6ec42fa955640bb9bee333ee6
Mosaic target if creating a raster and there's either one file or the given file has _cropped in the name.
[ { "docid": "530e11d3a8dab7f021efd92e8ba78cd9", "score": "0.72808164", "text": "def mosaic_service_target?\n return false unless raster_resource_parent?\n return true if file_paths.length == 1\n basename.to_s.include?(\"_cropped\")\n end", "title": "" } ]
[ { "docid": "7c66be4558ff871c28f902cf4159cddb", "score": "0.61826015", "text": "def recreate_cropped_image\n if image.exists?\n img = ThumbMagick::Image.new(image.path('tocrop'))\n img.\n thumbnail(\"#{resize * 100}%\").\n crop(\"#{crop_w}x#{crop_h}\", crop_x, crop_y).\n write(image.path('cropped'))\n end \n end", "title": "" }, { "docid": "dee3608fe9969b214a06b8b5810994ff", "score": "0.612124", "text": "def mosaic(opts)\n if opts[:type] == :grid\n files = load_layout(opts[:layout])\n files2 = group_masses(files, opts[:masses])\n files2 = normalize(files2, opts)\n tile(files2, opts[:file_out])\n else\n pads = get_pad_values(opts[:files], opts[:compress], opts[:prototype], opts[:reverse]) ## DJ:09/17/2014 : \"opts[:reverse]\" argument was added.\n nrrd_files = group_masses(opts[:files], opts[:masses]) \n normalize_files = normalize([nrrd_files], opts)[0]\n files_to_delete = normalize_files.dup \n tmp_out_file = merge(normalize_files, pads, opts[:file_out])\n set_positions_strings(opts[:files], opts[:file_out], tmp_out_file, opts[:prototype])\n cleanup(files_to_delete << tmp_out_file)\n end \nend", "title": "" }, { "docid": "43a14703a8ff11a20925248532c01b85", "score": "0.6077542", "text": "def crop!\n return false unless cropping?\n Magick::Image.read(full_filename).first.crop(crop_x.to_i, crop_y.to_i, crop_w.to_i, crop_h.to_i).write(full_filename)\n\n # Resize all the thumbnails\n resize_all\n end", "title": "" }, { "docid": "44835b9086e0780a54d8f790dc1daad4", "score": "0.6074808", "text": "def save_cropped_thumb\r\n fully_scoped_mini_name = fully_scoped_fs file_minithumb_name\r\n\r\n if File.exists?(fully_scoped_mini_name)\r\n if !File.exists?(fully_scoped_cropped_name) || @dimensions_dirty\r\n if system %{convert -crop \\\r\n\"#{cropped_dimensions.join('x')}+#{(horizontal_position.to_f / 2).abs}+#{(vertical_position.to_f / 2).abs}\" \\\r\n\"#{fully_scoped_mini_name}\" \"#{fully_scoped_cropped_name}\" > /dev/null 2>&1}\r\n\r\n @dimensions_dirty = false\r\n end\r\n end\r\n end\r\n end", "title": "" }, { "docid": "ceab8111c4850eb1c951c86301bd2f62", "score": "0.5857788", "text": "def process_precrop\n\n if @name.blank? && ( logo.content_type.present? && !logo.content_type.start_with?(\"image/\"))\n logo.errors['invalid_type'] = I18n.t('avatar.error.no_image_file')\n return false\n end\n\n return if !@name.blank?\n\n if resize_image(logo.queued_for_write[:original].path,500,500)\n logo.errors['precrop'] = \"You have to make precrop\"\n Avatar.copy_to_temp_file(logo.queued_for_write[:original].path)\n else\n\n end\n end", "title": "" }, { "docid": "229a5ac46c9daebceaff6bd4cb08ab62", "score": "0.57316184", "text": "def is_cropped?\n file_ext == :avif && metadata[\"QuickTime:CleanAperture\"].present?\n end", "title": "" }, { "docid": "9cd2ca892a57e818c8e08c7886c6160f", "score": "0.5659827", "text": "def cropping?\n !largecrop_x.blank? && !largecrop_y.blank? && !largecrop_w.blank? && !largecrop_h.blank?\n end", "title": "" }, { "docid": "4c44e1a269a8f4a542485fa7e3bcc785", "score": "0.56373817", "text": "def make_custom(aDestpath)\n\t\tsrc = @file\n\t\tsrcpath = File.expand_path(src.path).gsub('$','\\$')\t# escape $, more chars may need to be added\n\t\ttcmd = transformation_command.sub('-resize','-strip -colorspace rgb -thumbnail')\n\t\tcommand = \"#{ source_file_options } \\\"#{ srcpath }[0]\\\" #{ tcmd } \\\"#{ File.expand_path(aDestpath) }\\\"\"\n\n\t\tsuccess = false\n\t\tbegin\n\t\t\tsuccess = (Paperclip.run(\"convert\", command)=='')\t# assuming output always mean failure\n\t\trescue Paperclip::PaperclipCommandLineError\n\t\t\traise Paperclip::PaperclipError, \"There was an error processing the thumbnail for #{@basename}\" if @whiny\n\t\tend\n\t\tsuccess\n\tend", "title": "" }, { "docid": "06dfa899472fa76b8a565d6c78c424d4", "score": "0.55729264", "text": "def create_mosaic\n\t\ttile_size = 40\n\t\tmosaic_images = ImageList.new\n\t\ttile = Rectangle.new(tile_size,tile_size,0,0)\n\t\tphoto_tiles.scene = 0\n\t\tnum = 0\n\t\tmaster.bounding_box.height.times do |row|\n\t\t master.bounding_box.width.times do |col|\n\t\t idx = match_photo(pixel_array[num], average_colors)\n\t\t mosaic_images << photo_tiles[idx].crop_resized(tile_size,tile_size)\n\t\t tile.x = col * mosaic_images.columns\n\t\t tile.y = row * mosaic_images.rows\n\t\t mosaic_images.page = tile\n\t\t (photo_tiles.scene += 1) rescue photo_tiles.scene = 0 \n\t\t num = num.next\n\t\t end\n\t\tend\t\n\tend", "title": "" }, { "docid": "a094c8f0093e2abcbea313fdb22390bf", "score": "0.556434", "text": "def has_target?(name)\n !image_for(\"#{name}_target\").nil?\n end", "title": "" }, { "docid": "3cf997728ea9b273c25bba86fd721e5b", "score": "0.5457694", "text": "def make \n dst = Tempfile.new([@basename, @format].compact.join(\".\"))\n dst.binmode \n\n if target_geometry?\n command = \"convert\"\n params = [File.expand_path(@file.path)]\n params += transformation_command\n params << File.expand_path(dst.path)\n begin\n success = Paperclip.run(command, params.flatten.compact.collect{|e| \"'#{e}'\"}.join(\" \"))\n rescue PaperclipCommandLineError\n raise PaperclipError, \"There was an error resizing and cropping #{@basename}\" if @whiny\n end\n end \n\n if convert_options?\n command = \"convert\"\n from_file = target_geometry? ? tofile(dst) : fromfile\n params = \"#{from_file} #{@convert_options} #{tofile(dst)}\"\n begin\n success = Paperclip.run(command, params)\n rescue PaperclipCommandLineError\n raise PaperclipError, \"There was an error processing the watermark for #{@basename}\" if @whiny\n end\n end \n\n if @watermark_path\n if convert_options? || target_geometry?\n scale = Geometry.from_file(File.expand_path(dst.path)).to_s.split('x')[0].to_i/6\n else\n scale = Geometry.from_file(File.expand_path(@file.path)).to_s.split('x')[0].to_i/6\n end\n watermark = File.new(@watermark_path)\n tmp_watermark = Tempfile.new(File.basename(watermark))\n command = \"convert\"\n params = \"#{@watermark_path} -resize #{scale} #{File.expand_path(tmp_watermark)}\"\n begin\n success = Paperclip.run(command, params)\n rescue PaperclipCommandLineError\n raise PaperclipError, \"There was an error resizing #{watermark}\" if @whiny\n end\n \n command = \"composite\"\n if convert_options? || target_geometry?\n params = \"-gravity #{@position} #{File.expand_path(tmp_watermark)} #{tofile(dst)} #{tofile(dst)}\"\n else\n params = \"-gravity #{@position} #{File.expand_path(tmp_watermark)} #{fromfile} #{tofile(dst)}\"\n end\n \n \n begin\n success = Paperclip.run(command, params)\n rescue PaperclipCommandLineError\n raise PaperclipError, \"There was an error processing the watermark for #{@basename}\" if @whiny\n end \n end\n \n dst\n end", "title": "" }, { "docid": "2ba1ca1244e262996629d1952a97b4a7", "score": "0.5454627", "text": "def cropping?\n !crop_x.blank? && !crop_y.blank? && !crop_w.blank? && !crop_h.blank?\n end", "title": "" }, { "docid": "f95eeebec375197fb2495d6aaaf87e25", "score": "0.5447107", "text": "def cropped?\n crop_size? && real_size? && crop_size != real_size\n end", "title": "" }, { "docid": "fcb68c66eafbaec053ee540dbd8e2ab9", "score": "0.541483", "text": "def cropping?\n !crop_x.blank? && !crop_y.blank? && !crop_w.blank? && !crop_h.blank?\n end", "title": "" }, { "docid": "fcb68c66eafbaec053ee540dbd8e2ab9", "score": "0.541483", "text": "def cropping?\n !crop_x.blank? && !crop_y.blank? && !crop_w.blank? && !crop_h.blank?\n end", "title": "" }, { "docid": "fcb68c66eafbaec053ee540dbd8e2ab9", "score": "0.541483", "text": "def cropping?\n !crop_x.blank? && !crop_y.blank? && !crop_w.blank? && !crop_h.blank?\n end", "title": "" }, { "docid": "fcb68c66eafbaec053ee540dbd8e2ab9", "score": "0.541483", "text": "def cropping?\n !crop_x.blank? && !crop_y.blank? && !crop_w.blank? && !crop_h.blank?\n end", "title": "" }, { "docid": "fcb68c66eafbaec053ee540dbd8e2ab9", "score": "0.541483", "text": "def cropping?\n !crop_x.blank? && !crop_y.blank? && !crop_w.blank? && !crop_h.blank?\n end", "title": "" }, { "docid": "83ed538e40e4b4f1a6c3ebc6c606cc6f", "score": "0.54130465", "text": "def make_precrop(path,x,y,width,height)\n begin\n img_orig = Magick::Image.read(path).first\n rescue\n logo.errors['invalid_type'] = I18n.t('avatar.error.no_image_file')\n return false\n end\n\n dimensions = Avatar.get_image_dimensions(path)\n\n unless (width == 0) || (height == 0)\n crop_args = [x,y,width,height]\n img_orig = img_orig.crop(*crop_args)\n end\n\n img_orig = img_orig.resize_to_fill(500,500)\n\n img_orig.write(path)\n end", "title": "" }, { "docid": "86c5aa4b039b271f31e3b0e88ad330a9", "score": "0.54106826", "text": "def cropping?\n !crop_x.blank? && !crop_y.blank? && !crop_w.blank? && !crop_h.blank?\n end", "title": "" }, { "docid": "4dfc65d4db577abc356e0e8f8368854f", "score": "0.5405828", "text": "def cropped_image(params, image_path)\n\t image = MiniMagick::Image.open(image_path)\n\t crop_params = \"#{params[:cord][:w]}x#{params[:cord][:h]}+#{params[:cord][:x]}+#{params[:cord][:y]}\"\n\t image.crop(crop_params)\n\t image\n\tend", "title": "" }, { "docid": "a40c972d8fc0b84aa9bec77969d85f6e", "score": "0.54012454", "text": "def crop?\n @crop\n end", "title": "" }, { "docid": "a40c972d8fc0b84aa9bec77969d85f6e", "score": "0.54012454", "text": "def crop?\n @crop\n end", "title": "" }, { "docid": "a40c972d8fc0b84aa9bec77969d85f6e", "score": "0.54012454", "text": "def crop?\n @crop\n end", "title": "" }, { "docid": "a40c972d8fc0b84aa9bec77969d85f6e", "score": "0.54012454", "text": "def crop?\n @crop\n end", "title": "" }, { "docid": "a40c972d8fc0b84aa9bec77969d85f6e", "score": "0.54012454", "text": "def crop?\n @crop\n end", "title": "" }, { "docid": "51ec23cf71c00e629115962dda00afe5", "score": "0.53873247", "text": "def cropping?\n !crop_x.blank? && !crop_y.blank? && !crop_w.blank? && !crop_h.blank? \n end", "title": "" }, { "docid": "4524a5480c6c920321063a9eb05db491", "score": "0.53773886", "text": "def crop_photo\n if !crop_x.blank? && !crop_y.blank? && !crop_w.blank? && !crop_h.blank?\n photo.reprocess!\n end\n end", "title": "" }, { "docid": "fc02cbfbf12a8fb54cbc84ca88510f20", "score": "0.5360707", "text": "def crop(width, height, x1, y1)\n if self.attachment_options[:storage] == :s3\n image = Magick::Image.read(self.public_filename)[0]\n elsif self.attachment_options[:storage] == :file_system\n image = Magick::Image.read(self.full_filename)[0]\n end\n \n thumbnail = self.thumbnails.first # NASTY: must fix\n ratio = self.width / 480.0 # max width of any thumbnail\n \n destination_width\t\t= (width * ratio).to_i\n destination_height\t= (height * ratio).to_i\n destination_x1\t\t\t= (x1 * ratio).to_i\n destination_y1\t\t\t= (y1 * ratio).to_i\n\n # image.crop \"#{destination_width}x#{destination_height}+#{destination_x1}+#{destination_y1}\"\n # image.write(self.full_filename(:cropped))\n # image.run_command \"mogrify -strip -quality #{self.quality} -type Grayscale #{self.full_filename(:cropped)}\" if self.grayscale\n # image.run_command \"convert -strip -quality #{self.quality} -resize 413x531! #{self.full_filename(:cropped)} #{self.full_filename(:cropped)}\" \n image.crop!(destination_x1, destination_y1, destination_width, destination_height)\n image.strip!\n image = image.quantize(256, Magick::GRAYColorspace) if self.grayscale\n image.change_geometry!(\"413x531!\") do |cols, rows, img|\n img.resize!(cols, rows)\n end\n \n if self.attachment_options[:storage] == :s3\n path = \"#{Rails.root}/tmp/#{self.full_filename(:cropped)}\"\n path = path.gsub('/' + path.split('/').last, '')\n FileUtils.mkdir_p path\n \n image.write(\"#{Rails.root}/tmp/#{self.full_filename(:cropped)}\") do\n self.quality = quality\n end\n \n AWS::S3::S3Object.store(self.full_filename(:cropped), open(\"#{Rails.root}/tmp/#{self.full_filename(:cropped)}\"), 'billedid', :access => :public_read)\n \n # remove final image in case it has already been generated\n File.delete(\"#{Rails.root}/tmp/#{self.full_filename(:final)}\") if exists?\n \n elsif self.attachment_options[:storage] == :file_system\n image.write(self.full_filename(:cropped)) do\n self.quality = quality\n end\n \n # save to force thumbnails to be updated\n # self.save\n\n # remove final image in case it has already been generated\n File.delete(self.full_filename(:final)) if exists?\n end\n end", "title": "" }, { "docid": "c26d87f99cfc648056005c3c7c82e003", "score": "0.53596133", "text": "def make()\n if @keep_size\n @source_file_options = [ \"-size\", \"#{@target_geometry.width.to_i}x#{@target_geometry.height.to_i}\", \"#{@bg_color}\" ]\n @convert_options = [ \"-gravity\", \"center\", \"-composite\" ]\n end\n\n tn = super\n if @watermark.is_a?(String)\n # There is a watermark, which is expected to be rooted in Rails.root.\n\n p = File.join(Rails.root, @watermark)\n if File.exist?(p)\n begin\n filename = [ \"#{@basename}_wm\", @format ? \".#{@format}\" : \"\" ].join\n dst = TempfileFactory.new.generate(filename)\n\n parameters = [ '-dissolve', @watermark_opacity.to_s, '-tile' ]\n parameters << ':watermark'\n parameters << ':source'\n parameters << ':dest'\n\n parameters = parameters.flatten.compact.join(\" \").strip.squeeze(\" \")\n\n success = composite(parameters, {\n :watermark => p,\n :source => tn.path,\n :dest => File.expand_path(dst.path)\n })\n rescue Cocaine::ExitStatusError => e\n raise Paperclip::Error, \"There was an error processing the thumbnail for #{@basename}\" if @whiny\n rescue Cocaine::CommandNotFoundError => e\n raise Paperclip::Errors::CommandNotFoundError.new(\"Could not run the `convert` command. Please install ImageMagick.\")\n end\n\n # The new return value is dst, and we can close tn\n\n tn.close\n tn = dst\n else\n Rails.logger.warn(\"Floopnail cannot find watermark file #{@watermark}\")\n end\n end\n\n tn\n end", "title": "" }, { "docid": "a25defd8800a971b5d36d27547db1651", "score": "0.5339808", "text": "def optimize_image(file,options={})\n check_options(options)\n puts \"THIS FILE IS EMPTY!!! #{file}\" and return if size(file).zero?\n success = false\n \n with_logging(file,options[:quiet]) do\n write_optimized_data(file)\n success = true\n end\n\n if success\n gif = /\\.gif$/\n `mv #{file} #{file.sub(gif,'.png')}` if file =~ gif\n end\n end", "title": "" }, { "docid": "03a967c48950c789d3a48147d9ecda04", "score": "0.53253603", "text": "def make\n src = @file\n dst = Tempfile.new([@basename, @format].compact.join(\".\"))\n dst.binmode\n img = Magick::Image.read(src.path).first\n \n dst << rounded_corners(img)\n\n dst\n end", "title": "" }, { "docid": "92d64420bef2d6ad859bc45630d23606", "score": "0.532169", "text": "def allow_image_cropping?\n settings[:crop] && picture &&\n picture.can_be_cropped_to?(\n settings[:size],\n settings[:upsample]\n ) && !!picture.image_file\n end", "title": "" }, { "docid": "bdc69a8bb0259368dca1025b15c9fca9", "score": "0.53099155", "text": "def manualcrop\n return unless model.cropping?\n img = MiniMagick::Image.open(model.avatar.url)\n manipulate! do |img|\n\n x = model.crop_x.to_s\n y = model.crop_y.to_s\n w = model.crop_w.to_s\n h = model.crop_h.to_s\n\n img.crop(w + 'x' + h + '+' + x + '+' + y)\n img\n end\n end", "title": "" }, { "docid": "89a51ca0383f4262333afc16b1837f48", "score": "0.53077734", "text": "def square_image_crop\n if self.crop_x.present? && self.crop_y.present? && self.crop_w.present? && self.crop_h.present?\n @image = MiniMagick::Image.open(self.image.url)\n @image.crop(\"#{self.crop_w}x#{self.crop_h}+#{self.crop_x}+#{self.crop_y}\")\n \n # remove black space around cropped image (if any)\n @image.set(\"page\", \"#{self.crop_w}x#{self.crop_h}+#{self.crop_x}+#{self.crop_y}\")\n \n self.square_image = @image\n end\n end", "title": "" }, { "docid": "f0d27327705c1958b11aaa9a1b77a716", "score": "0.5303539", "text": "def create_crest\n @layers = setup_layers(@names, @img_path)\n @layered_image = create_composite(@layers)\n @puzzle_image = puzzlize(@layered_image, @rows, @cols) if @puzzle == true\n\n # txt = Draw.new\n # draw.annotate(img, width, height, x, y, text) [ { additional parameters } ] -> self\n # @layered_image.annotate(txt, 0,0,0,0, @text){\n # self.gravity = Magick::CenterGravity\n # self.pointsize = 50\n # # txt.stroke = '#000000'\n # self.font_family = \"Arial\"\n # self.fill = '#000000'\n # self.font_weight = Magick::BoldWeight\n # self.translate(0, 0)\n # }\n\n # result = @layered_image.distort(Magick::ArcDistortion, [0]) do\n # self.define \"distort:viewport\", \"44x44+15+0\"\n # self.define \"distort:scale\", 2\n # self.define \"distort:size\", \"320x100\"\n # self.define \"distort:font\", \"Candice\"\n # self.define \"distort:xc\", \"lightblue\"\n # self.define \"distort:pointsize\", \"72\"\n # self.define \"distort:fill\", \"navy\"\n # self.define \"distort:annotate\", \"25+65\"\n # self.define \"distort:Arc\", \"120\"\n # self.define \"distort:trim\", \"+repage\"\n # self.define \"distort:bordercolor\", \"lightblue\"\n # self.define \"distort:border\", \"10\"\n # end\n\n # result.write(\"distored.png\")\n # return result\n\n if @tempfile\n @path = \"crests/new_test.png\"\n @tempfile.close\n @tempfile.unlink\n end\n\n if @puzzle_image\n if @tempfile\n picture = @puzzle_image\n picture.write(\"#{Rails.public_path}/#{@path}\")\n return @path\n else\n return @puzzle_image\n end\n else\n if @tempfile\n picture = @layered_image\n picture.write(\"#{Rails.public_path}/#{@path}\")\n return @path\n else\n return @layered_image\n end\n end\n end", "title": "" }, { "docid": "79612fc93dbae42678758be02bcd8714", "score": "0.52701575", "text": "def square_image_crop\n if self.crop_x.present? && self.crop_y.present? && self.crop_w.present? && self.crop_h.present?\n @image = MiniMagick::Image.open(self.image.url)\n # if image is too big, resize it before showing on crop page\n # this is to ensure that cropping isn't messed up by the crop selector not being in the right place\n @image.sample(((700/@image[:width].to_f) * 100).to_s + \"%\") if @image[:width] > 700\n @image.crop(\"#{self.crop_w}x#{self.crop_h}+#{self.crop_x}+#{self.crop_y}\")\n \n # get rid of extra black border space\n @image.set(\"page\", \"#{self.crop_w}x#{self.crop_h}+#{self.crop_x}+#{self.crop_y}\") \n \n self.square_image = @image\n end\n end", "title": "" }, { "docid": "4baf17550eb02264f9380f240092c53b", "score": "0.52692604", "text": "def crop!(opts=nil); crop_with_image_science!(opts ? set_crop_params(opts) : crop_params); end", "title": "" }, { "docid": "cbda2cb9fc701e2e944b93339834ad4e", "score": "0.5244573", "text": "def cropped_image(params, image_path)\n\t image = MiniMagick::Image.open(image_path)\n\t crop_params = \"#{params[:w]}x#{params[:h]}+#{params[:x]}+#{params[:y]}\"\n\t image.crop(crop_params)\n\t image\n\tend", "title": "" }, { "docid": "80cfafa8d8bd3661397fb64ce571d68d", "score": "0.52382374", "text": "def checkCoverFile(arr, file, tmpcover, finalcover, errorfile)\n\tif arr.include?(\"#{file}\")\n\t\tFileUtils.mv(tmpcover, finalcover)\n\t\tcovercheck = \"Found a new cover submitted\"\n\telsif !arr.include?(\"#{file}\") and File.file?(finalcover)\n\t\tcovercheck = \"Picking up existing cover\"\n\telse\n\t\tFile.open(errorfile, 'w') do |output|\n\t\t\toutput.puts \"There is no cover image for this title.\"\n\t\t\toutput.puts \"Place the cover image file in the submitted_images folder, then re-submit the manuscript for conversion.\"\n\t\t\toutput.puts \"Cover image must be named #{Metadata.frontcover}.\"\n\t\tend\n\t\tcovercheck = \"No cover found\"\n\tend\n\tcovercheck\nend", "title": "" }, { "docid": "6c987a1c3204d9a8239db6e09c196965", "score": "0.52227604", "text": "def valid_photo?\n @auto_crop || (!crop_x.blank? && !crop_y.blank? && !crop_w.blank? && !crop_h.blank?)\n end", "title": "" }, { "docid": "6ffb2100b3a8116163920bc541c11249", "score": "0.5208749", "text": "def mini_magick_crop(url, size)\n image = MiniMagick::Image.open(url)\n image.crop = \"#{size}x#{size}\"\n image.gravity = \"North\"\nend", "title": "" }, { "docid": "8ca54c9c256f58f80f135b3a2092e86b", "score": "0.5199891", "text": "def cover\n begin\n\n manipulate! do |frame, index|\n # frame if index.zero?\n frame if (index == 0)\n end\n\n rescue ::Magick::ImageMagickError => e\n raise CarrierWave::ProcessingError, I18n.translate(:\"errors.messages.rmagick_processing_error\", :e => e, :default => I18n.translate(:\"errors.messages.rmagick_processing_error\", :e => e, :locale => :en))\n\n end\n end", "title": "" }, { "docid": "3ee47eb15c5a222fe484c1c8f4a17f0c", "score": "0.5196308", "text": "def adjust_image filepath\n image = MiniMagick::Image.open filepath\n image.crop \"#{options[:w]}x#{options[:h]}+#{options[:x]}+#{options[:y]}\" if options[:h] && options[:w]\n image\n end", "title": "" }, { "docid": "c8fc738f7629981d15471b75ca58abc2", "score": "0.5178194", "text": "def precrop_done\n return if @name.blank? || !@updating_logo.blank?\n\n precrop_path = File.join(Avatar.images_tmp_path, @name)\n\n make_precrop(precrop_path,@crop_x.to_i,@crop_y.to_i,@crop_w.to_i,@crop_h.to_i)\n\n self.name = @name\n precropped = File.open(precrop_path)\n self.logo = precropped\n precropped.close\n\n FileUtils.remove_file(precrop_path)\n end", "title": "" }, { "docid": "501d2d4ca81f1928b540527fcc29beb9", "score": "0.5167656", "text": "def crop_image\n image.recreate_versions! if crop_x.present?\n end", "title": "" }, { "docid": "4ae8df0adfa7f3785fa9be8a16b8e747", "score": "0.51599044", "text": "def avatar? file_name\n file_name && File.exists?(File.join(source_dir, images_dir, file_name))\n end", "title": "" }, { "docid": "72972ffd83bf822086e5530708f31548", "score": "0.5155416", "text": "def crop_thumb\n begin\n image_path = thumb_path\n\n img = MiniMagick::Image.open(image_path)\n\n img.crop(\"#{params[:w]}x#{params[:h]}+#{params[:x]}+#{params[:y]}\")\n img.write image_path\n\n if @edited_photo.thumb.recreate_versions!\n flash[:notice] = t(\"photos.crop\", name: @edited_photo.name)\n @edited_photo.touch\n else\n flash[:error] = t(\"photos.not_crop\", name: @edited_photo.name)\n end\n #\n # when MiniMagick.open failed, continue action with only error message for user, this prevent redirect to 500 in this case\n #\n rescue Errno::ENOENT\n flash[:error] = t(\"photos.not_crop\", name: @edited_photo.name)\n logger.error exception_msg(image_path)\n end\n\n respond_to do |format|\n format.js {render :template => \"mokio/photos/crop_thumb\"}\n end\n end", "title": "" }, { "docid": "5bca8015cd00383e23d89c5e5feb2a2c", "score": "0.5150999", "text": "def pictured?; self.image_file_name.present? && self.image_file_size > 0; end", "title": "" }, { "docid": "f10c5d2fa11994acc05ebeead00cb85f", "score": "0.5145499", "text": "def is_crop?\r\n self.RELS_EXT.content.include? \"isCropOf\"\r\n end", "title": "" }, { "docid": "9850f2d0fa588d3322e6bed107128842", "score": "0.5124684", "text": "def valid?\n run_command(\"identify\", @path)\n true\n rescue MiniMagick::Invalid\n false\n end", "title": "" }, { "docid": "ed905d4b7a13a36cc0296a3d96978908", "score": "0.51032096", "text": "def filename_for_noise_image(c, suffix)\n\n # the default OSX file system is case preserving, meaning that you cannot have\n # both \"A.bitmap\" and \"a.bitmap\" at the same time. So we map lowercase letters to\n # a special name.\n #\n is_lower?(c) ? \"#{IMAGES_DIR}/noise/#{c}_lower.#{suffix}\" : \"#{IMAGES_DIR}/noise/#{c}.#{suffix}\"\n end", "title": "" }, { "docid": "515cfc930290e4ef2b4c1ae4d56ac426", "score": "0.5102124", "text": "def should_tileset_be_converted?(filename, tilesetname)\n return true unless RPG::Cache.tileset_exist?(filename)\n return false if PSDK_CONFIG.release?\n return true unless File.exist?(filename = \"graphics/tilesets/#{filename}.png\")\n return File.mtime(\"graphics/tilesets/#{tilesetname}.png\".downcase) >\n File.mtime(filename)\n end", "title": "" }, { "docid": "d20cb2d19224862bac411e4a4960e474", "score": "0.5076027", "text": "def add_side_texture(base_image, image_to_crop, crop_area, new_size, position)\n side = MiniMagick::Image.open image_to_crop.path\n side.resize \"#{WIDTH}x#{HEIGHT}!\"\n side.crop crop_area\n side.resize new_size\n\n base_image.composite(side) do |c|\n c.compose \"Multiply\"\n c.geometry position\n end\nend", "title": "" }, { "docid": "9326ff6a9e40f821299856f10cd3d069", "score": "0.5070243", "text": "def crop_images(test)\n # Load images\n test_image = Image.read(\"#{@path}/#{test}/test.png\").first\n production_image = Image.read(\"#{@path}/#{test}/production.png\").first\n\n # Let's not do anything if the images are already the same size\n return if test_image.rows == production_image.rows\n\n # Get max height of both images\n max_height = [test_image.rows, production_image.rows].max\n\n # Crop\n Workers.map([test_image, production_image]) do |image|\n image.extent(test.width, max_height).write(image.filename)\n end\n end", "title": "" }, { "docid": "38be68f78cb8c96c8765cd33982e9d4a", "score": "0.5063892", "text": "def main(args)\n options = {}\n parser = OptionParser.new do |opts|\n opts.banner = \"Usage: #{File.basename($0)} [options] file1.nrrd file2.nrrd ...\"\n opts.on(\"-t\", \"--type mosaic_type\", [:grid, :fluid], \"Choose type of mosaic to create ('grid' or 'fluid').\") {|t| options[:type] = t}\n opts.on(\"-p\", \"--prototype\", \"Data from prototype, reverse x-axis ('fluid' mode only).\") {|p| options[:prototype] = true}\n opts.on(\"-c\", \"--[no-]compress\", \"Compress each input file to a single-plane image.\") { |c| options[:compress] = c }\n opts.on(\"-s\", \"--[no-]scale\", \"Scale counts by number of planes in each input file.\") { |s| options[:scale_by_planes] = s }\n opts.on(\"-l\", \"--layout layout_filename\", \"Specify grid layout file.\",\n \" (A text file containg input nrrd filenames; columns tab-separated, rows newline-separated)\") { |f| options[:layout] = f }\n\n # DJ: 09/17/2014 : to reverse option\n opts.on(\"-r\", \"--reverse\", \"Reverse the tile rows ('fluid mode only')\") { |r| options[:reverse] = true}\n\n opts.on(\"-o\", \"--output output_filename\", \"Specify output nrrd file.\") { |f| options[:file_out] = f }\n opts.on_tail(\"-h\", \"--help\", \"Show this help message.\") {STDERR.puts opts; exit}\n end\n if args.empty?\n STDERR.puts parser\n exit\n end\n parser.parse!(args)\n options[:files] = args unless args.empty?\n options[:file_out] ||= \"mosaic.nrrd\"\n \n unless options[:type]\n options[:type] = :grid\n options[:type] = :fluid if options[:files]\n end\n \n if options[:compress].nil?\n options[:compress] = true\n end\n \n if options[:prototype].nil? || options[:type] == :grid\n options[:prototype] = false\n end \n\n ## DJ: 09/17/2014\n if options[:reverse].nil? || options[:type] == :grid\n options[:reverse] = false\n end \n \n options[:layout] ||= \"grid.txt\" if options[:type] == :grid\n\n mosaic(options)\nend", "title": "" }, { "docid": "52a3cbd9436f30ae0c029387ffbecc0c", "score": "0.50590605", "text": "def crop_requested?(params)\n params[:crop].present? and params[:crop] != '0'\n end", "title": "" }, { "docid": "b6c60fcba6f62ef0083ea0466b8bae66", "score": "0.5040925", "text": "def crop_photo\n begin\n image_path = \"#{Rails.root}/public#{@edited_photo.data_file.url}\"\n img = MiniMagick::Image.open(edited_photo_path(:normal))\n\n width = Mokio.photo_thumb_width\n height = Mokio.photo_thumb_height\n\n img.crop(\"#{params[:w]}x#{params[:h]}+#{params[:x]}+#{params[:y]}\")\n img.resize \"#{width}x#{height}\"\n img.write edited_photo_path(:thumb)\n\n flash[:notice] = t(\"photos.crop\", name: @edited_photo.name)\n\n @edited_photo.touch\n #\n # when MiniMagick.open failed, continue action with only error message for user, this prevent redirect to 500 in this case\n #\n rescue Errno::ENOENT\n flash[:error] = t(\"photos.not_crop\", name: @edited_photo.name)\n logger.error exception_msg(image_path)\n end\n respond_to do |format|\n format.js {render :template => \"mokio/photos/crop_photo\"}\n end\n end", "title": "" }, { "docid": "839641e13890b263a3f5a21a887bce9b", "score": "0.5040653", "text": "def uncropped\n render_image(format: requested_format, uncropped: true)\n end", "title": "" }, { "docid": "9160cf89d31266bc474e0d2ca5630fac", "score": "0.5039833", "text": "def test_crop_width_check\n output = tested('rms.jpg 1:2')\n correct = '/generated/rms-25-7ef50a4c1.jpg 25w, '\\\n '/generated/rms-45-7ef50a4c1.jpg 45w'\n\n assert_includes stderr, 'rms.jpg'\n assert_equal correct, output.at_css('img')['srcset']\n end", "title": "" }, { "docid": "b327f7ca5721de7bcdbd737fc37addc8", "score": "0.5033244", "text": "def crop\n if model.crop_x.present?\n real_w, real_h = ::MiniMagick::Image.open(model.picture.file.file)[:dimensions]\n manipulate! do |img|\n x = model.crop_x * real_w\n y = model.crop_y * real_h\n w = model.crop_w * real_w\n h = model.crop_h * real_h\n img.crop \"#{w.to_i}x#{h.to_i}+#{x.to_i}+#{y.to_i}\"\n img\n end\n end\n end", "title": "" }, { "docid": "c8fe556a405ecda6a42291cba54ceff8", "score": "0.4988931", "text": "def transmogrify(width, height = nil, name = nil, crop = false)\n download_original unless local?\n if local?\n name ||= \"#{width}x#{height}\"\n\n to_transform = Magick::Image.read(self.local_path_to_file).first\n \n if crop && width && height\n to_transform.crop_resized!(width.to_i, height.to_i, Magick::NorthGravity)\n else\n to_transform.change_geometry!(\"#{width}x#{height}\") do |cols, rows, img|\n if to_transform.columns >= cols\n img.resize!(cols, rows)\n end\n img\n end\n end\n \n file = file_parts\n new_path = \"#{file[:path]}/#{file[:root]}-#{name}.#{file[:extension]}\"\n to_transform.write new_path\n \n new_path\n end\n end", "title": "" }, { "docid": "1f5e6374840da59765b49904f4adb1d9", "score": "0.49782324", "text": "def crop\n return unless model.can_be_cropped?\n manipulate! do |image|\n crop_ratio = ratio(image[:width], model.thumbnail_coordinates.fetch('bounds'))\n coordinates = magick_thumbnail_coordinates(model.thumbnail_coordinates, crop_ratio)\n\n image.combine_options do |command|\n command.crop(coordinates)\n end\n image\n end\n end", "title": "" }, { "docid": "4c7538c26737f794e8bdd268df786efd", "score": "0.49780554", "text": "def has_cover?\n\t\tFile.exists? cover_filename\n\tend", "title": "" }, { "docid": "3db1cb4dc4a7646a27c8a7229fc3ecc7", "score": "0.49581814", "text": "def cover\n image=MiniMagick::Image.open(self.attachment.path)\n image.format(\"png\", 0)\n image.resize(\"x400\")\n\n dir = \"public/uploads/newspaper/attachment/#{self.id}\"\n Dir.mkdir(dir) unless File.exists?(dir)\n\n image.write(dir + \"/thumbnail.png\")\n end", "title": "" }, { "docid": "a39ccdf5e970d3c5694e3c460006f2fd", "score": "0.49539632", "text": "def crop(*args); end", "title": "" }, { "docid": "426f7511b3f8b08f36bcdd90059d04df", "score": "0.49492154", "text": "def copy_images_from_source_to_destination options\n source_folder = options.source\n destination_folder = options.destination\n check_for_duplicates = !options.no_check_duplicates\n dry_run = options.dry_run\n check_method = options.check_method\n\n # Check options\n unless source_folder\n @logger.error \"Missing argument: source\"\n exit 0\n end\n\n unless destination_folder\n @logger.error \"Missing argument: destination\"\n exit 0\n end\n\n unless check_method\n check_method = \"rmagick\"\n end\n\n # Check existing folders\n unless File.exists?(destination_folder)\n destination_path = Pathname.new(destination_folder)\n destination_folder = File.join(destination_path.parent, destination_path.basename.to_s.gsub(/\\W/, '_').upcase)\n\n unless File.exists?(destination_folder)\n FileUtils.mkdir destination_folder, verbose: true\n end\n end\n\n unless File.directory?(destination_folder)\n @logger.info \"#{destination_folder} isn't a directory\"\n exit 0\n end\n\n unless File.exists?(source_folder)\n @logger.info \"#{source_folder} doesn't exists\"\n exit 0\n end\n\n unless File.directory?(source_folder)\n @logger.info \"#{source_folder} isn't a directory\"\n exit 0\n end\n\n @logger.info \"Source folder is #{source_folder}\"\n @logger.info \"Destination folder is #{destination_folder}\"\n\n source_file = Pathname.new(source_folder)\n destination_file = Pathname.new(destination_folder)\n\n # Getting destination files and sort them by modified time and name\n destination_files = Dir.glob(File.join(destination_file.realpath, '*'))\n destination_files = destination_files.sort_by!{ |f| [File.mtime(f), File.basename(f)] }\n\n last_file = destination_files.last\n\n # Build a start index\n if last_file && File.exists?(last_file)\n last_file_basename = File.basename(last_file, File.extname(last_file))\n matches = last_file_basename.scan(/(\\d*)$/)\n index = matches.flatten.reject! { |c| c.empty? }.first.to_i\n else\n index = -1\n end\n\n @logger.info \"Last file path: #{File.basename(last_file)}\" if last_file && File.exist?(last_file)\n\n source_files = Dir.glob(File.join(source_file.realpath, '*'))\n source_files = source_files.sort_by{ |f| File.mtime(f) }\n ordered_source_files = []\n\n @logger.info \"Analyzing pictures and checking for duplicates...\" if source_files.any?\n\n files_in_dest = Dir.glob(File.join(destination_file.realpath, '*'))\n files_md5_in_dest = []\n\n for dest_file in files_in_dest\n dest_image_md5 = Digest::MD5.file(dest_file).to_s\n @logger.debug \"MD5 for file #{dest_file} is #{dest_image_md5}\"\n files_md5_in_dest << dest_image_md5\n end\n\n for f in source_files do\n file = Pathname.new(f)\n\n if file.directory?\n options.source = file.realpath.to_s\n options.destination = File.join(destination_file.realpath.to_s, file.basename.to_s)\n\n copy_images_from_source_to_destination options\n else\n if %w(.png .jpg .jpeg .gif .bmp).include?(file.extname.to_s.downcase)\n\n if check_for_duplicates\n image = Image.read(file.realpath).first\n image_time = DateTime.parse(image.properties['date:modify'])\n\n is_duplicate = false\n\n if files_in_dest.any?\n @logger.info \"Searching for duplicates for image #{file.realpath}\"\n\n image_md5 = Digest::MD5.file(file.realpath).to_s\n\n @logger.debug \"MD5 for source file #{file.realpath} is #{image_md5}\"\n @logger.debug \"MD5 for file #{file.realpath} is #{image_md5}\"\n\n for dest_file_md5 in files_md5_in_dest\n is_duplicate = image_md5.eql?(dest_file_md5)\n if is_duplicate\n @logger.info \"#{File.basename(f)} has a duplicate in the destination directory #{File.basename(dest_file)}\".cyan\n break\n end\n end\n end\n\n unless is_duplicate\n @logger.info \"#{File.basename(file)} has no duplicate, will copy it\".green\n ordered_source_files << [file, image_time]\n end\n\n image.destroy!\n end\n else\n @logger.error \"Cannot process #{File.basename(f)}: not an image\".red\n end\n end\n end\n\n if ordered_source_files.any?\n @logger.info \"Copying pictures to #{destination_file.realpath}\"\n\n for f_list in ordered_source_files.sort_by {|l| l.last}\n file = f_list.first\n time = f_list.last\n\n final_index = index + 1\n final_file_basename = \"#{destination_file.basename.to_s.gsub(/\\W/, '_').upcase}_#{time.strftime('%Y-%m-%d')}_#{final_index}#{file.extname}\"\n final_file_path = File.join(destination_file.realpath, final_file_basename)\n\n unless File.exists?(final_file_path)\n unless dry_run\n FileUtils.cp file.realpath, final_file_path, verbose: true, preserve: true\n File.utime(File.atime(final_file_path), time.to_time, final_file_path)\n else\n @logger.info \"Copy #{file.realpath} to #{final_file_path}\"\n end\n index = final_index\n else\n @logger.info \"File #{final_file_path} already exists. Aborting.\"\n break\n end\n end\n else\n @logger.info \"No files to copy to #{destination_file.realpath}\"\n end\nend", "title": "" }, { "docid": "d6d6d80add408f0254e7b5cfdc3c4fa0", "score": "0.49452758", "text": "def crop!(x, y, w, h)\n @txt = \"\"\n src = Magick::Image.read(@src.to_s).first\n src.crop!(x, y, w, h)\n @tmp = Pathname.new(Dir::tmpdir).join(\"#{@uid.generate}_#{@src.sub(@src.extname, \"-crop#{@src.extname}\").basename}\")\n src.write @tmp.to_s\n self\n end", "title": "" }, { "docid": "3a5baebae3c608113793b18b39fe13a9", "score": "0.494067", "text": "def resize(filename,thumb)\r\n pic = Magick::Image.read(filename).first\r\n if(pic != nil) \r\n # default sizes\r\n tmbw = 80\r\n minw = 80\r\n #minw = 200\r\n maxw = width = 400\r\n \r\n #image sizes\r\n picw = pic.columns\r\n pich = pic.rows \r\n \r\n if(thumb == true)\r\n width = tmbw\r\n else\r\n if( picw >= maxw )\r\n width = maxw\r\n else\r\n width = minw\r\n end\r\n end \r\n\r\n height = (pich.to_f / picw.to_f) * width\r\n pic.crop_resized!(width,height)\r\n pic.write(filename)\r\n \r\n end \r\n end", "title": "" }, { "docid": "8b68d32a23f4de1cd78d477fb2a7b89e", "score": "0.49345055", "text": "def crop_size?\n crop_width? && crop_height?\n end", "title": "" }, { "docid": "60d574792104f5821e2f9f9c4084dd04", "score": "0.49312177", "text": "def checkCoverFile(arr, file, tmpcover, finalcover, errorfile, coversize_check, logkey='')\n\tif arr.include?(\"#{file}\") && coversize_check == true\n\t\tFileUtils.mv(tmpcover, finalcover)\n\t\tcovercheck = \"Found a new cover submitted\"\n elsif arr.include?(\"#{file}\") && coversize_check != true\n FileUtils.mv(tmpcover, finalcover)\n File.open(errorfile, 'w') do |output|\n\t\t\toutput.puts coversize_check\n\t\tend\n covercheck = \"too-small cover submitted, auto-generated one instead, posted err-notice\"\n\telsif !arr.include?(\"#{file}\") and File.file?(finalcover)\n\t\tcovercheck = \"Picking up existing cover\"\n\telse\n\t\tFile.open(errorfile, 'w') do |output|\n\t\t\toutput.puts \"There is no cover image for this title.\"\n\t\t\toutput.puts \"Place the cover image file in the submitted_images folder, then re-submit the manuscript for conversion.\"\n\t\t\toutput.puts \"Cover image must be named '(isbn)_FC.jpg' (e.g., '9781234567890_FC.jpg').\"\n\t\tend\n\t\tcovercheck = \"No cover found\"\n\tend\n\treturn covercheck\nrescue => logstring\n\treturn ''\nensure\n\tMcmlln::Tools.logtoJson(@log_hash, logkey, logstring)\nend", "title": "" }, { "docid": "2290405fe5a93d0ddf5230c6290d17ba", "score": "0.49309817", "text": "def process\n if @options.any?\n @image.combine_options do |c|\n c.filter 'box'\n c.quality quality if @options[:quality]\n c.resize extent if @options[:resize]\n c.rotate rotate if @options[:rotate]\n c.strip if @options[:strip]\n if @options[:crop]\n c.extent dimensions\n c.gravity gravity\n end\n end\n end\n self\n end", "title": "" }, { "docid": "79aab864afee805cf48db44412724ce1", "score": "0.49308565", "text": "def upload_photo(photo, crop_width, crop_height, path_name)\n photo.rewind\n pic = Magick::Image.from_blob(photo.read)[0]\n width = pic.columns\n height = pic.rows\n if (width > height)\n pic.scale!((crop_width/width.to_f))\n else\n pic.scale!((crop_height/height.to_f))\n end\n# back = Magick::Image.new(crop_width,crop_height) {\n#\t\t\t self.background_color = 'white'\n#\t\t\t self.format = 'JPG'\n#\t\t }\n pic.composite!(pic, Magick::CenterGravity, Magick::InCompositeOp)\n File.open(RAILS_ROOT + path_name, \"wb\") do |f|\n\t\t\tf.write(pic.to_blob)\n end\n end", "title": "" }, { "docid": "87a0186d62c55e81e7cbff365347dc6d", "score": "0.492899", "text": "def image_reduce(file_name)\n if (quality = dc_get_site.params.dig('dc_image', 'quality').to_i) > 0\n convert = MiniMagick::Tool::Convert.new\n convert << file_name\n convert.quality(quality)\n convert << file_name\n convert.call\n end\nend", "title": "" }, { "docid": "4e4600ee0583587c5c79833c03fc94cd", "score": "0.49260563", "text": "def mask_crop_rectify\n if @map.save_mask(params[:output]) && @map.mask!\n params[:use_mask] = \"true\"\n rectify\n else\n render :json => { :errors => [{:title => \"Saving and masking error\", :detail => \"Error with saving and masking map\"}] },:status => :unprocessable_entity\n end\n end", "title": "" }, { "docid": "6ff6b6976da7e8c5e583ab291bc689eb", "score": "0.49249572", "text": "def split_image(filename, image, center, options)\n image_both = image #Magick::ImageList.new(input_file)\n half = center # image_both.columns / 2\n \n # allow the percentage of slop to be variable rather than hard-wired to 2%\n two_percent = image_both.columns * ( options[:fudge_factor] / 100 )\n# print \"lhs = image_both.crop(0, 0, #{half+two_percent}, #{image_both.rows})\\n\"\n lhs = image_both.crop(0, 0, half+two_percent, image_both.rows, true)\n \n ext = File.extname(filename)\n\n if options[:vertical]\n lhs.rotate(270).write(filename.sub(ext, \"_below#{ext}\")) \n else\n if options[:spine_side] == \"right\" || options[:spine_side] == \"center\"\n lhs.write(filename.sub(ext, \"_left#{ext}\")) \n end\n end\n\n\n start = half - two_percent\n width = image_both.columns - start\n# print \"rhs = image_both.crop(#{start}, 0, #{width}, #{image_both.rows})\\n\"\n rhs = image_both.crop(start, 0, width, image_both.rows, true)\n\n if options[:vertical]\n rhs.rotate(270).write(filename.sub(ext, \"_above#{ext}\")) \n else\n if options[:spine_side] == \"left\" || options[:spine_side] == \"center\"\n rhs.write(filename.sub(ext, \"_right#{ext}\")) \n end\n end\n\n GC.start\nend", "title": "" }, { "docid": "34f610e7d89c96145d986651b959ef56", "score": "0.49243373", "text": "def test_with_existing\n FileUtils.mkdir_p temp_dir('generated')\n widths.each { |w| FileUtils.touch rms_filename(width: w) }\n\n Vips::Image.any_instance.expects(:write_to_file).never\n\n tested\n end", "title": "" }, { "docid": "ef096d5d190d404a69cfb4959650cf72", "score": "0.4918757", "text": "def set_image_as_unique_cover\n return unless media_type == 'image'\n cover_file = MediaFile\n .where(attachable: self.attachable, cover: true)\n .where.not(id: id)\n\n if cover?\n cover_file.update_all(cover: false)\n elsif cover_file.blank?\n self.cover = true\n end\n end", "title": "" }, { "docid": "6d0bf86f61c3d762d8bce902c4d27d44", "score": "0.49172118", "text": "def cropping_geometry\n \"#{target.width}x#{target.height}+0+0\"\n end", "title": "" }, { "docid": "b58e3e31911c7b4da7c08032d461ba76", "score": "0.49171692", "text": "def should_process?(image_file, image_metadata)\n true\n end", "title": "" }, { "docid": "e1be25c7a9da3f15ea127f6be11749c2", "score": "0.49155256", "text": "def crop\n user_specified_options[:crop]\n end", "title": "" }, { "docid": "e69c020e690fdf34b74e76f6139e0681", "score": "0.49063972", "text": "def thumbnail!\n begin\n image = MiniMagick::Image.open(@file.path)\n image.resize(\"#{Pushfile.settings[:images][:thumb][:width]}x\")\n rescue\n @thumb = nil\n else\n t = @name.split('.'); ext = t.pop\n @thumb = t.join(\".\").concat(\"_thumb.#{ext}\")\n image.write(\"/tmp/#{@thumb}\") rescue @thumb = nil\n end\n end", "title": "" }, { "docid": "3a0874166191fd3b353b5f6e8a8de839", "score": "0.4903483", "text": "def image_process\n # Add _t suffix to filename for thumbnail filename\n @thumbnail = convert_image(\"130x130\")\n @thumbnail.save\n ::MediaRocket::AssociatedFile.create(:media => self, :file => @thumbnail)\n \n # Add _m suffix to filename for medium filename\n @medium = convert_image(\"850x550\")\n @medium.save\n ::MediaRocket::AssociatedFile.create(:media => self, :file => @medium)\n end", "title": "" }, { "docid": "fdbeb049a0c064b9c50fac3bd473ccc4", "score": "0.48990124", "text": "def crop\n end", "title": "" }, { "docid": "fdbeb049a0c064b9c50fac3bd473ccc4", "score": "0.48990124", "text": "def crop\n end", "title": "" }, { "docid": "fdbeb049a0c064b9c50fac3bd473ccc4", "score": "0.48990124", "text": "def crop\n end", "title": "" }, { "docid": "fdbeb049a0c064b9c50fac3bd473ccc4", "score": "0.48990124", "text": "def crop\n end", "title": "" }, { "docid": "85c4dfe7b1959782502ae78f1b603152", "score": "0.48990047", "text": "def is_minc_file_name? file_name\n return file_name.end_with? \".mnc\"\n end", "title": "" }, { "docid": "6fc1198271d642caad5a335aeac4ba4b", "score": "0.48948163", "text": "def test_default\n [@window, @sprite, @bitmap].each{|container|\n c = CResizableImage.new(container, Rect.new(0, 0, 24, 24), BITMAP, ICON_RECT)\n c.draw()\n }\n return true\n end", "title": "" }, { "docid": "620942fd223dbd8021543b3a2f0a7395", "score": "0.48887274", "text": "def reprocess_pre_crop\n return nil if avatar_missing?\n old_files = {}\n avatar.styles.keys.each do |style|\n old_files[style] = avatar.path(style)\n end\n avatar.reprocess!(:pre_crop)\n avatar.styles.keys.each do |style|\n next if style == :pre_crop\n FileUtils.move(old_files[style], avatar.path(style))\n end\n end", "title": "" }, { "docid": "399edea98b71a45b99c1f176ebd844ec", "score": "0.48803863", "text": "def make\n file = super\n\n if @watermark_path\n params = \"-gravity #{@watermark_position}\"\n\n if offset = @watermark_offset\n params << \" -geometry +#{offset[:x]}+#{offset[:y]}\"\n end\n\n params << \" #{@watermark_path} #{file.path} #{file.path}\"\n\n Paperclip.run('composite', params)\n end\n\n file\n end", "title": "" }, { "docid": "fbf1e9e2223b9208cb6d515dbc0bc159", "score": "0.4878437", "text": "def test_create_without_rmagick\n $APPLICATION_SETTINGS.preferences[:rmagick] = false\n file = \"#{RAILS_ROOT}/test/fixtures/images/rails.png\"\n temp_file = uploaded_jpeg(file)\n Asset.skip_thumbnails\n assert_difference Asset, :count do\n post :edit, :asset=>{:description=>\"I made this asset on #{Time.now.to_s}\", :category_id=>@category_with_asset, :user_id=>@user.id, :uploaded_data=>temp_file}\n assert assigns(:asset)\n assert_equal 0, assigns(:asset).thumbnails.size\n end\n \n $APPLICATION_SETTINGS.preferences[:rmagick] = true # Rollback\n end", "title": "" }, { "docid": "e7b6df2b33dea7bfa7274937049cdc7c", "score": "0.48753121", "text": "def image?; File.exists? path_image end", "title": "" }, { "docid": "a72b2dd546ca973eec79105f03e3298a", "score": "0.48751765", "text": "def prepare_conver_img\n if @local_images.length > 0\n image_file = @local_images.first\n @cover_image = \"#{File.dirname(image_file)}/cover-image.jpg\"\n cmd = \"convert #{Shellwords.escape(image_file)} -compose over -background white -flatten -resize '566x738' -alpha off #{Shellwords.escape(@cover_image)}\"\n `#{cmd}` rescue ''\n end\n end", "title": "" }, { "docid": "ff977193d02cac3b39f34a8f7b6e3805", "score": "0.4874371", "text": "def crop_media_image\n\t\tif params[:cord].values.reject(&:blank?).count == params[:cord].values.count\n\t\t\tparams[:case_media_attachment][:attachment] = cropped_image(params, @case_media_attachment.attachment.case_image.path)\n\t\tend\t\n\tend", "title": "" }, { "docid": "523c37e20b7194c140f7e59fe2778e6a", "score": "0.4873337", "text": "def update_mask\n # Resize the original down to the large size\n # Apply any masks\n resize( 'original', self.filename, 'large', PHOTO_SIZES['large'] )\n\n # Resize the large size down to the other sizes\n PHOTO_SIZES.each do |type,size|\n if type == 'large'\n # Do nothing\n elsif type == 'square'\n resize( 'large', self.filename, type, size, true )\n else\n resize( 'large', self.filename, type, size )\n end\n end\n\n # Move these images from processing to pending\n PHOTO_SIZES.each do |type, size|\n FileUtils.move( sys_filename(\"processing\", filename, type), sys_filename(\"processed\", filename, type) )\n end\n if self.status == 'available'\n # This should basically only happen if someone still had a file\n # assigned as to them for moderating when someone else marked\n # it as safe and it went out. For now we'll allow this and\n # will recopy the files, we might want to stop this from \n # happening by stopping the mask from being added in the\n # first place.\n copy_files\n end\n end", "title": "" }, { "docid": "afeabcae06f5e44a2119f2fae176e4dc", "score": "0.4872859", "text": "def create\n \n # Make the directory (if doesn't already exist)\n FileUtils.mkdir_p File.dirname(path)\n \n cmd = []\n cmd << path_to_clipper.to_s\n \n # We need to escape the spaces in the parent.file.paths\n # Otherwise clipper will shit itself on files which have spaces in their names. \n # (or clipper will consider the parts of the filename as arguments)\n cmd << escape_path(parent.file.path)\n \n # The path to the output file\n cmd << \"-o #{path}\"\n \n # The size of the preview to create\n # Note that the size/dimensions of the file isn't guranteed\n # eg: if the file is 400x400px you're going to get a 400x400 preview\n #\n cmd << \"-s 800 \"\n cmd = cmd.join(' ')\n \n result = `#{cmd}`\n \n \n \n # if clipper failed to return a preview\n # we make a note that it failed\n \n Rails.logger.info \"Shell result from clipper #{result}\"\n \n # Mark that we now have a preview\n self.parent.update_attributes :preview_created_at => Time.now\n \n end", "title": "" }, { "docid": "00b1c5a9e9260f030b049d4cec8c443f", "score": "0.48643002", "text": "def cropped_thumbnail(width, height)\n puts width\n rmagick {|rm| rm.resize_to_fill(width, height)}\n #self.image_science(:cropped_thumbnail, width) # TODO: non-square thumbnails\n end", "title": "" }, { "docid": "6b2d156bc6ba6fd03b474ac8ffcaf025", "score": "0.48625806", "text": "def waldoize(photo_id,size)\r\n amount = config['colorize_percentage']\r\n file = Magick::Image.read(\"#{config['thumb']}/#{photo_id}.jpg\").first\r\n mosaic = Magick::Image.new(file.columns * size, file.rows * size)\r\n \r\n file.rows.times {|y|\r\n file.columns.times {|x|\r\n pixel_color = file.pixel_color(x,y)\r\n color = Pixel.as_int(pixel_color)\r\n match = find_closest_photo(photos, color)\r\n # Load the matching 75x75 version of the photo\r\n thumb = Magick::Image.read(\"#{config['cache']}/#{match.external_id}.jpg\").first\r\n # Delete the thumbnail from the list once it has been used\r\n delete_from_photos(match)\r\n # Convert it to gray\r\n gray = thumb.quantize(256, Magick::GRAYColorspace)\r\n # Colorize the gray version to match the current pixel color\r\n colorized = gray.colorize(amount, amount, amount, '#' + to_hex(pixel_color.red, pixel_color.green, pixel_color.blue))\r\n # Add the colorized version of the photo to the final image\r\n colorized.rows.times {|ty|\r\n colorized.columns.times {|tx|\r\n mosaic.pixel_color((x*size) + tx, (y*size) + ty, Magick::Pixel.new(colorized.pixel_color(tx,ty).red, colorized.pixel_color(tx,ty).green, colorized.pixel_color(tx,ty).blue, 0))\r\n }\r\n }\r\n }\r\n }\r\n mosaic.write(\"waldo_#{photo_id}.jpg\")\r\n end", "title": "" }, { "docid": "b5fc3f753daf2f942867691f8836ecac", "score": "0.48622152", "text": "def get_single_image(file, new_image_base_name)\n if File.basename(file).split('.').count > 2\n name_array = File.basename(file).split('.')\n name_array.pop\n image_file_name = name_array*'.'\n image_file_name =~ /#{new_image_base_name}[0-9][0-9][0-9][0-9]/\n else\n File.basename(file).split('.').first =~ /#{new_image_base_name}[0-9][0-9][0-9][0-9]/\n end\n end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "688da4d47872ea5536653f58bab5ad12", "score": "0.0", "text": "def set_line_item\n @line_item = LineItem.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook; end", "title": "" }, { "docid": "b8b36fc1cfde36f9053fe0ab68d70e5b", "score": "0.5946146", "text": "def run_actions; end", "title": "" }, { "docid": "3e521dbc644eda8f6b2574409e10a4f8", "score": "0.591683", "text": "def define_action_hook; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "bfb8386ef5554bfa3a1c00fa4e20652f", "score": "0.58349305", "text": "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", "title": "" }, { "docid": "6c8e66d9523b9fed19975542132c6ee4", "score": "0.5776858", "text": "def add_actions; end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703237", "text": "def callbacks; end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703237", "text": "def callbacks; end", "title": "" }, { "docid": "6ce8a8e8407572b4509bb78db9bf8450", "score": "0.5652805", "text": "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "title": "" }, { "docid": "1964d48e8493eb37800b3353d25c0e57", "score": "0.5621621", "text": "def define_action_helpers; end", "title": "" }, { "docid": "5df9f7ffd2cb4f23dd74aada87ad1882", "score": "0.54210985", "text": "def post_setup\n end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.53794575", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.5357573", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "0464870c8688619d6c104d733d355b3b", "score": "0.53402257", "text": "def define_action_helpers?; end", "title": "" }, { "docid": "0e7bdc54b0742aba847fd259af1e9f9e", "score": "0.53394014", "text": "def set_actions\n actions :all\n end", "title": "" }, { "docid": "5510330550e34a3fd68b7cee18da9524", "score": "0.53321576", "text": "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", "title": "" }, { "docid": "97c8901edfddc990da95704a065e87bc", "score": "0.53124547", "text": "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", "title": "" }, { "docid": "4f9a284723e2531f7d19898d6a6aa20c", "score": "0.529654", "text": "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", "title": "" }, { "docid": "83684438c0a4d20b6ddd4560c7683115", "score": "0.5296262", "text": "def before_actions(*logic)\n self.before_actions = logic\n end", "title": "" }, { "docid": "210e0392ceaad5fc0892f1335af7564b", "score": "0.52952296", "text": "def setup_handler\n end", "title": "" }, { "docid": "a997ba805d12c5e7f7c4c286441fee18", "score": "0.52600986", "text": "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "1d50ec65c5bee536273da9d756a78d0d", "score": "0.52442724", "text": "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", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "635288ac8dd59f85def0b1984cdafba0", "score": "0.5232394", "text": "def workflow\n end", "title": "" }, { "docid": "e34cc2a25e8f735ccb7ed8361091c83e", "score": "0.523231", "text": "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", "title": "" }, { "docid": "78b21be2632f285b0d40b87a65b9df8c", "score": "0.5227454", "text": "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.52226824", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "923ee705f0e7572feb2c1dd3c154b97c", "score": "0.52201617", "text": "def process_action(...)\n send_action(...)\n end", "title": "" }, { "docid": "b89a3908eaa7712bb5706478192b624d", "score": "0.5212327", "text": "def before_dispatch(env); end", "title": "" }, { "docid": "7115b468ae54de462141d62fc06b4190", "score": "0.52079266", "text": "def after_actions(*logic)\n self.after_actions = logic\n end", "title": "" }, { "docid": "d89a3e408ab56bf20bfff96c63a238dc", "score": "0.52050185", "text": "def setup\n # override and do something appropriate\n end", "title": "" }, { "docid": "62c402f0ea2e892a10469bb6e077fbf2", "score": "0.51754695", "text": "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", "title": "" }, { "docid": "72ccb38e1bbd86cef2e17d9d64211e64", "score": "0.51726824", "text": "def setup(_context)\n end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "1fd817f354d6cb0ff1886ca0a2b6cce4", "score": "0.5166172", "text": "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "title": "" }, { "docid": "5531df39ee7d732600af111cf1606a35", "score": "0.5159343", "text": "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", "title": "" }, { "docid": "bb6aed740c15c11ca82f4980fe5a796a", "score": "0.51578903", "text": "def determine_valid_action\n\n end", "title": "" }, { "docid": "b38f9d83c26fd04e46fe2c961022ff86", "score": "0.51522785", "text": "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", "title": "" }, { "docid": "199fce4d90958e1396e72d961cdcd90b", "score": "0.5152022", "text": "def startcompany(action)\n @done = true\n action.setup\n end", "title": "" }, { "docid": "994d9fe4eb9e2fc503d45c919547a327", "score": "0.51518047", "text": "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", "title": "" }, { "docid": "62fabe9dfa2ec2ff729b5a619afefcf0", "score": "0.51456624", "text": "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", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.51398855", "text": "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", "title": "" }, { "docid": "adb8115fce9b2b4cb9efc508a11e5990", "score": "0.5133759", "text": "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "title": "" }, { "docid": "e1dd18cf24d77434ec98d1e282420c84", "score": "0.5112076", "text": "def setup(&block)\n define_method(:setup, &block)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5111866", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5111866", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "f54964387b0ee805dbd5ad5c9a699016", "score": "0.5106169", "text": "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", "title": "" }, { "docid": "35b302dd857a031b95bc0072e3daa707", "score": "0.509231", "text": "def config(action, *args); end", "title": "" }, { "docid": "bc3cd61fa2e274f322b0b20e1a73acf8", "score": "0.50873137", "text": "def setup\n @setup_proc.call(self) if @setup_proc\n end", "title": "" }, { "docid": "5c3cfcbb42097019c3ecd200acaf9e50", "score": "0.5081088", "text": "def before_action \n end", "title": "" }, { "docid": "246840a409eb28800dc32d6f24cb1c5e", "score": "0.508059", "text": "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", "title": "" }, { "docid": "dfbcf4e73466003f1d1275cdf58a926a", "score": "0.50677156", "text": "def action\n end", "title": "" }, { "docid": "36eb407a529f3fc2d8a54b5e7e9f3e50", "score": "0.50562143", "text": "def matt_custom_action_begin(label); end", "title": "" }, { "docid": "b6c9787acd00c1b97aeb6e797a363364", "score": "0.5050554", "text": "def setup\n # override this if needed\n end", "title": "" }, { "docid": "9fc229b5b48edba9a4842a503057d89a", "score": "0.50474834", "text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "title": "" }, { "docid": "9fc229b5b48edba9a4842a503057d89a", "score": "0.50474834", "text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "title": "" }, { "docid": "fd421350722a26f18a7aae4f5aa1fc59", "score": "0.5036181", "text": "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", "title": "" }, { "docid": "d02030204e482cbe2a63268b94400e71", "score": "0.5026331", "text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "title": "" }, { "docid": "4224d3231c27bf31ffc4ed81839f8315", "score": "0.5022976", "text": "def after(action)\n invoke_callbacks *options_for(action).after\n end", "title": "" }, { "docid": "24506e3666fd6ff7c432e2c2c778d8d1", "score": "0.5015441", "text": "def pre_task\n end", "title": "" }, { "docid": "0c16dc5c1875787dacf8dc3c0f871c53", "score": "0.50121695", "text": "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "title": "" }, { "docid": "c99a12c5761b742ccb9c51c0e99ca58a", "score": "0.5000944", "text": "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", "title": "" }, { "docid": "0cff1d3b3041b56ce3773d6a8d6113f2", "score": "0.5000019", "text": "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "title": "" }, { "docid": "791f958815c2b2ac16a8ca749a7a822e", "score": "0.4996878", "text": "def setup_signals; end", "title": "" }, { "docid": "6e44984b54e36973a8d7530d51a17b90", "score": "0.4989888", "text": "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", "title": "" }, { "docid": "6e44984b54e36973a8d7530d51a17b90", "score": "0.4989888", "text": "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", "title": "" }, { "docid": "5aa51b20183964c6b6f46d150b0ddd79", "score": "0.49864885", "text": "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", "title": "" }, { "docid": "7647b99591d6d687d05b46dc027fbf23", "score": "0.49797225", "text": "def initialize(*args)\n super\n @action = :set\nend", "title": "" }, { "docid": "67e7767ce756766f7c807b9eaa85b98a", "score": "0.49785787", "text": "def after_set_callback; end", "title": "" }, { "docid": "2a2b0a113a73bf29d5eeeda0443796ec", "score": "0.4976161", "text": "def setup\n #implement in subclass;\n end", "title": "" }, { "docid": "63e628f34f3ff34de8679fb7307c171c", "score": "0.49683493", "text": "def lookup_action; end", "title": "" }, { "docid": "a5294693c12090c7b374cfa0cabbcf95", "score": "0.4965126", "text": "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "title": "" }, { "docid": "57dbfad5e2a0e32466bd9eb0836da323", "score": "0.4958034", "text": "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", "title": "" }, { "docid": "5b6d613e86d3d68152f7fa047d38dabb", "score": "0.49559742", "text": "def release_actions; end", "title": "" }, { "docid": "4aceccac5b1bcf7d22c049693b05f81c", "score": "0.4954353", "text": "def around_hooks; end", "title": "" }, { "docid": "2318410efffb4fe5fcb97970a8700618", "score": "0.49535993", "text": "def save_action; end", "title": "" }, { "docid": "64e0f1bb6561b13b482a3cc8c532cc37", "score": "0.4952725", "text": "def setup(easy)\n super\n easy.customrequest = @verb\n end", "title": "" }, { "docid": "fbd0db2e787e754fdc383687a476d7ec", "score": "0.49467874", "text": "def action_target()\n \n end", "title": "" }, { "docid": "b280d59db403306d7c0f575abb19a50f", "score": "0.49423352", "text": "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "title": "" }, { "docid": "9f7547d93941fc2fcc7608fdf0911643", "score": "0.49325448", "text": "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", "title": "" }, { "docid": "da88436fe6470a2da723e0a1b09a0e80", "score": "0.49282882", "text": "def before_setup\n # do nothing by default\n end", "title": "" }, { "docid": "17ffe00a5b6f44f2f2ce5623ac3a28cd", "score": "0.49269363", "text": "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "title": "" }, { "docid": "21d75f9f5765eb3eb36fcd6dc6dc2ec3", "score": "0.49269104", "text": "def default_action; end", "title": "" }, { "docid": "3ba85f3cb794f951b05d5907f91bd8ad", "score": "0.49252945", "text": "def setup(&blk)\n @setup_block = blk\n end", "title": "" }, { "docid": "80834fa3e08bdd7312fbc13c80f89d43", "score": "0.4923091", "text": "def callback_phase\n super\n end", "title": "" }, { "docid": "f1da8d654daa2cd41cb51abc7ee7898f", "score": "0.49194667", "text": "def advice\n end", "title": "" }, { "docid": "99a608ac5478592e9163d99652038e13", "score": "0.49174926", "text": "def _handle_action_missing(*args); end", "title": "" }, { "docid": "9e264985e628b89f1f39d574fdd7b881", "score": "0.49173003", "text": "def duas1(action)\n action.call\n action.call\nend", "title": "" }, { "docid": "399ad686f5f38385ff4783b91259dbd7", "score": "0.49171105", "text": "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "title": "" }, { "docid": "0dccebcb0ecbb1c4dcbdddd4fb11bd8a", "score": "0.4915879", "text": "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "title": "" }, { "docid": "6e0842ade69d031131bf72e9d2a8c389", "score": "0.49155936", "text": "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", "title": "" } ]
051109e0d0a34a14b90042a3b404e3fb
GET /yanluns/new GET /yanluns/new.json
[ { "docid": "fb38fdb9cf256f9b702293e8aeeaf964", "score": "0.779794", "text": "def new\n @yanlun = Yanlun.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @yanlun }\n end\n end", "title": "" } ]
[ { "docid": "ceee4ba6910af2cfdd5af07ef2195c12", "score": "0.7791142", "text": "def new\n @lt = Lt.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lt }\n end\n end", "title": "" }, { "docid": "d89d88dcb488b2acf0e3af27a9893512", "score": "0.7503759", "text": "def new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: ''}\n end\n end", "title": "" }, { "docid": "d498b830ddd0600000369b9e81f2becc", "score": "0.7361734", "text": "def new\n @tt = Tt.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tt }\n end\n end", "title": "" }, { "docid": "853c0146377220e7ce22957d18f97417", "score": "0.735682", "text": "def new\n @lend = Lend.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lend }\n end\n end", "title": "" }, { "docid": "232a02c8834c30e8e1f8d04eb6690a74", "score": "0.73472375", "text": "def new\n @lop = Lop.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @lop }\n end\n end", "title": "" }, { "docid": "8e720517b2be41bb86455b0fe7aef14c", "score": "0.73467857", "text": "def new\n @unite = Unite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @unite }\n end\n end", "title": "" }, { "docid": "17d7da60333d97967bcd96628c11fd45", "score": "0.732993", "text": "def new\n json_404\n end", "title": "" }, { "docid": "d2cd63d14e53690a6bce286a428806cf", "score": "0.7294673", "text": "def new\n @lei = Lei.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lei }\n end\n end", "title": "" }, { "docid": "31c8c5a421b4dbecf26238b1bf18fb49", "score": "0.72868687", "text": "def new\n @newse = Newse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newse }\n end\n end", "title": "" }, { "docid": "af8c157a4caf7309d363ce11e867168b", "score": "0.72756445", "text": "def create\n @yanlun = Yanlun.new(params[:yanlun])\n\n respond_to do |format|\n if @yanlun.save\n format.html { redirect_to @yanlun, notice: 'Yanlun was successfully created.' }\n format.json { render json: @yanlun, status: :created, location: @yanlun }\n else\n format.html { render action: \"new\" }\n format.json { render json: @yanlun.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bdefcae1cec841161a2377f72e605801", "score": "0.7263612", "text": "def new\n @server = Server.new\n @creating_new = true\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @server }\n\n end\n end", "title": "" }, { "docid": "43fbaf2fe70e8ec49e52119640f2d9b4", "score": "0.72558534", "text": "def new\n @lure = Lure.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lure }\n end\n end", "title": "" }, { "docid": "28734c9960aeb580d816e80f0188bd23", "score": "0.7247373", "text": "def new\n @lessee = Lessee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lessee }\n end\n end", "title": "" }, { "docid": "f610197fb7f8c7e0fae1e061a2f0a128", "score": "0.72407085", "text": "def new\n @nail = Nail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nail }\n end\n end", "title": "" }, { "docid": "88a8ea21b1898eef6e0d6500509f357e", "score": "0.72049373", "text": "def new\n @truong = Truong.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @truong }\n end\n end", "title": "" }, { "docid": "0b85412dc8ddf53a6ce4acb1e8b567a8", "score": "0.71996725", "text": "def new\n @livre = Livre.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @livre }\n end\n end", "title": "" }, { "docid": "1fe7a0eb754b891d211533173d6ae2a7", "score": "0.7193072", "text": "def new\n\t\n\t\t\n\t\trender json: {}\n\tend", "title": "" }, { "docid": "943a059d717dfd47510db0a4c0da7b16", "score": "0.7192078", "text": "def new\n @livraison = Livraison.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @livraison }\n end\n end", "title": "" }, { "docid": "6b2a9b215a360a4bda31ea1f021caee0", "score": "0.71887296", "text": "def new\n @yeti = Yeti.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json # new.json.erb\n end\n end", "title": "" }, { "docid": "7dbac0b090063eb55edfcea3c1632755", "score": "0.71831775", "text": "def new\n @nlp = Nlp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nlp }\n end\n end", "title": "" }, { "docid": "a239b2ca7f399f6da9a6467ae7ec8b30", "score": "0.7181367", "text": "def new\n @l_tweet = LTweet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @l_tweet }\n end\n end", "title": "" }, { "docid": "b5d81c4dceffb2971bbc67f40b7272fb", "score": "0.71809554", "text": "def new\n @lipid = Lipid.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lipid }\n end\n end", "title": "" }, { "docid": "e1bc9a5c7d5dc36da2fd873d88e65d1f", "score": "0.7173508", "text": "def new\n\tputs \"new\"\n @resource = Resource.new\n\n respond_to do |format|\n format.json { render json: @resource }\n#\t format.html { render html: @resources }\n end\n end", "title": "" }, { "docid": "5e786d13de8596fe72b157939cf1ffdf", "score": "0.7158349", "text": "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", "title": "" }, { "docid": "5e786d13de8596fe72b157939cf1ffdf", "score": "0.7158349", "text": "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", "title": "" }, { "docid": "5e786d13de8596fe72b157939cf1ffdf", "score": "0.7158349", "text": "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", "title": "" }, { "docid": "ac197b5f5298cde93fcc1a687674f783", "score": "0.7157891", "text": "def new\n @vinyl = Vinyl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vinyl }\n end\n end", "title": "" }, { "docid": "41dd5229908dce28526085b83eef60d6", "score": "0.71571803", "text": "def new\n @taluk = Taluk.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @taluk }\n end\n end", "title": "" }, { "docid": "fbb221e0dac1e7043946860433ac438e", "score": "0.7149663", "text": "def new\n @exist = Exist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @exist }\n end\n end", "title": "" }, { "docid": "01413e7c7b994ce87d8c82736383b85e", "score": "0.71493745", "text": "def new\n @tale = Tale.new\n\n @title = 'add new tale'\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tale }\n end\n end", "title": "" }, { "docid": "1bcda0ac884e0c4fbf5142aca8040dc0", "score": "0.7143645", "text": "def new\n @noun = Noun.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @noun }\n end\n end", "title": "" }, { "docid": "7a1190f62fb618719c3db52da9c85676", "score": "0.7137228", "text": "def new\n @lunch = Lunch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lunch }\n end\n end", "title": "" }, { "docid": "1386ddd7648aea6d30c4cd9e9eb90d53", "score": "0.71270555", "text": "def new\n @tum = Ta.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tum }\n end\n end", "title": "" }, { "docid": "8ad62f1387001cb8f91bb994c89e5279", "score": "0.7124629", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bleat }\n end\n end", "title": "" }, { "docid": "bc9df93e250e934e13bdba64d97ac052", "score": "0.7118752", "text": "def new\n @trailhead = Trailhead.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trailhead }\n end\n end", "title": "" }, { "docid": "e3b55158037b2e0ce90ea024db2eaffd", "score": "0.7117876", "text": "def new\n @l_class = LClass.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @l_class }\n end\n end", "title": "" }, { "docid": "b7030d2814ff20ad98506c9aae956761", "score": "0.71178615", "text": "def new\n @lancamento = Lancamento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lancamento }\n end\n end", "title": "" }, { "docid": "b14e7636969d6a4e299d05eeca7b151a", "score": "0.7105279", "text": "def new(options) \n Client.get(\"/lovers/new\", :query => options)\n end", "title": "" }, { "docid": "c6eaceb78d2bc94e0e60a773ac8aa21f", "score": "0.7102723", "text": "def new\n @trail = Trail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trail }\n end\n end", "title": "" }, { "docid": "92a056a81e289297f835d5e7b2a20e2e", "score": "0.709901", "text": "def new\n @new_table = NewTable.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @new_table }\n end\n end", "title": "" }, { "docid": "c4e6af69a24c7095d0e5a80aa5f25bf6", "score": "0.7095475", "text": "def new\n @getting_there = GettingThere.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @getting_there }\n end\n end", "title": "" }, { "docid": "5dd7a39619aeaab677f1f47bc9253fc7", "score": "0.7086908", "text": "def new\n @leftover = Leftover.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @leftover }\n end\n end", "title": "" }, { "docid": "c59a611ebcb96515a83031dfe64dcf16", "score": "0.7078762", "text": "def new\n @alrt = Alrt.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @alrt }\n end\n end", "title": "" }, { "docid": "c59a611ebcb96515a83031dfe64dcf16", "score": "0.7078762", "text": "def new\n @alrt = Alrt.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @alrt }\n end\n end", "title": "" }, { "docid": "0f80690615e6e8a928371ac015fb9397", "score": "0.7074399", "text": "def new\n @modello = Modello.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @modello }\n end\n end", "title": "" }, { "docid": "44295962ff94c3c9e0096c57ec2b3176", "score": "0.7071234", "text": "def new\n @punt = Punt.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @punt }\n end\n end", "title": "" }, { "docid": "242b424fac081fb46446344ac9f13ed7", "score": "0.7060242", "text": "def new\n @koan = Koan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @koan }\n end\n end", "title": "" }, { "docid": "c9d1386c5ece3daf4222c779bf9d71c4", "score": "0.70580345", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6f54ff36ca548d56cc3956f3be3d19e9", "score": "0.70576334", "text": "def new\n @talisman = Talisman.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @talisman }\n end\n end", "title": "" }, { "docid": "04ef733446c56bad1f988ca974a142fd", "score": "0.7056893", "text": "def new\n @tak = Tak.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tak }\n end\n end", "title": "" }, { "docid": "b6c00328c603b6f67c82ceb0ca824da1", "score": "0.70548046", "text": "def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end", "title": "" }, { "docid": "b6c00328c603b6f67c82ceb0ca824da1", "score": "0.70548046", "text": "def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end", "title": "" }, { "docid": "b6c00328c603b6f67c82ceb0ca824da1", "score": "0.70548046", "text": "def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end", "title": "" }, { "docid": "b6c00328c603b6f67c82ceb0ca824da1", "score": "0.70548046", "text": "def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end", "title": "" }, { "docid": "b6c00328c603b6f67c82ceb0ca824da1", "score": "0.70548046", "text": "def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end", "title": "" }, { "docid": "b6c00328c603b6f67c82ceb0ca824da1", "score": "0.70548046", "text": "def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end", "title": "" }, { "docid": "b6c00328c603b6f67c82ceb0ca824da1", "score": "0.70548046", "text": "def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end", "title": "" }, { "docid": "b6c00328c603b6f67c82ceb0ca824da1", "score": "0.70548046", "text": "def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end", "title": "" }, { "docid": "b6c00328c603b6f67c82ceb0ca824da1", "score": "0.70548046", "text": "def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end", "title": "" }, { "docid": "b6c00328c603b6f67c82ceb0ca824da1", "score": "0.70548046", "text": "def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end", "title": "" }, { "docid": "8f46a13f9b800a783088ae0bdf3a549f", "score": "0.70524734", "text": "def new\n @lounge = Lounge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lounge }\n end\n end", "title": "" }, { "docid": "0867ce805ccf15b08de9624a783943ae", "score": "0.70480895", "text": "def new\n @gotra = Gotra.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gotra }\n end\n end", "title": "" }, { "docid": "75e0f3f9b25e543932187e4377f692c1", "score": "0.7044713", "text": "def new\n @newtest = Newtest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @newtest }\n end\n end", "title": "" }, { "docid": "a0bd9b1442a87f24e40c1059af3e36cd", "score": "0.704459", "text": "def new\n @tuyen = Tuyen.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tuyen }\n end\n end", "title": "" }, { "docid": "a0bd9b1442a87f24e40c1059af3e36cd", "score": "0.704459", "text": "def new\n @tuyen = Tuyen.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tuyen }\n end\n end", "title": "" }, { "docid": "c21db5d35a5603900327c83f0fe89bcb", "score": "0.7041847", "text": "def new\n @lack = Lack.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lack }\n end\n end", "title": "" }, { "docid": "362449509be890cd31081209a6b5373a", "score": "0.70412266", "text": "def new\n @lbbb = Lbbb.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lbbb }\n end\n end", "title": "" }, { "docid": "3bedefd39149d43f8f614f2f37cba52e", "score": "0.7037944", "text": "def new\n @lemur = Lemur.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lemur }\n end\n end", "title": "" }, { "docid": "a3948f03afc7321dd164eb236cae2ed4", "score": "0.7031353", "text": "def new\n @hailwtfornot = Hailwtfornot.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @hailwtfornot }\n end\n end", "title": "" }, { "docid": "a813b54b685bbabbfa18a74dcf2ffce8", "score": "0.70289123", "text": "def new\n @verb = Verb.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @verb }\n end\n end", "title": "" }, { "docid": "a813b54b685bbabbfa18a74dcf2ffce8", "score": "0.70289123", "text": "def new\n @verb = Verb.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @verb }\n end\n end", "title": "" }, { "docid": "2b541d02cf6f9c1cd736662470a44d0c", "score": "0.7025887", "text": "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", "title": "" }, { "docid": "88d20da5600bdfe4f1b63aa62dfc6242", "score": "0.7025351", "text": "def new\n @tine = Tine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tine }\n end\n end", "title": "" }, { "docid": "c81b4d28292d3716d1d174c3d5cbd100", "score": "0.7019369", "text": "def new\n @tattoo = Tattoo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tattoo }\n end\n end", "title": "" }, { "docid": "8d4243e92f0a79df5dced1bcb0799e95", "score": "0.7017961", "text": "def new\n @on_loan = OnLoan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @on_loan }\n end\n end", "title": "" }, { "docid": "930d44ec8cd26b176811f258f26b5ec9", "score": "0.70159185", "text": "def new\n @objeto = Objeto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @objeto }\n end\n end", "title": "" }, { "docid": "637b8f7a569948696e9ba99f438d4464", "score": "0.701283", "text": "def new\n @level = Level.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @level }\n end\n end", "title": "" }, { "docid": "a7782d8d13fa9bdeee9fe741a1cb9ea1", "score": "0.70122087", "text": "def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @request }\n end\n end", "title": "" }, { "docid": "418912bb7d0ea9eac7e1b03b9b51de2d", "score": "0.70110255", "text": "def new\n @root = \"projects\"\n @branch = \"new\"\n \n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "dee3cd099388d50bc7f04f691f9100b4", "score": "0.7009915", "text": "def new\n @lugare = Lugare.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lugare }\n end\n end", "title": "" }, { "docid": "8125285cb0acf9169a633ab4f7608096", "score": "0.70092696", "text": "def new\n @plant = Plant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @plant }\n end\n end", "title": "" }, { "docid": "12fc25e6f6f8a41193a02b6fc1120029", "score": "0.7006355", "text": "def new\n @lop_mon_hoc_sinh_vien = LopMonHocSinhVien.new\n\n respond_to do |format| \n format.json { render json: @lop_mon_hoc_sinh_vien }\n end\n end", "title": "" }, { "docid": "15c8f3becdc5760a716f14d5206faf01", "score": "0.70058596", "text": "def new\n @traction = Traction.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @traction }\n end\n end", "title": "" }, { "docid": "9292c136b88a6c77cd362cfa73dc3994", "score": "0.7004452", "text": "def new\n @leaveroll = Leaveroll.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @leaveroll }\n end\n end", "title": "" }, { "docid": "cb8e7193c9b9ccdedd2a27ff8333be16", "score": "0.7003433", "text": "def new\n @poet = Poet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @poet }\n end\n end", "title": "" }, { "docid": "d2b1ea95d9b3ea67c3997ab11367f7c8", "score": "0.7001098", "text": "def new\n @tuanti = Tuanti.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tuanti }\n end\n end", "title": "" }, { "docid": "8a7c165e9037275c6985a24c82e44c60", "score": "0.6999597", "text": "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", "title": "" }, { "docid": "8a7c165e9037275c6985a24c82e44c60", "score": "0.6999597", "text": "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", "title": "" }, { "docid": "73528548cef201c2865bdcf30be44c81", "score": "0.69979095", "text": "def new\n @lote = Lote.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lote }\n end\n end", "title": "" }, { "docid": "70764b1d7907cd4413a787947eb6dd28", "score": "0.69976366", "text": "def new\n @ulcer = Ulcer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ulcer }\n end\n end", "title": "" }, { "docid": "175ddbacc4e84ceaeee0581bfa14b139", "score": "0.699754", "text": "def new\n @gotel = Gotel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gotel }\n end\n end", "title": "" }, { "docid": "b6185802b5d21a6c0340e6164026b7c9", "score": "0.6996483", "text": "def new\n @homer = Homer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @homer }\n end\n end", "title": "" }, { "docid": "249e434533f24b63179ba056bf3dd0be", "score": "0.6988058", "text": "def new\n @statu = Statu.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @statu }\n end\n end", "title": "" }, { "docid": "2a4976481fc13323f968d2703105fb9f", "score": "0.69866544", "text": "def new\n @lenguage = Lenguage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lenguage }\n end\n end", "title": "" }, { "docid": "7b689672fb051affca32a268fdcb4736", "score": "0.6986375", "text": "def new\n\tuuid = SecureRandom.uuid\n\t@new_url = searches_url + \"/\" + uuid # creates http://localhost/search/123-34552-adsfrjha-234\n\tresponse.set_header(\"Location\", @new_url)\n respond_to do |format|\n format.html { render :new, status: 201 }\n format.json { render :new, status: 201 }\n format.jsonld { render :new, formats: :json, status: 201 }\n end\n\t\n end", "title": "" }, { "docid": "151c5bd9094bebca9662720294d25440", "score": "0.69863063", "text": "def new\n @when = When.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @when }\n end\n end", "title": "" }, { "docid": "3cfe3840fab4ab605307f6f1db60397f", "score": "0.6984269", "text": "def new\n @req = Req.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @req }\n end\n end", "title": "" }, { "docid": "a7836ee22c3b16a1719787907bdeb30c", "score": "0.69776547", "text": "def new\n @ngay = Ngay.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ngay }\n end\n end", "title": "" }, { "docid": "cb5cd9c32243151a20b6a1788be2293c", "score": "0.6975174", "text": "def new\n @new_project = NewProject.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @new_project }\n end\n end", "title": "" }, { "docid": "52739aa8d701b66ca305169ac31c3a56", "score": "0.697509", "text": "def new\n @town = Town.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @town }\n end\n end", "title": "" } ]
248c23bf76d80930d1dc3dcef875e633
The start date of the month
[ { "docid": "aa42e7936fb422ac2d6c1ef19e70735a", "score": "0.7673062", "text": "def start_of_month(year, month_param)\n merch_month = get_merch_month_param(month_param)\n date_calc.start_of_month(year, merch_month)\n end", "title": "" } ]
[ { "docid": "b07bde1e3cb22fcd744e0fe905e416aa", "score": "0.89462245", "text": "def start_date\n weekday = beginning_of_month.cwday\n offset = weekday == 1 ? 0 : (weekday - 1).days\n beginning_of_month - offset\n end", "title": "" }, { "docid": "ed26bac1ef298eae2dc5ee561f7ee8ae", "score": "0.8930244", "text": "def start_of_month\n Date.new(self.strftime('%Y').to_i, self.strftime('%m').to_i, 1)\n end", "title": "" }, { "docid": "57e1c10df871f555bb4371d4fedc6082", "score": "0.87547517", "text": "def start_date\n\t\tDate.new( @year, @month, 1 )\n\tend", "title": "" }, { "docid": "41feeb7c78c00eedd956b935df7cc641", "score": "0.87099624", "text": "def start_of_month\n @start_of_month ||= date_calc.start_of_month(year, merch_month)\n end", "title": "" }, { "docid": "4c9f08854439eca24a14d6c73fd8dcbd", "score": "0.831993", "text": "def start_date\n\t\treturn Date.new(y=year, m=START_MONTH, d=START_DAY)\n\tend", "title": "" }, { "docid": "df010d87f46dedd8f1e47540878fdcf1", "score": "0.8027386", "text": "def beginning_of_month\n first_hour(change(day: 1))\n end", "title": "" }, { "docid": "a810a4ef8f96978d2c6d05caa6856ccb", "score": "0.79525584", "text": "def change_to_beginning_of_month\n @month.to_date.beginning_of_month\n end", "title": "" }, { "docid": "0bf7975859472a5a92d0b7bf7a0cc031", "score": "0.7856823", "text": "def beginning_of_year\n change(month: 1).beginning_of_month\n end", "title": "" }, { "docid": "e74ff4f93fbf2a92edb096c438e741cc", "score": "0.7799738", "text": "def start_date\n params[:start_date] ? params[:start_date].to_datetime : DateTime.now.beginning_of_month\n end", "title": "" }, { "docid": "add77e36279b199b0bb295c0ef8da42a", "score": "0.7768904", "text": "def month\n @month || self.starts_at.month\n end", "title": "" }, { "docid": "fc83657e81f359b3bd708388a77ac4aa", "score": "0.776368", "text": "def start_of_month(year, month)\n begin\n # will raise exception if params are missing or invalid\n start_date = Date.new(year, month)\n raise ArgumentError if start_date < min_date\n raise ArgumentError if start_date > max_date\n start_date\n rescue\n default_start_date\n end\n end", "title": "" }, { "docid": "f05916df05c7e537ba512113e2fdae95", "score": "0.7733281", "text": "def check_start_date\n self.start_date = Date.current.beginning_of_month.next_month if start_date.nil?\n end", "title": "" }, { "docid": "89cc9f81d3d98d7387208db7dccb1216", "score": "0.77043504", "text": "def start_date\n return start\n end", "title": "" }, { "docid": "20800c56ddd720698770a8e9671437d9", "score": "0.77027506", "text": "def beginning_of_month\n #self - ((self.mday-1).days + self.seconds_since_midnight)\n change(:day => 1,:hour => 0, :min => 0, :sec => 0, :usec => 0)\n end", "title": "" }, { "docid": "0890b68ada9ecafec9bdb0f222e836a3", "score": "0.7701028", "text": "def current_period_start_date\n Date.new(Date.today.year, Date.today.month, current_day_start_date)\n end", "title": "" }, { "docid": "d9bdcfb0dfbfd8cd2e0a6821e5937cc5", "score": "0.7699316", "text": "def first_of_month\n Date.new(self.year, self.month)\n end", "title": "" }, { "docid": "0376d6df3f9f3a8449b67e9d67096147", "score": "0.7698326", "text": "def day_of_month\n start_on.day.to_s\n end", "title": "" }, { "docid": "9549c8c951b5310579dbb6b3197471a0", "score": "0.76795685", "text": "def beginning_of_month\n self.class.new year, month, 1\n end", "title": "" }, { "docid": "f935a597c986fdf02f299714eb492653", "score": "0.7624086", "text": "def start_date\n date\n end", "title": "" }, { "docid": "c124153709d76ae500326d2b44267666", "score": "0.75912863", "text": "def first_of_month\n @first_of_month ||= Date.new(@year, @month)\n end", "title": "" }, { "docid": "5eebcadeb76f0269fd9aa1e84ba14f03", "score": "0.7548062", "text": "def month\n start_on.strftime(MONTH_NAME)\n end", "title": "" }, { "docid": "74699ede4226d620135e26365554b96b", "score": "0.7461989", "text": "def calculate_start_date\n if !@end_date.blank? && @data_amount > 0\n @start_date = @end_date - (@data_amount-1).month\n @start_date.end_of_month\n end\n end", "title": "" }, { "docid": "4c5f8f8160146495f169bd8d079a3433", "score": "0.7433673", "text": "def get_start_date\n date = Time.new\n year = date.year\n month = date.month < 10 ? \"0\" + date.month.to_s : date.month\n day = date.day < 10 ? \"0\" + date.day.to_s : date.day\n start_date = \"#{year-2}-#{month}-#{day}\"\n start_date\nend", "title": "" }, { "docid": "40717f1fa401c78bb2dedb7d28c27320", "score": "0.7393965", "text": "def beginning_of_month\n ZDate.new(ZDate.format_date(year_str, month_str))\n end", "title": "" }, { "docid": "f70da4c076e62d8c94c80335a78cace2", "score": "0.7349378", "text": "def dt_start\n @current_date.clone if @current_date\n end", "title": "" }, { "docid": "e7b58b6efadb07b03d38d467b5ef87ad", "score": "0.7300473", "text": "def month\n start_date&.strftime('%b %Y')\n end", "title": "" }, { "docid": "2939e2453e8c0e88dc97ef314cf0b8d3", "score": "0.72782373", "text": "def start_of_week\n @start_of_week ||= (start_of_month + (7 * (week - 1)))\n end", "title": "" }, { "docid": "39db47d910b3f994cf56031f5b1e4c43", "score": "0.7270381", "text": "def first_day_of_month(date_time=Time.now)\n date_time.beginning_of_month\n end", "title": "" }, { "docid": "9b54eda3c89f42792f37b3368eece21b", "score": "0.7262823", "text": "def start_at\n today = Time.now\n Time.new(today.year, today.month, today.day, 9,0,0)\n end", "title": "" }, { "docid": "0f006281ab647b5518e068e8a0af5d3b", "score": "0.71926624", "text": "def start_date\n @start_date ||= Date.today - Date.today.wday - 7 * 52\nend", "title": "" }, { "docid": "e7ca679e1a4eb895db949e9ffde1217c", "score": "0.71887845", "text": "def initial_date\n self.start_date.strftime('%m-%d-%Y')\n end", "title": "" }, { "docid": "9b1ba517b42eda6ddc9c375dc537e89b", "score": "0.7108598", "text": "def m_first_day\n return MhcDate .new(@y, @m, 1)\n end", "title": "" }, { "docid": "ca66f12c0c23fd7965ef5ef4601c6f8e", "score": "0.70641786", "text": "def start_date_date(date_if_blank = false)\n return make_date(start_date_year,start_date_month,start_date_day,date_if_blank)\n end", "title": "" }, { "docid": "c7e701c2417cc3465dc4d0acb309e7e7", "score": "0.70552593", "text": "def history_start\n start_dt = case QaServer.config.historical_datatable_default_time_period\n when :month\n history_end_dt - 1.month\n when :year\n history_end_dt - 1.year\n else\n @parent.first_updated_dt\n end\n QaServer::TimeService.pretty_date(start_dt)\n end", "title": "" }, { "docid": "58a84fae4eb298dbdbac8c0d850771be", "score": "0.6967327", "text": "def start_date\n @start_date = Date.strptime(date_range_to_dates.first, \"%m/%d/%Y\")\n end", "title": "" }, { "docid": "f42d726d11a9509b897d366a85d92e73", "score": "0.69645983", "text": "def start_of_time\n Date.jd(0).strftime(\"%Y-%m-%d\")\n end", "title": "" }, { "docid": "b2448b48e6582b842ebec7285cd23cd2", "score": "0.6936115", "text": "def start_date\n created_at.monday - 1.week - 1.day\n end", "title": "" }, { "docid": "ea0ef6be58604b981ed846f982469c95", "score": "0.693221", "text": "def first_day\n @first_day ||= months.first.first_day\n end", "title": "" }, { "docid": "42a16717189ef3b89b10011ec8b506f1", "score": "0.6929458", "text": "def subscription_start_date\n # if (_subscribed_at = subscription_started_at)\n # # * if the subscription already started, no point calulating again\n # _subscribed_at\n # else\n # * if no subscription started yet, consider this month\n _date = Date.today\n if _date.day == 1\n _date.to_date # if today is 1st, why wait? start the subscription from today\n else\n (_date + 1.month).beginning_of_month.to_date # .to_date # today is not 1st, let this month be pro-rated\n end\n end", "title": "" }, { "docid": "4756cd01497dddacd7eedc161d44e4ad", "score": "0.6910818", "text": "def start_datetime\n d = date\n t = start_time || Time.new.midnight\n DateTime.new(d.year, d.month, d.day, t.hour, t.min, t.sec)\n end", "title": "" }, { "docid": "20476665aee07ea2f11c21eabfe3ea90", "score": "0.69025046", "text": "def month() end", "title": "" }, { "docid": "8773ecbd445d958e45a22e4b76b68c3f", "score": "0.6860259", "text": "def start_of_quarter\n \n year = self.strftime('%Y').to_i\n current_month = self.strftime('%m').to_i\n \n month = 1\n 1.step(13, 3) do |m|\n break if m > current_month\n month = m\n end\n \n Date.new(year, month, 1)\n \n end", "title": "" }, { "docid": "9bf363dfc192f56305e4ebe64afd5817", "score": "0.6853792", "text": "def start_date\n\t \tTime.at(self.start_time) rescue nil\n\t end", "title": "" }, { "docid": "28eb0d0b881f584aca8bfc5a1eb7beda", "score": "0.6838868", "text": "def start_date\n Time.parse(@start_date) if @start_date\n end", "title": "" }, { "docid": "86749f68e2d9e7c16a1f57b3feb35eb1", "score": "0.68096143", "text": "def start\n\tself[:date_start].strftime(\"%d.%m.%Y\") || '-'\n end", "title": "" }, { "docid": "14d9a7552678648b93b7af831c737c19", "score": "0.68075895", "text": "def fiscal_year_start_date\n Date.today.month < 7 ? \"07/01/#{Date.today.year - 1}\" : \"07/01/#{Date.today.year}\"\n end", "title": "" }, { "docid": "fde2debc12cec03fdf18e91d1a2234fb", "score": "0.6793536", "text": "def immersive_start_date\n @p0_start_date + 63\n end", "title": "" }, { "docid": "a96fe5dd05bb678822eef175c6ed8601", "score": "0.6791876", "text": "def get_start_date(page)\n page.css(WebScraper::JOB_DETAILS_SELECTOR)[WebScraper::JOB_START_DATE_POS].content.strip\n end", "title": "" }, { "docid": "50d73be4f0b5c8ebb18d64ce1fd3e4cd", "score": "0.6777306", "text": "def start\n starts_at.strftime(\"%R\")\n end", "title": "" }, { "docid": "eff1bed00381757684b0bd5f35530d8e", "score": "0.67768186", "text": "def start_date\n @start_date ||= respond_to?(:parliamentPeriodStartDate) ? DateTime.parse(parliamentPeriodStartDate) : nil\n end", "title": "" }, { "docid": "2468cd44942fcb09d6afb7969baafa5b", "score": "0.67701834", "text": "def start_of_year\n @start_of_year ||= year_start_date\n end", "title": "" }, { "docid": "1b340f35af553e5713725cea42f15083", "score": "0.67637235", "text": "def first_day\n @first_day ||= Date.new(year_number, month_number, 1)\n end", "title": "" }, { "docid": "fae061edb53ca4d1a1fee3d2e9c3928a", "score": "0.67519486", "text": "def to_start_of_day\n return Time.mktime(year, month, day, 0, 0, 0, 0)\n end", "title": "" }, { "docid": "a08ddc7b4e4392093de3d069f8be4c70", "score": "0.6750219", "text": "def f_start_date\n\t\tself.expected_start_date.strftime(\"%d / %m / %Y\")\n\tend", "title": "" }, { "docid": "3259c3413b1b8fd2cf7db66817d6ee78", "score": "0.6728657", "text": "def getStartDate\r\n\t\t\t\t\treturn startDate\r\n\t\t\t\tend", "title": "" }, { "docid": "566fd161748698ce1e9730bd9bb32ab1", "score": "0.67229897", "text": "def min_start_date\n Date.today + MIN_PPOST_DAYS.days\n end", "title": "" }, { "docid": "7b3076dea4426dfef69f0cfdaecec5b9", "score": "0.6715009", "text": "def date()\n\t\t(@start_date.to_time + (10**9)).to_date\n\tend", "title": "" }, { "docid": "558ce40da6476f65531e55e6c80a4e43", "score": "0.67083454", "text": "def start_date_of_roll_period(year, month)\n # todo, to be truly accurate with respect to the description, this should figure out the date of the Tuesday prior to the settlement date, but I think subtracting one day is the real intention.\n vix_futures_settlement_date(year, month) - 1\n # prior_cboe_business_day(vix_futures_settlement_date(year, month))\nend", "title": "" }, { "docid": "526c68aa74bec87110348934f4608b7b", "score": "0.6702952", "text": "def start_date\n @raw.first.date\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.66854197", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.66854197", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.66854197", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.66854197", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.66854197", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.66854197", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.66854197", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.66854197", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.66854197", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.66854197", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "d7d426602011527945f85b9702afa221", "score": "0.6682419", "text": "def fmwday\n beginning_of_month.wday\n end", "title": "" }, { "docid": "7bfe666937ae5fe3ae2082f9fda4f353", "score": "0.6677875", "text": "def month\n @year = params[:year].to_i\n @month = params[:month].to_i\n @first_day = @event.first_day_of_month(@year, @month)\n @last_day_of_month = Date.new(@year, @month, 1).end_of_month\n end", "title": "" }, { "docid": "6f512cf46c451f1d515695d4b9750c4b", "score": "0.66771257", "text": "def month; end", "title": "" }, { "docid": "6f512cf46c451f1d515695d4b9750c4b", "score": "0.66771257", "text": "def month; end", "title": "" }, { "docid": "d01ee772e0a0c95472c8abf1c66abc26", "score": "0.66674894", "text": "def first_working_day_of_the_month\n beginning_of_month.upto(ending_of_month).find(&:working_day?)\n end", "title": "" }, { "docid": "03ef5fc4b4c761a25dc5175a08fb8d7c", "score": "0.6649657", "text": "def beginning_of_year\n change(:month => 1,:day => 1,:hour => 0, :min => 0, :sec => 0, :usec => 0)\n end", "title": "" }, { "docid": "a3322b981a8283d592d3430974867cbf", "score": "0.6647575", "text": "def start_date_date=(date)\n self[:start_date_day] = date.day\n self[:start_date_month] = date.month\n self[:start_date_year] = date.year\n end", "title": "" }, { "docid": "58cbdd3039708d57aab83d9b5fa36c5f", "score": "0.6643113", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "074f0b183de261d32992f8224d91b7a7", "score": "0.6616796", "text": "def start_date\n read_attribute(:start_date).nil? ? nil : read_attribute(:start_date).to_date\n end", "title": "" }, { "docid": "6c0c9820f7a96903b28b1b6a47247e5e", "score": "0.65815383", "text": "def format_start_date()\n\t\tif Date.valid_date?(self.year, self.month, self.day)\n\t\t\treturn self.month.to_s + '/' + self.day.to_s\n\t\telse\n\t\t\traise \"Invalid start date specified.\"\n\t\tend\n\tend", "title": "" }, { "docid": "612a0cb5790b094091c67c6d5ab52d49", "score": "0.6578916", "text": "def start_time\n Date.today\n end", "title": "" }, { "docid": "1bb2e52980818ef8b193ce4a6e56405d", "score": "0.65719545", "text": "def start_time\n self.day\n end", "title": "" }, { "docid": "c3bdd9766e6e5c0efc33423d7ff40de3", "score": "0.6565359", "text": "def start_of_planning_year\n start_of_fiscal_year current_planning_year_year\n end", "title": "" }, { "docid": "cd16605240a0872104e0cff5d1a6ba3f", "score": "0.6562266", "text": "def start\n startDate\n end", "title": "" }, { "docid": "adc5238d40567d9c78b1aab72e2f6e17", "score": "0.6552609", "text": "def this_month_dates\n {\n init_date: Date.today.beginning_of_month.to_s,\n end_date: Date.today.end_of_month.to_s\n }\n end", "title": "" }, { "docid": "7abeebc0ef9503a83f44b3a6e69fcc7d", "score": "0.654344", "text": "def period_start\n period.begin\n end", "title": "" }, { "docid": "10c2ebf17ca23dbd67ee158cc144451f", "score": "0.6539722", "text": "def post_brew_start_date\n (Time.now.in_time_zone('Asia/Kolkata') + (Brew::POST_BREW_MIN_NUM_DAYS_OUT).days).to_date\n end", "title": "" }, { "docid": "31f6a0194740ee546f3a90bf2b6fbe27", "score": "0.65393484", "text": "def first_calendar_day\n @date.beginning_of_month.beginning_of_week(:sunday)\n end", "title": "" }, { "docid": "2934e94fb07e81db72281f44fa58ecc5", "score": "0.65261793", "text": "def find_next_date_for_monthly start\n if month_end || (start.month == 2 && month_day > 28) || month_day > 30\n next_date = start.end_of_month\n else\n next_date = Date.new(start.year, start.month, month_day)\n end\n return next_date if next_date <= end_date\n #next_date = next_date + 1.month\n #next_date = next_date.end_of_month if month_end\n nil\n end", "title": "" }, { "docid": "f4d0ec087dd013ad57f27f5006fc7705", "score": "0.6518803", "text": "def start_time\n start_at.strftime(\"%F\") if start_at\n end", "title": "" }, { "docid": "4b8b70edf72fb1f2c9d4f50871669fa7", "score": "0.6514225", "text": "def getStartDateFormat\r\n\t\t\t\t\treturn @startDateFormat\r\n\t\t\t\tend", "title": "" }, { "docid": "a7fbbf246b53f99b85c1cd4c2a064fd8", "score": "0.6509289", "text": "def beginning_date\n Date.new(@number, 1, 1).tuesday? ? Date.new(@number, 1, 2) : Date.new(@number, 1, 1)\n end", "title": "" }, { "docid": "7c35e44a4f77f58b87ce9d7de91fc04f", "score": "0.6508967", "text": "def start_date\n (Time.parse(@start_date).in_time_zone(@timezone).to_datetime if @start_date) || Date.today\n end", "title": "" }, { "docid": "cf90bce74f4452041f93d1910cf47cfa", "score": "0.65026164", "text": "def show\n @month = @event.start\n end", "title": "" }, { "docid": "51057f30d5fc5933875e3a973584e622", "score": "0.64960414", "text": "def this_month\n day(Time.now)\n end", "title": "" }, { "docid": "117a9ed7c37a7666cee46e072eef8dee", "score": "0.64925224", "text": "def date\n Date.civil(year, month, 1)\n end", "title": "" }, { "docid": "590997ac9e743c84a27b397725e5271a", "score": "0.64894176", "text": "def start_date\n return begins if support_deal.nil?\n self.begins ||= support_deal.start_date\n return support_deal.start_date > begins ? support_deal.start_date : begins\n end", "title": "" }, { "docid": "d015a2de356c6816a08d6fb459d35951", "score": "0.64877933", "text": "def month\n months = %w{January February March April May June July August September October November December}\n months[Time.now.month - 1]\n end", "title": "" }, { "docid": "4dd57f5b0c24ae6755e02881a9d274fe", "score": "0.6485307", "text": "def start_date\n @start_date ||= respond_to?(:constituencyGroupStartDate) ? DateTime.parse(constituencyGroupStartDate) : nil\n end", "title": "" }, { "docid": "54d4e60c5cc6a887aa93587cbe114095", "score": "0.64782536", "text": "def start_date_icalendar\n\t\treturn start_date.utc.strftime(\"%Y%m%dT%H%M%S\")\n\tend", "title": "" }, { "docid": "6ae2e9a4d9ebd07128a15fb0934c3305", "score": "0.6473043", "text": "def start_today_at\n today = Time.zone.today\n Time.zone.local(today.strftime('%Y'), today.strftime('%m'),\n today.strftime('%d'), start_at.strftime('%H'),\n start_at.strftime('%M'))\n end", "title": "" } ]
62944f62837c2e4813b8571601daaeb2
DELETE /cultural_heritage/transfers/1 DELETE /cultural_heritage/transfers/1.xml
[ { "docid": "06f1db31d54c31986bf67e1d4c104bf0", "score": "0.0", "text": "def destroy\n if (user_signed_in? && ([4].include?(current_user.role)))\n @title_view = 'Traslados'\n @cultural_heritage_transfer = CulturalHeritage::Transfer.find(params[:id])\n @cultural_heritage_transfer.destroy\n\n respond_to do |format|\n format.html { redirect_to(cultural_heritage_transfers_url) }\n format.xml { head :ok }\n end\n else\n respond_to do |format|\n format.html { redirect_to(new_user_session_path) }\n end\n end\n end", "title": "" } ]
[ { "docid": "b97f68aafee6ebbb2070c3fac8251880", "score": "0.6774147", "text": "def destroy\n @transfer.destroy\n end", "title": "" }, { "docid": "e1d6f603cb5ea1e475ea71422432aeae", "score": "0.64989793", "text": "def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end", "title": "" }, { "docid": "e70d64595fecbfc848f6138ebc41473e", "score": "0.64629817", "text": "def destroy\n @transfer.destroy\n respond_to do |format|\n format.html { redirect_to transfers_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b5238ea72b04c2b49976f35f403a9ad7", "score": "0.6446107", "text": "def destroy\n latest_transfer = Transfer.latest_transfer(@transfer.transferable_id, @transfer.transferable_type)\n @transfer.destroy\n @transfer.transferable.update(branch_id: @transfer.from_location_id) if latest_transfer == @transfer\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Transfer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8dec4f2dc803eb66cbc06cf2e52b4a34", "score": "0.6413874", "text": "def destroy\n @transfer = Transfer.find(params[:id])\n @transfer.destroy\n\n respond_to do |format|\n format.html { redirect_to transfers_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3bbe532f009f1a184b0c02732cbe4aaf", "score": "0.63245857", "text": "def delete\n response = WebPay.client.delete(path)\n response['deleted']\n end", "title": "" }, { "docid": "c1592c9a7c989d01a99d8c2f4e789eab", "score": "0.6288936", "text": "def netdev_resxml_delete( xml )\n top = netdev_resxml_top( xml )\n par = top.instance_variable_get(:@parent)\n par['delete'] = 'delete'\n end", "title": "" }, { "docid": "69b205c158f7212cc750ed38fc878f1c", "score": "0.6287663", "text": "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", "title": "" }, { "docid": "ac35e1eb88fb8efbee0456c17e3901b7", "score": "0.62828565", "text": "def destroy\n @transfer.destroy\n respond_to do |format|\n format.html { redirect_to transfers_url, notice: 'transfer was successfully deleted.' }\n # format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "70f3489b81e6a845197525e411746863", "score": "0.62777174", "text": "def destroy\n\n\n @transfer.destroy\n\n respond_to do |format|\n format.html { redirect_to transfers_url, notice: 'Transfer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2dbc81603c44ef55974281179ae482b3", "score": "0.62719", "text": "def destroy\n @settlement = @transaction.settlements.find(params[:id])\n @settlement.destroy\n\n respond_to do |format|\n format.html { redirect_to(client_transaction_settlements_url(@client, @transaction)) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "217401e4de465cbbf0d92de7a6c8454a", "score": "0.6263515", "text": "def destroy\n @transmission = Transmission.find(params[:id])\n @transmission.destroy\n\n respond_to do |format|\n format.html { redirect_to(transmissions_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "09e11fed17cad612797b84848d3d17ce", "score": "0.6249306", "text": "def destroy\n @charge_transaction = ChargeTransaction.find(params[:id])\n @charge_transaction.destroy\n\n respond_to do |format|\n format.html { redirect_to charge_transactions_url }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "5d20b7feeeac67cbc1967ad8db5ae766", "score": "0.6244502", "text": "def destroy\n @transferencia_contas_detalhe = TransferenciaContasDetalhe.find(params[:id])\n @transferencia_contas_detalhe.destroy\n\n respond_to do |format|\n format.html { redirect_to(\"/transferencia_contas/#{@transferencia_contas_detalhe.transferencia_conta_id}\") }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "044651fc8cf731a7b6d818acaecd8f90", "score": "0.6243132", "text": "def destroy\n @genbank_file.destroy\n\n respond_to do |format|\n format.xml { head :ok }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "3a2c55cc271972c1c177a0a8627d4b31", "score": "0.62141466", "text": "def destroy\n @direccion = Direccion.find(params[:id])\n @direccion.destroy\n\n respond_to do |format|\n format.html { redirect_to(direccions_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "2d8764b1f2f25110816a17f73f497f0e", "score": "0.6212043", "text": "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", "title": "" }, { "docid": "3bc4458c56225041064cc501a79e3b54", "score": "0.6181617", "text": "def destroy\n @tx = Tx.find(params[:id])\n @tx.destroy\n\n respond_to do |format|\n format.html { redirect_to(txes_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "563d83a5f5e669dea673911b03da1fdc", "score": "0.61765504", "text": "def destroy\n @transfer.destroy\n respond_to do |format|\n format.html { redirect_to my_transfers_url, notice: 'Transfer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c63dc6d011bae68715b84444be1b0171", "score": "0.61712706", "text": "def destroy\n @transfer.destroy\n respond_to do |format|\n format.html { redirect_to transfers_url, notice: 'Transfer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c63dc6d011bae68715b84444be1b0171", "score": "0.61712706", "text": "def destroy\n @transfer.destroy\n respond_to do |format|\n format.html { redirect_to transfers_url, notice: 'Transfer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c63dc6d011bae68715b84444be1b0171", "score": "0.61712706", "text": "def destroy\n @transfer.destroy\n respond_to do |format|\n format.html { redirect_to transfers_url, notice: 'Transfer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5f1bb387faa25e68c4a268d6e7126498", "score": "0.61632097", "text": "def destroy\n @transfer.destroy\n respond_to do |format|\n format.html { redirect_to transfers_url, notice: \"Transfer was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "22328cbae1768553b796ad8a4f04f990", "score": "0.6140631", "text": "def destroy\n @deposit_threshold = DepositThreshold.find(params[:id])\n @deposit_threshold.destroy\n\n respond_to do |format|\n format.html { redirect_to(deposit_thresholds_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "dd58e3b2c24155c6e115aca4078e87c9", "score": "0.61318827", "text": "def destroy\n @brochure_travel = BrochureTravel.find(params[:id])\n @brochure_travel.destroy\n\n respond_to do |format|\n format.html { redirect_to(brochure_travels_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "b21f3f87d3a773c9fac3db6617c56108", "score": "0.61074495", "text": "def destroy\n @auto1h_fold_change = Auto1hFoldChange.find(params[:id])\n @auto1h_fold_change.destroy\n\n respond_to do |format|\n format.html { redirect_to(auto1h_fold_changes_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e530587ddeffef1912c6842b566cb4df", "score": "0.60862607", "text": "def destroy\r\n @stock_transfer = StockTransfer.find(params[:id])\r\n @stock_transfer.destroy\r\n \r\n flash[:notice] = \"Stock Transfer successfully destroyed\"\r\n\r\n respond_to do |format|\r\n format.html { redirect_back_or_default(stock_transfers_url) }\r\n format.xml { head :ok }\r\n end\r\n end", "title": "" }, { "docid": "49555b5f61c3dd6cacf7aa4d4c339937", "score": "0.6084482", "text": "def destroy\n @traffic = Traffic.find(params[:id])\n @traffic.destroy\n\n respond_to do |format|\n format.html { redirect_to(traffics_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d6e0f917e6cd15b02ec4d78976b8ad03", "score": "0.607353", "text": "def destroy\n @cash_transaction = CashTransaction.find(params[:id])\n @cash_transaction.destroy\n\n respond_to do |format|\n format.html { redirect_to(cash_transactions_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "9ee94d52bfc0f259f68aad22c33e75da", "score": "0.60650784", "text": "def destroy\n @related_content = RelatedContent.find(params[:id])\n @related_content.destroy\n dirname = \"#{RelatedContent::UPLOAD_DIR}/#{@related_content.id}\"\n FileUtils.rm_rf dirname\t\n redirect_to @related_content.node\t \n\nend", "title": "" }, { "docid": "5e4e097a17f9b7c23e6ae1a1f30afa6c", "score": "0.6056957", "text": "def destroy\n @feefile = Feefile.find(params[:id])\n directory= \"uploads\"\n path =File.join(directory,@feefile.feefilename)\n File.delete(path)\n @feefile.destroy\n \n\n respond_to do |format|\n format.html { redirect_to(feefiles_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "782a26608e83b706b8e1d5088ffed24a", "score": "0.6043615", "text": "def destroy\n @economic = Economic.find(params[:id])\n @economic.destroy\n\n respond_to do |format|\n format.html { redirect_to(economics_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "526c55229cc5c8a3db7f25cab1e75066", "score": "0.60369396", "text": "def destroy\n @repeating_transfer.destroy\n respond_to do |format|\n format.html { redirect_to repeating_transfers_url, notice: 'Repeating transfer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ad457c93cf748c3c6581ddd7d6bc1b0d", "score": "0.60321146", "text": "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", "title": "" }, { "docid": "cc3bf21e77d56214ba6e5ba85227f355", "score": "0.60264194", "text": "def delete_data\n response = WebPay.client.delete([path, 'data'].join('/'))\n response['deleted']\n end", "title": "" }, { "docid": "7ca641e7e8c2d477fd8c4f343a9f5d76", "score": "0.60231334", "text": "def destroy\n @colonoscopytest = Colonoscopytest.find(params[:id])\n @colonoscopytest.destroy\n\n respond_to do |format|\n format.html { redirect_to(colonoscopytests_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "5d415890d3302221fcbd985ba6d8f3d8", "score": "0.60198563", "text": "def destroy\n @transaction_goods_taxis = Transaction::Goods::Taxe.find(params[:id])\n @transaction_goods_taxis.destroy\n\n respond_to do |format|\n format.html { redirect_to(transaction_goods_taxes_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e7aaff5564c9510db8276ba891efc87a", "score": "0.60121137", "text": "def destroy\n @subway = Subway.find(params[:id])\n @subway.destroy\n\n respond_to do |format|\n format.html { redirect_to(subways_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "357abc7df56e8f799f7befef2a14e346", "score": "0.60060066", "text": "def destroy\n @ofx_transaction.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "79c93251c00826537766fb5df353f0a9", "score": "0.59952915", "text": "def destroy\n @path = Path.find(params[:id])\n @path.destroy\n\n respond_to do |format|\n format.html { redirect_to(layer_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a522b94cbb32ad7936fcdd0ac30e9bfd", "score": "0.5988731", "text": "def destroy\n @taxband = Taxband.find(params[:id])\n @taxband.destroy\n\n respond_to do |format|\n format.html { redirect_to(taxbands_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "136dde944e008f269d7867d138146a40", "score": "0.5982628", "text": "def destroy\n @referral_charge = ReferralCharge.find(params[:id])\n @referral_charge.destroy\n\n respond_to do |format|\n format.html { redirect_to(referral_charges_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e90d8a77001cb0854193b4368e2f3a01", "score": "0.5972776", "text": "def destroy\n @auditflows_flownode = AuditflowsFlownode.find(params[:id])\n @auditflows_flownode.destroy\n\n respond_to do |format|\n format.html { redirect_to(auditflows_flownodes_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "ea618c7b46021569bc5c41c95b2dba24", "score": "0.59725624", "text": "def destroy\n @stock_transfer = StockTransfer.find(params[:id])\n @stock_transfer.destroy\n\n respond_to do |format|\n format.html { redirect_to stock_transfers_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "962744e3173a5dce528faf7aac8328d5", "score": "0.5968886", "text": "def destroy\n @cultural_heritage_part = CulturalHeritage::Part.find(params[:id])\n @cultural_heritage_part.deleted = 1\n @cultural_heritage_part.save\n\n respond_to do |format|\n format.html { redirect_to(cultural_heritage_parts_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "33b888c8f2b033bb54789de80c57d692", "score": "0.5964858", "text": "def delete\n client.delete(url)\n @deleted = true\nend", "title": "" }, { "docid": "7b84c235089c12e82eda059267fd5146", "score": "0.5960639", "text": "def destroy\n @account_transfer.destroy\n respond_to do |format|\n format.html { redirect_to account_transfers_url, notice: 'Account transfer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e843b0f200f49a933d05e41aaeaae5d2", "score": "0.596056", "text": "def destroy\n @logtransfer = Logtransfer.find(params[:id])\n @logtransfer.destroy\n\n respond_to do |format|\n format.html { redirect_to logtransfers_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ce10d2d6fff9b72df133b53052c3424d", "score": "0.5956675", "text": "def delete\n execute_request { faraday_connection.delete }\n end", "title": "" }, { "docid": "51df8665e1ee9d65e1533758ecb3efd2", "score": "0.5944835", "text": "def destroy\n @hetero1h_fold_change = Hetero1hFoldChange.find(params[:id])\n @hetero1h_fold_change.destroy\n\n respond_to do |format|\n format.html { redirect_to(hetero1h_fold_changes_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "92a86135d5b669811239e3c4cfb902d8", "score": "0.5941791", "text": "def destroy\n @az_balance_transaction = AzBalanceTransaction.find(params[:id])\n @az_balance_transaction.destroy\n\n respond_to do |format|\n format.html { redirect_to(az_balance_transactions_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f0003a7f455ad79f72d107e1a09d8335", "score": "0.59390265", "text": "def destroy\n @transaction = Transaction.find(params[:id])\n @transaction.destroy\n\n respond_to do |format|\n format.html { redirect_to(transactions_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f0003a7f455ad79f72d107e1a09d8335", "score": "0.59390265", "text": "def destroy\n @transaction = Transaction.find(params[:id])\n @transaction.destroy\n\n respond_to do |format|\n format.html { redirect_to(transactions_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f0003a7f455ad79f72d107e1a09d8335", "score": "0.59390265", "text": "def destroy\n @transaction = Transaction.find(params[:id])\n @transaction.destroy\n\n respond_to do |format|\n format.html { redirect_to(transactions_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f0003a7f455ad79f72d107e1a09d8335", "score": "0.59390265", "text": "def destroy\n @transaction = Transaction.find(params[:id])\n @transaction.destroy\n\n respond_to do |format|\n format.html { redirect_to(transactions_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f0003a7f455ad79f72d107e1a09d8335", "score": "0.59390265", "text": "def destroy\n @transaction = Transaction.find(params[:id])\n @transaction.destroy\n\n respond_to do |format|\n format.html { redirect_to(transactions_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f0003a7f455ad79f72d107e1a09d8335", "score": "0.59390265", "text": "def destroy\n @transaction = Transaction.find(params[:id])\n @transaction.destroy\n\n respond_to do |format|\n format.html { redirect_to(transactions_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f0003a7f455ad79f72d107e1a09d8335", "score": "0.59390265", "text": "def destroy\n @transaction = Transaction.find(params[:id])\n @transaction.destroy\n\n respond_to do |format|\n format.html { redirect_to(transactions_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "8a206c6aecd1fefe335db27e09780f66", "score": "0.5932495", "text": "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", "title": "" }, { "docid": "83d96bfbd73dab3b88c799bce705f9e4", "score": "0.5931892", "text": "def destroy\n @tax_computation = TaxComputation.find(params[:id])\n @tax_computation.destroy\n\n respond_to do |format|\n format.html { redirect_to(tax_computations_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "084e53644c0ae02982d6f6847e141328", "score": "0.5922101", "text": "def destroy\n @crawler_receive = CrawlerReceive.find(params[:id])\n @crawler_receive.destroy\n\n respond_to do |format|\n format.html { redirect_to(crawler_receives_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "9345e30995e75c5028f89d28d057f5ea", "score": "0.59217745", "text": "def destroy\n @uitgelicht = Uitgelicht.find(params[:id])\n @uitgelicht.destroy\n\n respond_to do |format|\n format.html { redirect_to(uitgelichts_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "240d1666f8572b7b02d242b521aa1135", "score": "0.59128535", "text": "def delete\n start { |connection| connection.request http :Delete }\n end", "title": "" }, { "docid": "a905b4d87d7751c1f154265267351a3d", "score": "0.59040964", "text": "def destroy\n @helocagree = Helocagree.find(params[:id])\n @helocagree.destroy\n\n respond_to do |format|\n format.html { redirect_to(helocagrees_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d7d4453ffcd956013346990070d08453", "score": "0.5902426", "text": "def delete\n ruta = \"/actions/#{action_id}\"\n client.delete(ruta)\n end", "title": "" }, { "docid": "4dfe941751a1230581840fe922bb8cfa", "score": "0.5897005", "text": "def destroy\n @services_charger = ServicesCharger.find(params[:id])\n @services_charger.destroy\n\n respond_to do |format|\n format.html { redirect_to(services_chargers_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "689d5a07a403c4b765ba178e4aff08a3", "score": "0.58967453", "text": "def delete\n client.delete(\"/#{id}\")\n end", "title": "" }, { "docid": "705de9a0d374a38fd83485090f37de0e", "score": "0.58967245", "text": "def destroy\n @copy = Copy.find(params[:id])\n @copy.destroy\n\n respond_to do |format|\n format.html { redirect_to(copies_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "81a4475da896c9c44b4b10de4dc1fd55", "score": "0.58776635", "text": "def destroy\n @variable_charge = VariableCharge.find(params[:id])\n @variable_charge.destroy\n\n respond_to do |format|\n format.html { redirect_to(variable_charges_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "92b4bc75c306f90ce65815a7a47e7c54", "score": "0.58687645", "text": "def destroy1\n @compare = Compare.find(params[:id])\n @compare.destroy\n\n respond_to do |format|\n format.html { redirect_to(compares_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "ad0c36135de0490ca71e281a94cd49f9", "score": "0.5867748", "text": "def delete\n execute_request('DELETE') do |uri, headers|\n HTTP.http_client.delete(uri, header: headers)\n end\n end", "title": "" }, { "docid": "1b4d1aaa263c32535cc608c1b8a6204b", "score": "0.58661866", "text": "def destroy\n @child_dupa2 = ChildDupa2.find(params[:id])\n @child_dupa2.destroy\n\n respond_to do |format|\n format.html { redirect_to(child_dupa2s_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "248b38256a29d4b12ac1305537e253b3", "score": "0.58624357", "text": "def destroy\n @transaction_financier = Transaction::Financier.find(params[:id])\n @transaction_financier.destroy\n\n respond_to do |format|\n format.html { redirect_to(transaction_financiers_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "dcb74c3609bbe06533eb94e4c917b912", "score": "0.5861022", "text": "def destroy\n @transaction = Transaction.find(params[:id])\n @account = @transaction.account\n @transaction.destroy\n\n respond_to do |format|\n rd_url = url_for(@account)+ \"#end\"\n format.html { redirect_to(rd_url) }\n\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "2e92a4b666f186e2fa0acf0291982387", "score": "0.5853282", "text": "def destroy\n @transaction.destroy\n respond_to do |format|\n format.html { redirect_to(account_transactions_path(@account)) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f266251f161cb2cde78ea2a533db2ec2", "score": "0.5852706", "text": "def destroy\n @gstr_advance_receipts = GstrAdvanceReceipt.find_by_id_and_company_id(params[:id], @company.id)\n @gstr_advance_receipts.delete_gstr_one_entry \n @gstr_advance_receipts.delete\n respond_to do |format|\n @gstr_advance_receipts.register_delete_action(request.remote_ip, @current_user, 'deleted')\n format.html { redirect_to(gstr_advance_receipts_url, :notice =>\"Gstr Advance Receipt has been succesfully deleted\") }\n format.xml {head :ok}\n \n end\n end", "title": "" }, { "docid": "439246f9ad70f13988d281f39558e50d", "score": "0.5851506", "text": "def destroy\n @conversion_factor.destroy\n\n respond_to do |format|\n format.html { redirect_to(conversion_factors_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "7422abd0c230e3f020ed3e0bbf01258b", "score": "0.5849803", "text": "def destroy\n @descendant.destroy\n respond_to do |format|\n format.html { redirect_to descendants_url, notice: 'Descendant was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b5f89112627601c18d579213a059774c", "score": "0.5845224", "text": "def destroy\n @cartridge_transfer.destroy\n respond_to do |format|\n format.html { redirect_to cartridge_transfers_url, notice: 'Cartridge transfer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "43fa06f69089b5d5013723943ef23b4b", "score": "0.5844411", "text": "def destroy\n @charge_master = ChargeMaster.find(params[:id])\n @charge_master.destroy\n\n respond_to do |format|\n format.html { redirect_to(charge_masters_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f68661b7b44a630fb90b7d12aa6f4b10", "score": "0.58433664", "text": "def destroy\n @tax_rate = TaxRate.find(params[:id])\n @tax_rate.destroy\n\n respond_to do |format|\n format.html { redirect_to(tax_rates_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "8a6b57608f94fd8534ba6071d3c45ae7", "score": "0.58423", "text": "def destroy\n @raw_data_file = RawDataFile.find(params[:id])\n @raw_data_file.destroy\n\n respond_to do |format|\n format.html { redirect_to(raw_data_files_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "cf8a249806f24cbf3271bcb30de85837", "score": "0.58413315", "text": "def destroy\n @estudiante = Estudiante.find(params[:id])\n @estudiante.destroy\n\n respond_to do |format|\n format.html { redirect_to(estudiantes_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "cf8a249806f24cbf3271bcb30de85837", "score": "0.58405125", "text": "def destroy\n @estudiante = Estudiante.find(params[:id])\n @estudiante.destroy\n\n respond_to do |format|\n format.html { redirect_to(estudiantes_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e78f746f6c800a3e6951f9b22b9b3106", "score": "0.5834067", "text": "def delete_file(path)\n \n puts \"Sending path via MCollective Files client\"\n @mc.delete(:path => path)\n printrpcstats\n \n end", "title": "" }, { "docid": "e26874fa17ba5fe448a0738fbce034bc", "score": "0.583039", "text": "def destroy\n @upload_file = UploadFile.find(params[:id])\n @upload_file.destroy\n\n respond_to do |format|\n format.html { redirect_to(upload_files_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "79f6c1dc625b7028742c1da69decc7cf", "score": "0.58276093", "text": "def delete\n \n end", "title": "" }, { "docid": "9858aa9417248d07693c181ce536a06c", "score": "0.58273494", "text": "def destroy\n @typical_deliverable = TypicalDeliverable.find(params[:id])\n @typical_deliverable.destroy\n\n respond_to do |format|\n format.html { redirect_to(:controller => 'catalogs') }\n #format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a5b56a64c1b95e27a629a89b4224d2a0", "score": "0.5826196", "text": "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", "title": "" }, { "docid": "2f59fb31f7925721f74c0e30ba5be2dc", "score": "0.5825134", "text": "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", "title": "" }, { "docid": "f2abd0b8e0bf7f369eca7dac8ebd6533", "score": "0.5825022", "text": "def destroy\n @amount = Amount.find(params[:id])\n @amount.destroy\n\n respond_to do |format|\n format.html { redirect_to(amounts_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "343e9931f3e6baee087a607faa4570e8", "score": "0.582269", "text": "def deleteFlatpackLink( flatpack_id, gen_id)\n params = Hash.new\n params['flatpack_id'] = flatpack_id\n params['gen_id'] = gen_id\n return doCurl(\"delete\",\"/flatpack/link\",params)\n end", "title": "" }, { "docid": "16b9a02671fa75bfb3206ce6d3cd0e63", "score": "0.5822514", "text": "def destroy\n @cargo_manifest = CargoManifest.find(params[:id])\n num = @cargo_manifest.manifest_num\n attr= TransportGuideState.find_by_name_state('En Proceso').id\n CargoManifest.transaction do\n @cargo_manifest.cargo_manifest_details.each do |detail|\n tg=detail.transport_guide\n tg.update_attribute('transport_guide_state_id', attr)\n detail.delete\n end\n @cargo_manifest.delete\n CustomLogger.info(\"Se borra manifiesto de carga: #{@cargo_manifest.inspect}, usuario: #{current_user.inspect}, #{Time.now}\")\n end\n \n\n respond_to do |format|\n format.html { redirect_to cargo_manifests_url, notice: \"El Manifiesto de cargo #{num} ha sido borrado\"}\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7bc85308b4f9bbf4903fb2066cc5642b", "score": "0.58205324", "text": "def destroy\n @file_upload = FileUpload.find(params[:id])\n @file_upload.destroy\n\n respond_to do |format|\n format.html { redirect_to(file_uploads_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "82ec189bdce2de5d528b27e0ec732a11", "score": "0.58197457", "text": "def delete; rest_delete(link('self')); end", "title": "" }, { "docid": "82ec189bdce2de5d528b27e0ec732a11", "score": "0.58197457", "text": "def delete; rest_delete(link('self')); end", "title": "" }, { "docid": "704d69d2f91a2953b158388ffe719ba0", "score": "0.5818148", "text": "def destroy\n @cultural_heritage_culture_point = CulturalHeritage::CulturePoint.find(params[:id])\n @cultural_heritage_culture_point.destroy\n\n respond_to do |format|\n format.html { redirect_to(cultural_heritage_culture_points_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "67a62b4f15810e70c182a6cff0d07acd", "score": "0.5817185", "text": "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", "title": "" }, { "docid": "f5dec0da8c1a2e938463444287862f87", "score": "0.5814072", "text": "def destroy\n @arc = Arc.find(params[:id])\n @arc.destroy\n\n respond_to do |format|\n format.html { redirect_to(arcs_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f20d9ded5aae563e53bfaffd26ceb918", "score": "0.58133847", "text": "def destroy\n @retain_node_selector = RetainNodeSelector.find(params[:id])\n @retain_node_selector.destroy\n\n respond_to do |format|\n format.html { redirect_to(retain_node_selectors_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "813fbf8b06bde57802551098b1001b35", "score": "0.58122253", "text": "def destroy\n @upload = Upload.find(params[:id])\n @upload.destroy\n\n respond_to do |format|\n format.html { redirect_to(uploads_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
f1cd28bb2aae5ff3c4d241eb14b0761c
DELETE /decks/1 DELETE /decks/1.json
[ { "docid": "b9cc6a94ad650e5f2d7fb78c9fc7cd9f", "score": "0.724722", "text": "def destroy\n @deck = Deck.find(params[:id])\n @deck.destroy\n\n respond_to do |format|\n format.html { redirect_to decks_url }\n format.json { head :ok }\n end\n end", "title": "" } ]
[ { "docid": "f4cc7539860f347016ad7b9bab804b41", "score": "0.7390399", "text": "def destroy\n @duck.destroy\n respond_to do |format|\n format.html { redirect_to ducks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "32e7f24368d6a34c721dc4ca3baafd83", "score": "0.73897845", "text": "def destroy\n @duck.destroy\n\n respond_to do |format|\n format.html { redirect_to ducks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "37f61e61554ca2f819b52f0ebf7b25ae", "score": "0.72603744", "text": "def destroy\n @deck = Deck.find(params[:id])\n @deck.destroy\n\n respond_to do |format|\n format.html { redirect_to decks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "23f0ba569f2e98e35ba8560a0995f12a", "score": "0.7244581", "text": "def destroy\n @deck.destroy\n respond_to do |format|\n format.html { redirect_to decks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "689d5a07a403c4b765ba178e4aff08a3", "score": "0.72248733", "text": "def delete\n client.delete(\"/#{id}\")\n end", "title": "" }, { "docid": "33b888c8f2b033bb54789de80c57d692", "score": "0.69196874", "text": "def delete\n client.delete(url)\n @deleted = true\nend", "title": "" }, { "docid": "3903143fcc323a88c3271e8ad2ce1e41", "score": "0.68948483", "text": "def destroy\n @dart = Dart.find(params[:id])\n @dart.destroy\n\n respond_to do |format|\n format.html { redirect_to darts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e79f7eb39e8696b8a06918d23bb1caf8", "score": "0.6872016", "text": "def destroy\n @couch.destroy\n respond_to do |format|\n format.html { redirect_to couches_url, notice: 'Couche was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b48c1e54cdae5156bf40327e4bfdd3ef", "score": "0.6863119", "text": "def destroy\n @deck = Deck.find(params[:id])\n @deck.destroy\n\n respond_to do |format|\n format.html { redirect_to user_root_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "16a2683f546788db664c1a14e2796530", "score": "0.6855742", "text": "def destroy\n @deck = current_user.decks.find(params[:id])\n @deck.destroy\n\n respond_to do |format|\n format.html { redirect_to decks_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "98368ad3a92faa2a4559c94f6b0bab94", "score": "0.6853191", "text": "def destroy\n @deco1.destroy\n respond_to do |format|\n format.html { redirect_to deco1s_url, notice: 'Deco1 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2e8eca134d8dc2a7dd7a4efd6bfb8207", "score": "0.68178755", "text": "def destroy\n @duck.destroy\n respond_to do |format|\n format.html { redirect_to ducks_url, notice: 'Duck was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7a5eea7c7a07ce3e7f95fa50802d596e", "score": "0.68145335", "text": "def delete path\n make_request(path, \"delete\", {})\n end", "title": "" }, { "docid": "e873aad3e91fccd0e6c1ad3960714ee6", "score": "0.6809733", "text": "def destroy\n @fixture = Fixture.find(params[:id])\n @fixture.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "522e787502895f0a05c9b2c6ca4e5ced", "score": "0.68088454", "text": "def delete\n request(:delete)\n end", "title": "" }, { "docid": "a9cdf07abd2f7a88bb3bcc4c652167b8", "score": "0.67830515", "text": "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", "title": "" }, { "docid": "3c1a6963b69c14530c809e6a0164b09d", "score": "0.67746574", "text": "def destroy\n @couch.destroy\n respond_to do |format|\n format.html { redirect_to couches_url, notice: 'Couch was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fa3c20a90ea1419af2232f845e460f8c", "score": "0.6773216", "text": "def delete!\n request! :delete\n end", "title": "" }, { "docid": "587ed7cceb7cd1ddbdaa6d6c65aa33c6", "score": "0.6770543", "text": "def destroy\n @coffee1.destroy\n respond_to do |format|\n format.html { redirect_to coffee1s_url, notice: 'Coffee1 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a897f4c773506e6ec4f7654d5a8fe8ac", "score": "0.67686737", "text": "def destroy\n @cow.destroy\n respond_to do |format|\n format.html { redirect_to kine_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "12649d62912dc561d03cb528b51fe007", "score": "0.676608", "text": "def delete\n api_client.delete(url)\n end", "title": "" }, { "docid": "4688cc357410336e24d462f821151983", "score": "0.67554283", "text": "def destroy\n @deck.destroy\n respond_to do |format|\n format.html { redirect_to decks_url, notice: 'Deck was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "86faa8c555419d7144a0c7003f760dff", "score": "0.6749345", "text": "def delete\n render json: Item.delete(params[\"id\"])\n end", "title": "" }, { "docid": "6bb5b9e2ce5ab901a05a1d618f90ad4d", "score": "0.674913", "text": "def delete\n url = prefix + \"delete\"\n return response(url)\n end", "title": "" }, { "docid": "6bb5b9e2ce5ab901a05a1d618f90ad4d", "score": "0.674913", "text": "def delete\n url = prefix + \"delete\"\n return response(url)\n end", "title": "" }, { "docid": "475b326783ff7794594d0be92fc361be", "score": "0.67469984", "text": "def destroy\n @baz1.destroy\n respond_to do |format|\n format.html { redirect_to baz1s_url, notice: \"Baz1 was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "223e22f8b80bdbae5711e29a77b4a80f", "score": "0.6740956", "text": "def destroy\n @bracket_golfer.destroy\n respond_to do |format|\n format.html { redirect_to bracket_golfers_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7b25d42baea1ac3eb4ce31e34e5574a8", "score": "0.6735858", "text": "def destroy\n @shelf.destroy\n\n respond_to do |format|\n format.html { redirect_to shelves_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7070e4dc3849fac5852c0271c9b6d7cc", "score": "0.67343247", "text": "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", "title": "" }, { "docid": "4c22b6f42398ff4cee7ecc48c558a86d", "score": "0.6731309", "text": "def destroy\n @deckfile.destroy\n respond_to do |format|\n format.html { redirect_to deckfiles_url, notice: 'Deckfile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5c7d0e0859720d825a45d8143acf020d", "score": "0.6721633", "text": "def destroy\n @beattape = Beattape.find(params[:id])\n @beattape.destroy\n\n respond_to do |format|\n format.html { redirect_to beattapes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7976360849ba626c6745832cae1e4d9b", "score": "0.67185706", "text": "def destroy\n @shelf.destroy\n respond_to do |format|\n format.html { redirect_to shelves_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.67115676", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.67115676", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.67115676", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.67115676", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "d2938d0d96fc4adb30b185ea6e647cdf", "score": "0.6711416", "text": "def delete\n render json: Post.delete(params[\"id\"])\n end", "title": "" }, { "docid": "38e779770ee5afef30f1191f456bac20", "score": "0.67113173", "text": "def destroy\n @barrack = Barrack.find(params[:id])\n @barrack.destroy\n\n respond_to do |format|\n format.html { redirect_to barracks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fb867c7b8486ba755d3aa79957f3c792", "score": "0.6695128", "text": "def destroy\n @kickoff = Kickoff.find(params[:id])\n @kickoff.destroy\n\n respond_to do |format|\n format.html { redirect_to kickoffs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "65c040f5af3074676390ad0bc20210fc", "score": "0.6694833", "text": "def destroy\n @livestock = Livestock.find(params[:id])\n @livestock.destroy\n\n respond_to do |format|\n format.html { redirect_to livestocks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c5b11e8cdf2659079067795221d10b43", "score": "0.66875464", "text": "def destroy\n @deck = Deck.find(params[:id])\n @deck.destroy\n\n respond_to do |format|\n format.html { redirect_to edit_handle_path(@deck.handle) }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "f1f1033e70dcb397607665e87857119f", "score": "0.6686267", "text": "def destroy\n @kit = Kit.find(params[:id])\n @kit.destroy\n\n respond_to do |format|\n format.html { redirect_to kits_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "932c67b8e7aab429836595e4d6a10f60", "score": "0.6684377", "text": "def destroy\n @kota_stone.destroy\n respond_to do |format|\n format.html { redirect_to kota_stones_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4512f9accd0489935e43afdfbe34e700", "score": "0.6676149", "text": "def destroy\n @dish_mixture.destroy\n respond_to do |format|\n format.html { redirect_to dish_mixtures_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3633e737644dae5f5d8d49f3248f7a12", "score": "0.66760856", "text": "def delete\n api(\"Delete\")\n end", "title": "" }, { "docid": "c6798424d46577fa4ffac5eda4ecc0c6", "score": "0.6669989", "text": "def delete\n url = prefix + \"delete\" + id_param\n return response(url)\n end", "title": "" }, { "docid": "0aafc6023fd6b7dad09145774e1496c0", "score": "0.666893", "text": "def destroy\n @kit.destroy\n respond_to do |format|\n format.html { redirect_to kits_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9639be13b4b12daacd48e6a27d939a78", "score": "0.666866", "text": "def destroy\n @cake = Cake.find(params[:id])\n @cake.destroy\n\n respond_to do |format|\n format.html { redirect_to cakes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ee014a13224c07cc94fd214a5b46cc2f", "score": "0.66647464", "text": "def destroy\n @nudge.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1b4e0e7d6e2b39e32fd8bfee89fd153b", "score": "0.66561204", "text": "def destroy\n @articy_draft.destroy\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a648a91651ad2556f120ffe4f0a225fe", "score": "0.66503495", "text": "def destroy\n @fixture = Fixture.find(params[:id])\n @fixture.destroy\n\n respond_to do |format|\n format.html { redirect_to fixtures_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a648a91651ad2556f120ffe4f0a225fe", "score": "0.66503495", "text": "def destroy\n @fixture = Fixture.find(params[:id])\n @fixture.destroy\n\n respond_to do |format|\n format.html { redirect_to fixtures_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e1d6f603cb5ea1e475ea71422432aeae", "score": "0.6640879", "text": "def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end", "title": "" }, { "docid": "17ed320a158948e7e3d7dcd53544f1a0", "score": "0.6636896", "text": "def destroy\n @json.destroy\n respond_to do |format|\n format.html { redirect_to jsons_url, notice: 'Json was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "17ed320a158948e7e3d7dcd53544f1a0", "score": "0.6636896", "text": "def destroy\n @json.destroy\n respond_to do |format|\n format.html { redirect_to jsons_url, notice: 'Json was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "275abda93cfbec1f8e34f994059cf1a7", "score": "0.663229", "text": "def destroy\n @cook.destroy\n respond_to do |format|\n format.html { redirect_to cooks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "09fc2820d9479cac0697e20c559268bf", "score": "0.6630625", "text": "def delete\n render json: Alien.delete(params[\"id\"])\n end", "title": "" }, { "docid": "ba67ebd85114998e01be10599c8943ca", "score": "0.6620493", "text": "def delete(path)\n RestClient.delete request_base+path\n end", "title": "" }, { "docid": "85e1d5f2e28c511d1551ed1d8b00fa83", "score": "0.661759", "text": "def destroy\n @quatum.destroy\n respond_to do |format|\n format.html { redirect_to quata_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a5a7d75dd1114530c12d29c47e927b0c", "score": "0.66167575", "text": "def destroy\n @climb_datum = ClimbDatum.find(params[:id])\n @climb_datum.destroy\n\n respond_to do |format|\n format.html { redirect_to climb_data_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8e7e3fea4c5b81973a094c307fcec8c1", "score": "0.66160846", "text": "def destroy\n @ruby.destroy\n respond_to do |format|\n format.html { redirect_to rubies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f503b75e4b95827afb9999f1fedb309f", "score": "0.66157305", "text": "def destroy\n @showdown = Showdown.find(params[:id])\n @showdown.destroy\n\n respond_to do |format|\n format.html { redirect_to showdowns_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b246ffb86d7f0e110b8b7f377e09c64b", "score": "0.6615599", "text": "def api_delete(path, data = {})\n api_request(:delete, path, :data => data)\n end", "title": "" }, { "docid": "c9672d4cc2245d206e008c21ce1c26eb", "score": "0.6611141", "text": "def destroy\n @item.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "63b995ee539d37a0219171db7ef60dcd", "score": "0.66018564", "text": "def destroy\n @storage = @client.storages.find(params[:id])\n @storage.destroy\n\n respond_to do |format|\n format.html { redirect_to client_url(@client) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f1cea2b9f961b6721500bb73eff339bd", "score": "0.6590842", "text": "def destroy\n @beat = Beat.find(params[:id])\n @beat.destroy\n\n respond_to do |format|\n format.html { redirect_to beats_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7b6c8811b386a360f8c0255188ffed9a", "score": "0.6590686", "text": "def destroy\n @showdown = Showdown.find(params[:id])\n @showdown.destroy\n\n respond_to do |format|\n format.html { redirect_to showdowns_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "62e760968896ecdd81865a0bac3a52e2", "score": "0.65846556", "text": "def destroy\n @album.destroy\n render json: @album\n end", "title": "" }, { "docid": "2d8f7d78fcd467480fa59ca21d0d421a", "score": "0.65812266", "text": "def destroy\n @quack.destroy\n respond_to do |format|\n format.html { redirect_to quacks_url, notice: 'Quack was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "dadb81ea7f1694a8cb415c5bf7d24ad7", "score": "0.6578614", "text": "def destroy\n @three60.destroy\n respond_to do |format|\n format.html { redirect_to edit_admin_good_url(@good, anchor: \"three60\") }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "85aa2c870971e9aa148a1b104631aa8f", "score": "0.65756583", "text": "def destroy\n @albumone.destroy\n respond_to do |format|\n format.html { redirect_to albumones_url, notice: 'Albumone was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "83fd3888c1602cd06d89cc99329260e6", "score": "0.65717983", "text": "def destroy\n @bow.destroy\n respond_to do |format|\n format.html { redirect_to bows_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "47aa5d34308db5f7ea511b1114d2fb03", "score": "0.6568492", "text": "def destroy\n @cage.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3008b093ca9380ad008b1cd6ef403af2", "score": "0.6568378", "text": "def destroy\n @cocktail = Cocktail.find(params[:id])\n @cocktail.destroy\n\n respond_to do |format|\n format.html { redirect_to cocktails_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3008b093ca9380ad008b1cd6ef403af2", "score": "0.6568378", "text": "def destroy\n @cocktail = Cocktail.find(params[:id])\n @cocktail.destroy\n\n respond_to do |format|\n format.html { redirect_to cocktails_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "376afb7872ca26558919139da66b44df", "score": "0.65603715", "text": "def delete\n RestClient.delete(url, @header) do |rso, req, res|\n setup(rso, req, res)\n end\n end", "title": "" }, { "docid": "699a73e1018075bf6f4ec5cf453a3c7d", "score": "0.65583855", "text": "def destroy\n @three.destroy\n respond_to do |format|\n format.html { redirect_to threes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5999fcc12bba54808667698de9d90771", "score": "0.65558153", "text": "def destroy\n @story.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ee58f29b6e10079fe9e7f5746e98b5ed", "score": "0.6554375", "text": "def destroy\n @datum.destroy\n respond_to do |format|\n format.html { redirect_to data_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "913d4c1e4e0344044e7f61bb7613bca0", "score": "0.65507984", "text": "def destroy\n @albumsix.destroy\n respond_to do |format|\n format.html { redirect_to albumsixes_url, notice: 'Albumsix was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "457bf8b139c6fb5311acc9535bd12e71", "score": "0.6550075", "text": "def destroy\n @baz35.destroy\n respond_to do |format|\n format.html { redirect_to baz35s_url, notice: \"Baz35 was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "82638edd700f30d04414a7c8abd45ee1", "score": "0.65487796", "text": "def delete\n url = prefix + \"delete\"\n return response(url)\n end", "title": "" }, { "docid": "82638edd700f30d04414a7c8abd45ee1", "score": "0.65487796", "text": "def delete\n url = prefix + \"delete\"\n return response(url)\n end", "title": "" }, { "docid": "1a29d70e97fa8ec44a85e68bb5a98f49", "score": "0.6545665", "text": "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", "title": "" }, { "docid": "fb622696b3cadaef2a0d459cf3572785", "score": "0.6538363", "text": "def destroy\n client=Client.find_by_id(params[:id])\n if client != nil\n if client.destroy\n head 204\n end\n else\n head 404\n end\n end", "title": "" }, { "docid": "4cacd38a174325e457acf7862e86aad5", "score": "0.6530197", "text": "def destroy\n @musica.audios.purge\n @musica.destroy\n respond_to do |format|\n format.html { redirect_to musicas_url, notice: 'Álbum apagado com sucesso!' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ce1e7cf90aa82857889c1b10e9f7d91a", "score": "0.65274453", "text": "def destroy\n @client.delete( name )\n end", "title": "" }, { "docid": "99170eef19af4181242a1be4bd8d71ab", "score": "0.65271115", "text": "def destroy\n @humanidades1 = Humanidades1.find(params[:id])\n @humanidades1.destroy\n\n respond_to do |format|\n format.html { redirect_to humanidades1s_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f6cd4de81e27acefc216562918c1a92e", "score": "0.6524064", "text": "def destroy\n @kela.destroy\n respond_to do |format|\n format.html { redirect_to kelas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e71457a4d73e5e8d691c8ecac51da78d", "score": "0.652323", "text": "def destroy\n @baz8.destroy\n respond_to do |format|\n format.html { redirect_to baz8s_url, notice: \"Baz8 was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a62ab001546a00700d4f2a5125e11986", "score": "0.6523098", "text": "def destroy\n @item_album.destroy\n respond_to do |format|\n format.html { redirect_to(:back) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5e01b5b42306672c59818b4c61f44c21", "score": "0.65224373", "text": "def destroy\n @databox.destroy\n render json: { post: @databox }\n# respond_to do |format|\n# format.html { redirect_to databoxes_url }\n# format.json { head :no_content }\n# end\n end", "title": "" }, { "docid": "708160c68384ac923d10a4a11958a341", "score": "0.652231", "text": "def destroy\n @cheque.destroy\n respond_to do |format|\n format.html { redirect_to cheques_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "59eb9d1fec3a5d513ff6aed6b0ddc0b1", "score": "0.65211976", "text": "def delete(url, headers = {})\n http :delete, \"#{url}.json\", headers\n end", "title": "" }, { "docid": "15019f65fcb2dc09a625318cab419063", "score": "0.6520446", "text": "def delete\n client.delete(url)\n @deleted = true\n end", "title": "" }, { "docid": "40ce2ccbef9c90e3bd5b3790190dd0ba", "score": "0.6519772", "text": "def destroy\n @rackitem = Rackitem.find(params[:id])\n @rackitem.destroy\n\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Rackitem removed' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8ec1d024acc4cbe5bb3a8b0bfc1bc32f", "score": "0.65154207", "text": "def destroy\n @Bouquets = Bouquet.find(params[:id])\n @Bouquets.destroy\n\n respond_to do |format|\n format.html { redirect_to bouquets_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cfa7630868d6a39e334c5965b32d593d", "score": "0.6512843", "text": "def destroy\n @music_disc.destroy\n respond_to do |format|\n format.html { redirect_to music_discs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "30c8469308c31943860048eadd45e4b9", "score": "0.6512105", "text": "def destroy\n @baz54.destroy\n respond_to do |format|\n format.html { redirect_to baz54s_url, notice: \"Baz54 was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "240d1666f8572b7b02d242b521aa1135", "score": "0.65111816", "text": "def delete\n start { |connection| connection.request http :Delete }\n end", "title": "" } ]
05938b789c592d2b5b08841d48779928
Delete is an action command that deletes a single record An argument error is thrown if the record key does not exist Examples: Artist.delete(4)
[ { "docid": "aedabe20c0f93e98e3b35d78ab57cd35", "score": "0.0", "text": "def delete(key)\n result = @rarray.get(key)\n if result\n @rarray.delete(result)\n store\n else\n raise ArgumentError,'Cannot delete - no matching id', caller \n end\n end", "title": "" } ]
[ { "docid": "79f6c1dc625b7028742c1da69decc7cf", "score": "0.72408104", "text": "def delete\n \n end", "title": "" }, { "docid": "18eabf26b1c7709e81b9725921afe154", "score": "0.72238386", "text": "def delete record\n db_name = database_name_for(record)\n coll_name = collection_name_for(record)\n case\n when id = id_for(record)\n pointer = \"/#{db_name}/#{coll_name}/#{id}\"\n res = collection_for(record).remove({:_id => id})\n if res[\"err\"]\n log.error(res[\"err\"])\n else\n log.debug(\"Deleted #{pointer}\")\n end\n when query = delete_query_for(record)\n pointer = \"/#{db_name}/#{coll_name}\"\n res = collection_for(record).remove(query)\n if res[\"err\"]\n log.error(res[\"err\"])\n else\n log.debug(\"Deleted #{res['n']} records from #{pointer}\")\n end\n end\n end", "title": "" }, { "docid": "2f0df61f9fb4ef9b10bea9b7f0160b0b", "score": "0.7203612", "text": "def delete\n end", "title": "" }, { "docid": "84ef60660240d57066f0a1d474cce722", "score": "0.7160044", "text": "def delete\n end", "title": "" }, { "docid": "7fd70428740c70438e41ee46874b7099", "score": "0.7144251", "text": "def delete_record *rid\n db.delete_record rid\n end", "title": "" }, { "docid": "874ca519ae7e7d5fef3cdf7e9ddfebd5", "score": "0.7143442", "text": "def delete(action, **args); end", "title": "" }, { "docid": "e9be98ca69f769b8f05268c55079bd3a", "score": "0.71310896", "text": "def delete(*args)\n execute(:delete, *args)\n end", "title": "" }, { "docid": "519c20edd8ce1ad83e15fa0ddb9b07f1", "score": "0.7121371", "text": "def delete(record)\n record.del\n end", "title": "" }, { "docid": "169195013d8d14afc2447c9feaeadae0", "score": "0.7112263", "text": "def delete! _key = nil\n ::Kernel.raise DerivedError\n end", "title": "" }, { "docid": "42b872c02c98e72b367e4455b0cf4683", "score": "0.7106478", "text": "def delete; raise ActiveRecord::ReadOnlyRecord; end", "title": "" }, { "docid": "a860d99cfb28f6db9530a66dbcd28e3c", "score": "0.70776504", "text": "def delete\n end", "title": "" }, { "docid": "a860d99cfb28f6db9530a66dbcd28e3c", "score": "0.70776504", "text": "def delete\n end", "title": "" }, { "docid": "a860d99cfb28f6db9530a66dbcd28e3c", "score": "0.70776504", "text": "def delete\n end", "title": "" }, { "docid": "a860d99cfb28f6db9530a66dbcd28e3c", "score": "0.70776504", "text": "def delete\n end", "title": "" }, { "docid": "a860d99cfb28f6db9530a66dbcd28e3c", "score": "0.70776504", "text": "def delete\n end", "title": "" }, { "docid": "a860d99cfb28f6db9530a66dbcd28e3c", "score": "0.70776504", "text": "def delete\n end", "title": "" }, { "docid": "a860d99cfb28f6db9530a66dbcd28e3c", "score": "0.70776504", "text": "def delete\n end", "title": "" }, { "docid": "1fd7dc0e91f151ed3e5049a52c30472f", "score": "0.7064708", "text": "def delete\n \n end", "title": "" }, { "docid": "89268a6ec13a5a681962b227c3d9fb42", "score": "0.7047606", "text": "def delete\n\n end", "title": "" }, { "docid": "039a8c1fd873a2c0705fb7babbb73702", "score": "0.69733", "text": "def delete\n end", "title": "" }, { "docid": "59b1de5b6e836c476645be5c9116ae21", "score": "0.6965272", "text": "def delete\n raise ActiveRecord::ReadOnlyRecord\n end", "title": "" }, { "docid": "59b1de5b6e836c476645be5c9116ae21", "score": "0.6965272", "text": "def delete\n raise ActiveRecord::ReadOnlyRecord\n end", "title": "" }, { "docid": "59b1de5b6e836c476645be5c9116ae21", "score": "0.6965272", "text": "def delete\n raise ActiveRecord::ReadOnlyRecord\n end", "title": "" }, { "docid": "36bb9cb75b1aaf276eaeeddf237258ed", "score": "0.6950622", "text": "def delete(*args)\n commit(\"delete\", *args)\n end", "title": "" }, { "docid": "538bc1048cdf97e5ad9a419aa809cf6f", "score": "0.6950154", "text": "def delete\n @record = Record.find(params[:id])\n end", "title": "" }, { "docid": "a06c366e2b5e98c93ad291123f034ee4", "score": "0.6938754", "text": "def delete\n\t\t\t\"delete called - deleting object #{params[:id]}\"\n\t\tend", "title": "" }, { "docid": "2f09b1bc18309831d672d8a2ac1eaa20", "score": "0.69197303", "text": "def delete(key)\n\n end", "title": "" }, { "docid": "ca79983a60446ff55251b83f46a41a6e", "score": "0.69112676", "text": "def delete(*args)\n commit(\"delete\", *args)\n end", "title": "" }, { "docid": "39b2c6ffdf18683d461153304e193c5f", "score": "0.68999726", "text": "def delete(key)\n\t\titem = Item.find(key.to_i)\n\t\titem.delete\n\t\tflash[:danger] = \"Item(s) deleted\"\n\tend", "title": "" }, { "docid": "7cb9eca8e36ca08c593f40fddb371adc", "score": "0.68726903", "text": "def delete(key)\n\n # FIXME: insert code that connects to the backend and affects the delete\n # operation\n #\n # - This delete should be done atomically\n # - Convert any exceptions into a failed status result with a meaningful\n # error message.\n #\n\n { :result => false, :err_msg => 'FIXME: not implemented' }\n end", "title": "" }, { "docid": "87b2238b8b633eea149aca12900f7383", "score": "0.68521124", "text": "def delete\n @entity = GetText::Db::Entity.find(params[:id])\n \n if @entity.update_attribute( :deleted, true )\n flash[:notice] = 'Entity has been deleted.'\n redirect_to :action => 'list'\n else\n flash[:notice] = '[Error] Updating failed.'\n redirect_to :back\n end\n end", "title": "" }, { "docid": "3633e737644dae5f5d8d49f3248f7a12", "score": "0.68312913", "text": "def delete\n api(\"Delete\")\n end", "title": "" }, { "docid": "1bdafdf7501ddcf11548064240fd82a9", "score": "0.68199974", "text": "def delete\n\n\tend", "title": "" }, { "docid": "9e90e0d80e9c3c568d143bb92282da21", "score": "0.6813696", "text": "def delete\n binding.pry\n DATABASE.execute(\"DELETE FROM contents WHERE id = #{id}\")\n end", "title": "" }, { "docid": "e79ddd80e6a777261c5804b3c8c8c765", "score": "0.6802263", "text": "def del\n delete\n end", "title": "" }, { "docid": "1a5d3c4090ec19fabe0c5a2c2e051105", "score": "0.6782592", "text": "def delete(key)\n perform_delete(:delete, key)\n end", "title": "" }, { "docid": "c34a7985abb57219e86b8b3d8228d662", "score": "0.67593753", "text": "def remove\t\n\t\t\tbegin\t\t\t\t\t\t\t\n\t\t\t\tdatatoremove = Datastore.new\t\t\t\n\t\t\t\tdatatoremove.delete(params[:key])\n\t\t\t\trender :status => 200,\n\t \t\t:json => { :response => \"success\",\n\t \t :status => 200,\n\t \t :info => \"Successfully removed\", \n\t \t :data => {} }\n\t\t\trescue Exception => e\n\t\t\t\trender :status => :unprocessable_entity,\n\t \t :json => { :response => \"fail\",\n\t \t :status => 401,\n\t :info => e.message }\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "ff16b7b4acbdb72e0fb275ca5dd08454", "score": "0.6758822", "text": "def delete(key)\n db.delete(key)\n end", "title": "" }, { "docid": "e386f6e6de2314a5d77894e8caf29f45", "score": "0.674924", "text": "def delete\n DATABASE.execute(\"DELETE FROM students WHERE id = #{@id}\")\n end", "title": "" }, { "docid": "fb4acbeb1361e3addcbd40991b9c8a01", "score": "0.67386514", "text": "def delete(id)\n @item = Item.find_by_id(id)\n \n begin\n item.destroy!\n say 'Item Deleted'\n rescue StandardError => e\n say e.message\n end\n end", "title": "" }, { "docid": "86220d3b1d84d8c58682b9bdca45d381", "score": "0.6732714", "text": "def delete(key); end", "title": "" }, { "docid": "86220d3b1d84d8c58682b9bdca45d381", "score": "0.6732714", "text": "def delete(key); end", "title": "" }, { "docid": "86220d3b1d84d8c58682b9bdca45d381", "score": "0.6732714", "text": "def delete(key); end", "title": "" }, { "docid": "86220d3b1d84d8c58682b9bdca45d381", "score": "0.6732714", "text": "def delete(key); end", "title": "" }, { "docid": "86220d3b1d84d8c58682b9bdca45d381", "score": "0.6732714", "text": "def delete(key); end", "title": "" }, { "docid": "a2462bae220868f7413e990179f68da0", "score": "0.6725511", "text": "def delete\n @record = find_if_allowed(params[:id], :destroy)\n render :action => 'delete'\n end", "title": "" }, { "docid": "1b275875722f40d4a6f566e6f2035bde", "score": "0.6724518", "text": "def delete\n raise NotImplementedError\n end", "title": "" }, { "docid": "f980a4cfa5155fc92176eb24466ddb77", "score": "0.6721977", "text": "def delete\n # TODO: implement delete\n end", "title": "" }, { "docid": "522e787502895f0a05c9b2c6ca4e5ced", "score": "0.67219585", "text": "def delete\n request(:delete)\n end", "title": "" }, { "docid": "b746d3256924824d5aeff7d0eb1d7705", "score": "0.6721823", "text": "def delete\n raise NotImplementedError\n end", "title": "" }, { "docid": "568aea9d8e5d440a2d2ce6c273868750", "score": "0.6716289", "text": "def deleteOperation\n\t\tputs \"Enter which record do you want to delete (Product Id)\"\n\t\tpro_id = gets.chomp.to_i\n\t\tbegin\n\t\t\tresult = @statement.executeUpdate(\"delete from products where proid = #{pro_id}\")\n\t\t\tif result\n\t\t\t\tputs \"Record deleted successfully\"\n\t\t\telse\n\t\t\t\tputs \"Record doesnot deleted\"\n\t\t\tend\n\t\trescue Exception => e\n\t\t\tputs e.message\n\t\tend\n\t\t@connection.close\n\t\t@statement.close\n\tend", "title": "" }, { "docid": "652c312e0e3949757609507fe8b29cb5", "score": "0.6711684", "text": "def delete\n DATABASE.execute(\"DELETE from students WHERE id = #{id}\")\n end", "title": "" }, { "docid": "f98d767565859b14853628e517e800dd", "score": "0.6709576", "text": "def handle_delete\n params.record.destroy do |result|\n alert 'unable to delete record' unless result\n end\n end", "title": "" }, { "docid": "0eb7098bf7967039f3eabf6f3c383542", "score": "0.67081827", "text": "def delete_item(id)\n record \"/todos/delete_item/#{id}\"\n end", "title": "" }, { "docid": "6527d2cc20c17c7269427d0c3e171a3a", "score": "0.6704072", "text": "def delete\n raise NotImplementedError\n end", "title": "" }, { "docid": "6527d2cc20c17c7269427d0c3e171a3a", "score": "0.6704072", "text": "def delete\n raise NotImplementedError\n end", "title": "" }, { "docid": "f8a59d7b89a929f0138bba666a8d5483", "score": "0.6693475", "text": "def delete(name)\n\n end", "title": "" }, { "docid": "cb7bf881d92d10b61dacd59ff0a0a10b", "score": "0.6667666", "text": "def delete(key)\n raise \"Method not implemented. Called abstract class.\"\n end", "title": "" }, { "docid": "b55aa4796571c8103f6c26e2a8f78e63", "score": "0.66600347", "text": "def delete(key)\n run_hook(:before_delete)\n db.delete(key)\n run_hook(:after_delete)\n end", "title": "" }, { "docid": "a050db80a567a3c8c69e675f3df148dd", "score": "0.6629933", "text": "def delete\n CONNECTION.execute(\"DELETE FROM '#{tablename}' WHERE id = ?;\", @id)\n \"Deleted.\"\n end", "title": "" }, { "docid": "5bb5e4414b42364dccb5ef507fce6151", "score": "0.662177", "text": "def delete\n destroy\n end", "title": "" }, { "docid": "23b487bb8e5e215d00e2db72729ffa17", "score": "0.6619863", "text": "def destroyRecord(id)\n item = Todo.find(id)\n item.destroy\nend", "title": "" }, { "docid": "08e543547afc1b91d6a297ca18140499", "score": "0.66155314", "text": "def _delete\n n = _delete_without_checking\n raise(NoExistingObject, \"Attempt to delete object did not result in a single row modification (Rows Deleted: #{n}, SQL: #{_delete_dataset.delete_sql})\") if require_modification && n != 1\n n\n end", "title": "" }, { "docid": "08e543547afc1b91d6a297ca18140499", "score": "0.66155314", "text": "def _delete\n n = _delete_without_checking\n raise(NoExistingObject, \"Attempt to delete object did not result in a single row modification (Rows Deleted: #{n}, SQL: #{_delete_dataset.delete_sql})\") if require_modification && n != 1\n n\n end", "title": "" }, { "docid": "822aa6689ddf5e71f96df3affe345733", "score": "0.66137594", "text": "def delete\n ret_val = error_if_exists('delete')\n super if ret_val\n return ret_val\n end", "title": "" }, { "docid": "0e3bfd88e13d3e5fe4cadf5868b24f25", "score": "0.66102624", "text": "def destroy\n @record = Record.find(params[:id])\n if @record\n @record.destroy\n render json: {message: \"Record deleted\"}, status: :ok\n else\n render json: {error: \"Unable to delete the record\"}, status: :400\n end\n end", "title": "" }, { "docid": "4a00519d128ff6cedea29aed796803d4", "score": "0.6609332", "text": "def delete\n raise \"'id' is not set.\" if @id == nil\n sql = \"DELETE FROM #{table} WHERE id=#{@id}\"\n Database.transaction(sql)\n @log.debug \"Record[#{self}] is deleted from Table[#{table}]\"\n end", "title": "" }, { "docid": "8f5526e5505da0f6fc948165a3dd1f38", "score": "0.66047543", "text": "def delete(key)\n @db.delete(key.to_s.downcase)\n end", "title": "" }, { "docid": "95900eeb6730c084ae9c9e5a80d9d8ce", "score": "0.6596745", "text": "def delete!( opts = {} )\n http_action :delete, nil, opts\n end", "title": "" }, { "docid": "850c74a5fb0f1b6b2e18cf98a629af88", "score": "0.65935177", "text": "def delete *args, &block\n res = @conn.delete *args, &block\n handle res, parse: false\n end", "title": "" }, { "docid": "dab4b1f0d4a4b8ac635a56eeb172b33f", "score": "0.65774953", "text": "def delete!\n deleted\n save!\n end", "title": "" }, { "docid": "ca47d5e938df99eb744c55c8a8b7a3df", "score": "0.65663564", "text": "def delete(*args)\n request(:delete, *args)\n end", "title": "" }, { "docid": "421785138641bb95a60a4e22ca23766d", "score": "0.65619564", "text": "def delete( key )\n fail NotImplementedError\n end", "title": "" }, { "docid": "43263f5436c6a251797fea210e40c26d", "score": "0.6557512", "text": "def delete_entry(db, id)\r\n\tdb.execute(\"DELETE FROM games WHERE id=?\", id)\r\n\tputs \"Entry deleted.\"\r\nend", "title": "" }, { "docid": "16a1223b1a3c81e44c402b6d9ac0771a", "score": "0.65566725", "text": "def destroy\n raise ActiveRecord::ReadOnlyRecord\n end", "title": "" }, { "docid": "f5b92183f02004645be846a59824c683", "score": "0.6554392", "text": "def delete(*args)\n if args.blank?\n raise \"Using delete with no args is not allowed. Please use delete_all to delete all records\"\n end\n keys = find_keys(*args)\n self.store.delete_keys(keys)\n end", "title": "" }, { "docid": "41aad203f02d7ec0c1625f907461c248", "score": "0.6540974", "text": "def delete() #DELETE film1.delete (removes 1 film)\n sql = \"DELETE FROM films WHERE id = $1;\"\n values = [@id]\n SqlRunner.run(sql, values)\n end", "title": "" }, { "docid": "60d292b463e4cdecbdd0782cc8e44467", "score": "0.65407735", "text": "def delete\n destroy\n end", "title": "" }, { "docid": "60d292b463e4cdecbdd0782cc8e44467", "score": "0.65407735", "text": "def delete\n destroy\n end", "title": "" }, { "docid": "2f040f3edfb54d2807d04c1ec22f13fc", "score": "0.65276057", "text": "def delete\n del unless new_record?\n set_deleted_properties\n end", "title": "" }, { "docid": "4917860d2b960cfa9237817b7a106eac", "score": "0.651843", "text": "def delete(key, opts = {})\n options = setup_commit_options({:message => \"deleted #{key}\"}.merge(opts))\n self[key].tap do\n save(options) {|index| index.delete(key_for(key)) }\n end\n end", "title": "" }, { "docid": "4917860d2b960cfa9237817b7a106eac", "score": "0.651843", "text": "def delete(key, opts = {})\n options = setup_commit_options({:message => \"deleted #{key}\"}.merge(opts))\n self[key].tap do\n save(options) {|index| index.delete(key_for(key)) }\n end\n end", "title": "" }, { "docid": "769304fbb4730ef96173d3c20bedde80", "score": "0.65174466", "text": "def delete(name); end", "title": "" }, { "docid": "769304fbb4730ef96173d3c20bedde80", "score": "0.65174466", "text": "def delete(name); end", "title": "" }, { "docid": "dc7978b571fa1af94fbce826dcf38dc1", "score": "0.65168756", "text": "def destroy; delete end", "title": "" }, { "docid": "4f40827274bf914ba1d50a6f036729c6", "score": "0.6514957", "text": "def delete\n @resource.delete\n end", "title": "" }, { "docid": "fa3c20a90ea1419af2232f845e460f8c", "score": "0.6511013", "text": "def delete!\n request! :delete\n end", "title": "" }, { "docid": "386a2ec636bda9293210dbf3f3884e86", "score": "0.6510356", "text": "def deleted(item)\n end", "title": "" }, { "docid": "5f32ef48f43a9713da36d03611edc9c8", "score": "0.6510122", "text": "def delete\n sql = \"DELETE FROM albums WHERE id = $1\"\n values = [@id]\n SqlRunner.run(sql, values)\nend", "title": "" }, { "docid": "750fc28d0c2c7ac2bd19064e6c9f7e19", "score": "0.65067947", "text": "def delete(value)\n end", "title": "" }, { "docid": "750fc28d0c2c7ac2bd19064e6c9f7e19", "score": "0.65067947", "text": "def delete(value)\n end", "title": "" }, { "docid": "a502a93c7b6f1a9d4824712389f62e0d", "score": "0.650318", "text": "def delete() # EXTENSION\n sql = \"DELETE FROM films WHERE id = $1\"\n values = [@id]\n SqlRunner.run(sql, values)\nend", "title": "" }, { "docid": "279770b73e453e6fab559b77dc5305fb", "score": "0.6495564", "text": "def delete_item(title, year)\n @table.delete_item(key: {\"year\" => year, \"title\" => title})\n rescue Aws::DynamoDB::Errors::ServiceError => e\n puts(\"Couldn't delete movie #{title}. Here's why:\")\n puts(\"\\t#{e.code}: #{e.message}\")\n raise\n end", "title": "" }, { "docid": "6d0d544c2e89c69b95ed3700f4ecb54f", "score": "0.64891905", "text": "def alchemy_delete(action, parameters = nil, session = nil, flash = nil)\n process_alchemy_action(action, parameters, session, flash, \"DELETE\")\n end", "title": "" }, { "docid": "0dc39ac330c582c99d9b1a13597a25be", "score": "0.6483722", "text": "def delete(key)\n @table.delete(key)\n end", "title": "" }, { "docid": "1c85f87393197b2e2bed24b5e9bf7bbc", "score": "0.6461848", "text": "def delete(_identifier)\n raise Errors::Backend::NotImplementedError, 'Requested functionality is not implemented'\n end", "title": "" }, { "docid": "d42d524667fe775a6fd2f8ed58ac62b5", "score": "0.64608014", "text": "def delete(*rest) end", "title": "" }, { "docid": "a3d1a72c6cfbd5bde766e80703416f0e", "score": "0.6458072", "text": "def delete(resource)\n finder_or_run(:delete, resource)\n end", "title": "" }, { "docid": "21c1a7d914182a9a971201b3235a2bc1", "score": "0.64579785", "text": "def delete(key)\n unimplemented\n end", "title": "" }, { "docid": "c5cec3ea3949085cb5dd7bbd48a73cab", "score": "0.6451597", "text": "def delete _key\n store.transaction() { |s| s.delete(prepare_key(_key)) }\n end", "title": "" }, { "docid": "530dd705905d3a72fdc8cfb3d9ddbf72", "score": "0.64511806", "text": "def delete!\n @resource.delete!\n end", "title": "" } ]
124754dbb272353a965e2aef33a73244
Test if Emacs with running server is available.
[ { "docid": "d8ca97b749740b1629533f96a8b0860b", "score": "0.0", "text": "def available?(silent = false, options = {})\n result = `#{ DEFAULTS[:client] } --eval \"(require 'guard)\" 2> /dev/null || echo 'N/A'`\n\n if result.chomp! == 'N/A'\n false\n else\n true\n end\n end", "title": "" } ]
[ { "docid": "40b61b0be117f9d08b5aa86388678896", "score": "0.73819757", "text": "def has_available_server?\n server && !(server.unavailable? rescue true)\n end", "title": "" }, { "docid": "129503cdaede843f4f4677913b164764", "score": "0.7173052", "text": "def server_running?\n !! @server\n end", "title": "" }, { "docid": "2bef140d222d0c5c08dbc2ccd18304e2", "score": "0.7147356", "text": "def running?\n (@server != nil) && !@server.closed?\n end", "title": "" }, { "docid": "bd90c72de0114c7e5045c2aa73516b1f", "score": "0.7093994", "text": "def server?\n @server != nil\n end", "title": "" }, { "docid": "aaf2905c2fa69f5ddf09325dcd5fffa1", "score": "0.7073533", "text": "def server_defined?\n !!server\n end", "title": "" }, { "docid": "ad2c4337943455e8b27a70d27736457c", "score": "0.7064238", "text": "def server?\n config[:mode] == :server\n end", "title": "" }, { "docid": "ad2c4337943455e8b27a70d27736457c", "score": "0.7064238", "text": "def server?\n config[:mode] == :server\n end", "title": "" }, { "docid": "df1a2d81e1aa0cc333a4edfc4700b5f9", "score": "0.70163715", "text": "def server?\n @server\n end", "title": "" }, { "docid": "df7426635a530153b1b5c199940b7141", "score": "0.69690907", "text": "def running?\n !@server.nil?\n end", "title": "" }, { "docid": "5ade349814eacd58a4c878fd699d410d", "score": "0.69394255", "text": "def dev_server_running?\n return false unless run_proxy?\n return true if defined?(@running_at) && @running_at && Time.now - @running_at < 1\n\n Socket.tcp(config.host, config.port, connect_timeout: config.dev_server_connect_timeout).close\n @running_at = Time.now\n true\n rescue StandardError\n @running_at = false\n end", "title": "" }, { "docid": "5ade349814eacd58a4c878fd699d410d", "score": "0.6938515", "text": "def dev_server_running?\n return false unless run_proxy?\n return true if defined?(@running_at) && @running_at && Time.now - @running_at < 1\n\n Socket.tcp(config.host, config.port, connect_timeout: config.dev_server_connect_timeout).close\n @running_at = Time.now\n true\n rescue StandardError\n @running_at = false\n end", "title": "" }, { "docid": "7f1d5fcae51aeb76ec64e8dc13a9999b", "score": "0.68752754", "text": "def active?\n @server.active?\n end", "title": "" }, { "docid": "c992caf0880e91a1d3af15fedfbc1685", "score": "0.68658644", "text": "def running?\n running_server?\n end", "title": "" }, { "docid": "c992caf0880e91a1d3af15fedfbc1685", "score": "0.68658644", "text": "def running?\n running_server?\n end", "title": "" }, { "docid": "571b15951ad014b7256c99adf909f39d", "score": "0.6865389", "text": "def running?\n serverlist.include?(name)\n end", "title": "" }, { "docid": "089ae9f5007775f8f51d2d21aa0ecfb1", "score": "0.68601334", "text": "def running_remotely?(server, port)\n TCPSocket.new(server, port).close rescue return false\n return true\n end", "title": "" }, { "docid": "9d4c89999ee32984f265ee2e7168fb8f", "score": "0.6846223", "text": "def server_available?\n !in_latency_window.empty?\n end", "title": "" }, { "docid": "9d4c89999ee32984f265ee2e7168fb8f", "score": "0.6846223", "text": "def server_available?\n !in_latency_window.empty?\n end", "title": "" }, { "docid": "916014aa4cf69d9e0e314b3300c808cd", "score": "0.682636", "text": "def doi_server_reachable?\n Ezid::Client.new.server_status.up? rescue false\n end", "title": "" }, { "docid": "1e8d7b429a7d176d2e5ed496eac0414e", "score": "0.68238", "text": "def running_on_openqa_servers\n begin\n not `hostname -s`.grep(/(xserve|osxvm)/).empty?\n rescue Exception\n false\n end\nend", "title": "" }, { "docid": "adbcb4e547fa3d6581e1ee704e23671c", "score": "0.67891717", "text": "def server_running?\n # have to rely on nginx_port, which is a bit unstable,\n # because we're not setting up hostnames for each dat server,\n # so we can't just ping \"#{@server_name}.localhost:#{@http_port}\"\n begin\n response = Net::HTTP.get('localhost', '/', nginx_port)\n # make sure the response is actually info from a dat server\n return response.include? '\"datasets\":['\n rescue Errno::ECONNREFUSED\n return false\n end\n end", "title": "" }, { "docid": "d518dc74e6200920bc19f44444bb8c47", "score": "0.67806906", "text": "def available?\n return nil unless has_domain_and_server?\n status == :free\n end", "title": "" }, { "docid": "7496b5fe5cd0138136d6564d5675e741", "score": "0.67635113", "text": "def live_server?\n Settings.live_server\n end", "title": "" }, { "docid": "43fc220e6aa8baaa84359d0bec6a2fe7", "score": "0.67247134", "text": "def xserver_exist?(display)\n system({ \"DISPLAY\" => display }, \"xdpyinfo\", out: File::NULL, err: File::NULL)\n end", "title": "" }, { "docid": "aa542d5c4146529a313ad2087d35316b", "score": "0.6669881", "text": "def live_server\n live_server? && @@live_server\n end", "title": "" }, { "docid": "5b49260489e2ae6cee7e866377bd4199", "score": "0.66624045", "text": "def running?\n !!get_socket(0)\n end", "title": "" }, { "docid": "fc9ef8ffeec236be038a8dd041d35844", "score": "0.6658494", "text": "def ensure_available\n start! unless running?\n restart! if stalled?\n begin\n Timeout.timeout config.oo_server_availability_delay do\n while !available?\n log :debug, \". Waiting OpenOffice server availability\"\n sleep(0.5)\n end\n end\n rescue Timeout::Error\n raise Error, \"OpenOffice Server unavailable\"\n end\n true\n end", "title": "" }, { "docid": "0894091f89f661fd8644d11adc2f74eb", "score": "0.6639686", "text": "def app_server?\n connect do\n exit_status, stdout = exec \"ls #{DEPLOY_USER_HOME}\"\n return (exit_status == 0)\n end\n end", "title": "" }, { "docid": "7ca1232c8f66ecde27636a55a255c877", "score": "0.6635871", "text": "def connected?\n server\n end", "title": "" }, { "docid": "0c3293e0c6e7b7cda639df4444ec37f7", "score": "0.66244674", "text": "def identifier_server_reachable?\n Ezid::Client.new.server_status.up?\n rescue\n false\n end", "title": "" }, { "docid": "75ca416a3db34dc89247628bd1a34597", "score": "0.6622499", "text": "def alive?\n server = Biomart::Server.new( @url )\n return server.alive?\n end", "title": "" }, { "docid": "bee00cdc687ba383d4ae1f2f8b4d5b2b", "score": "0.6608183", "text": "def check_rc_service(server_name)\n success = false\n begin\n request = Net::HTTP.get_response(URI.parse(\"#{server_name}/console\"))\n if request.code == '200'\n success = true\n end\n rescue\n end\n success\n end", "title": "" }, { "docid": "81d44e756c5d1ec40d45f906f78277cd", "score": "0.66061884", "text": "def available?\n client.get(url_for_path('/')) { |response| response.code == 200 } rescue false\n end", "title": "" }, { "docid": "db9425662b8b5dde0f49115e70ab6943", "score": "0.6601672", "text": "def running?\n @server&.thread&.alive?\n end", "title": "" }, { "docid": "30f4448350dcb20be5f8dd131f716024", "score": "0.6600396", "text": "def server_supported?(server)\n true\n end", "title": "" }, { "docid": "f38584c17fb0f0c4947eec034a2a98aa", "score": "0.65976465", "text": "def active?\r\n not @servers.empty?\r\n end", "title": "" }, { "docid": "3a71957fe6a720d0dd65437ce633af6c", "score": "0.6595531", "text": "def running?\n @server_thread&.alive?\n end", "title": "" }, { "docid": "d20da8583df199dacaaf417c52a8622c", "score": "0.65837973", "text": "def server?\n !local?\n end", "title": "" }, { "docid": "005185bfa8f8e0e769a930ba55ccd198", "score": "0.6568538", "text": "def running?\n !@server.nil? && @running && @server.status == :Running\n end", "title": "" }, { "docid": "49cf86153422f1af8b16cf297954018b", "score": "0.65669185", "text": "def active?\n not @servers.empty?\n end", "title": "" }, { "docid": "b95aad7011b1e12f114af93dfc101611", "score": "0.6566079", "text": "def live_server\n live_server? and @@live_server\n end", "title": "" }, { "docid": "db2bd1dc7d1a5023e02c51ec3ba9bb39", "score": "0.6561927", "text": "def puma_server?\n $PROGRAM_NAME.include?('puma') && Puma.const_defined?('Server')\n end", "title": "" }, { "docid": "f9200b274e64ffd003b2ef430b7ea545", "score": "0.65527445", "text": "def check_conn?\n begin\n res = send_request_cgi('uri' => '/', 'method' => 'GET')\n if res\n vprint_good(\"Server is responsive...\")\n return true\n end\n rescue ::Rex::ConnectionRefused,\n ::Rex::HostUnreachable,\n ::Rex::ConnectionTimeout,\n ::Rex::ConnectionError,\n ::Errno::EPIPE\n end\n false\n end", "title": "" }, { "docid": "f1bc958e757c102e27ec72d818ead0a1", "score": "0.6544079", "text": "def rails_server?\n Rails.const_defined?('Server')\n end", "title": "" }, { "docid": "7e78cadcfffc3e33475b45000f294df4", "score": "0.65409726", "text": "def server_reachable?(server_url)\n uri = URI.parse(server_url)\n request = Net::HTTP.new(uri.host, uri.port)\n request.read_timeout = 2\n response = nil\n begin\n response = request.request(create_request(server_url, :get))\n rescue StandardError, Timeout::Error\n end\n !response.nil? && response.code.to_i == 200\n end", "title": "" }, { "docid": "81c9945f6d58131cd2407ff4be087b72", "score": "0.6528956", "text": "def online?\n @server.call(\"aria2.getVersion\")\n return true\n rescue\n return false\n end", "title": "" }, { "docid": "b2f9996925880c68923b1949e44a0ac8", "score": "0.65244085", "text": "def is_server?\n return (self.type == Host::TYPE_SERVER)\n end", "title": "" }, { "docid": "d0896dd723f372828d86165282dca353", "score": "0.651435", "text": "def active?\n\t\tnot @servers.empty?\n\tend", "title": "" }, { "docid": "56246ed2c50318408a018c1a6f8d3cf5", "score": "0.651202", "text": "def is_localhost_mode?\n true\n end", "title": "" }, { "docid": "56246ed2c50318408a018c1a6f8d3cf5", "score": "0.651202", "text": "def is_localhost_mode?\n true\n end", "title": "" }, { "docid": "a654ad297f50cc2cb4ac41c4351560da", "score": "0.65111434", "text": "def active?\n not @servers.empty?\n end", "title": "" }, { "docid": "429dcd86748018a4811ee1a3d9934cd4", "score": "0.6503004", "text": "def server?\n return (@type == 'server') ? true : false\n end", "title": "" }, { "docid": "1c1ac2beb05f11180c1fb89f42e5cb1d", "score": "0.6470717", "text": "def server_is_up?\n begin\n # -s: silent, -S: show error messages\n env_settings = Fezzik.environments[hostname]\n command = \"curl -s -S --max-time 6 localhost:#{env_settings[:immunity_server_port]}/healthz\"\n puts \"checking: #{command}\"\n healthz_output = Fezzik::Util.capture_output { run command }\n raise \"/healthz responded with: #{healthz_output}\" unless healthz_output.downcase.include?(\"healthy\")\n true\n rescue Exception => error\n puts \"The service is down. It may have had trouble starting.\"\n raise error\n end\n end", "title": "" }, { "docid": "5c8f058c086a3c882f794aa1e5794815", "score": "0.6449668", "text": "def isWebServerRunning()\n http = Net::HTTP.start(HOST, PORT)\n response = http.head(\"/\")\n response.code == \"200\"\nrescue SystemCallError\n false\nend", "title": "" }, { "docid": "5c8f058c086a3c882f794aa1e5794815", "score": "0.6449668", "text": "def isWebServerRunning()\n http = Net::HTTP.start(HOST, PORT)\n response = http.head(\"/\")\n response.code == \"200\"\nrescue SystemCallError\n false\nend", "title": "" }, { "docid": "42eccc761aa938fe00631278127c3173", "score": "0.6423837", "text": "def any_connected? options=nil\n each options do |server_app|\n return true if server_app.shell.connected?\n end\n\n false\n end", "title": "" }, { "docid": "da3ae3d6da618e46df98112dd42725b8", "score": "0.64159274", "text": "def is_server?(server)\n address == server.address\n end", "title": "" }, { "docid": "6269a2cb38d25bd7154fbae738115993", "score": "0.64057994", "text": "def in_server_process?\n return @_in_server_process if defined? @_in_server_process\n\n @_in_server_process = Rails.const_defined?('Server') ||\n caller.grep(%r{config.ru}).any? || # EXAMPLE: config.ru:3:in `block in <main>' OR config.ru:3:in `new_from_string'\n caller.grep(%{/rack/handler/}).any? || # EXAMPLE: iodine-0.7.44/lib/rack/handler/iodine.rb:13:in `start'\n (Concurrent.on_jruby? && caller.grep(%r{jruby/rack/rails_booter}).any?) # EXAMPLE: uri:classloader:/jruby/rack/rails_booter.rb:83:in `load_environment'\n end", "title": "" }, { "docid": "33cb58bdf0a9ce38791c1fc73e315e71", "score": "0.6403122", "text": "def on_localhost?\n host_id == 'localhost'\n end", "title": "" }, { "docid": "e96c2eb8769c5fa74521b5f1d732841a", "score": "0.6402288", "text": "def networked?\n Puppet.run_mode.server?\n end", "title": "" }, { "docid": "144a635788f6473d673f2bf81089f441", "score": "0.6400628", "text": "def connected? options=nil\n each options do |server_app|\n return false unless server_app.shell.connected?\n end\n\n true\n end", "title": "" }, { "docid": "df17576e44d62c7cbb4369c17aa5caa0", "score": "0.6399897", "text": "def check_server\n # Get the OS Name\n cmd_exec(\"/usr/bin/sw_vers\", \"-productName\") =~/Server/\n end", "title": "" }, { "docid": "cfd2f13e3cc765fbbea7c4f80c96fa04", "score": "0.63973004", "text": "def alive?\n begin\n get(\"servers/#{id}\")\n rescue ServiceNotAvailable\n return false\n end\n !!(@config = @response if @response &&\n @response['procInfo'] &&\n @response['procInfo']['alive'])\n end", "title": "" }, { "docid": "8e70c70b1b190fb9a45db573fb92fc41", "score": "0.6383502", "text": "def command_available?\n case self.server\n when 'passenger'\n gem_available?('passenger')\n when 'thin'\n gem_available?('thin')\n when 'mongrel'\n gem_available?('mongrel')\n else\n raise DevserverError, \"Unrecognized web server: #{self.server}\"\n end\n end", "title": "" }, { "docid": "ab59de75bc400b943d4cba8958fe7009", "score": "0.6371712", "text": "def server_reachable?(server_url)\n uri = URI.parse(server_url)\n request = Net::HTTP.new(uri.host, uri.port)\n request.read_timeout = 2\n response = nil\n begin\n response = request.request(create_request(server_url, :get))\n rescue StandardError, Timeout::Error => e\n end\n !response.nil? && response.code.to_i >= 200 && response.code.to_i < 500\n end", "title": "" }, { "docid": "93adb2d386de93eca0dace4f6180fef8", "score": "0.6370571", "text": "def is_jetty_running?(params)\n Jettywrapper.configure(params)\n pid = Jettywrapper.instance.pid\n return false unless pid\n true\n end", "title": "" }, { "docid": "12d46771bf153aca848538619d4e8a44", "score": "0.6345574", "text": "def host_available?\n HostLookup.available? @host, @options[:host_timeout]\n end", "title": "" }, { "docid": "401b75be2989575096fd1177a0557f5f", "score": "0.63359666", "text": "def server_process?\n @server_process_pid == Process.pid\n end", "title": "" }, { "docid": "0f9189bad0f64b5d7bce92af87ee19b3", "score": "0.6333057", "text": "def alive?\n begin\n srv = DRb.fetch_server(@uri)\n return srv.nil? ? false : srv.alive?\n rescue\n logger.error $!.message\n return false\n end\n end", "title": "" }, { "docid": "369d42642eedaddbe21baff96eeed0f7", "score": "0.63074356", "text": "def port_available?(port)\n server = TCPServer.open port\n server.close\n true\n rescue Errno::EADDRINUSE\n false\n end", "title": "" }, { "docid": "c1ac0e033ed15d64b75c3a273fa2c799", "score": "0.62964725", "text": "def zeus_running?\n File.exist? '.zeus.sock'\nend", "title": "" }, { "docid": "75dd9358f855174e29885d5122d44a61", "score": "0.62840295", "text": "def check_server\n return true if test?\n check_url = \"#{server_url}/SyfFKj2rKt3CoKnELR1Io4ZDoSa70000\"\n uri = URI.parse(check_url)\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true if uri.scheme == 'https'\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE unless verify_ssl?\n response = http.request_get(uri.request_uri)\n return response.is_a?(Net::HTTPSuccess)\n rescue\n return false\n end", "title": "" }, { "docid": "fb1731769230a83c41beeb01aecade27", "score": "0.62763304", "text": "def running?\n !!@server_signature\n end", "title": "" }, { "docid": "88d95621c2c49d88c1bb41034d2ee2a2", "score": "0.62763065", "text": "def running?\n return false if @server_thread && @server_thread.join(0)\n\n res = Net::HTTP.start(local_host, @port) { |http| http.get('/__identify__') }\n\n if res.is_a?(Net::HTTPSuccess) or res.is_a?(Net::HTTPRedirection)\n return res.body == @app.object_id.to_s\n end\n rescue Errno::ECONNREFUSED, Errno::EBADF, EOFError\n return false\n end", "title": "" }, { "docid": "a304681d267e7437d9730449beb21d7a", "score": "0.6274701", "text": "def check_server(check_url)\n response = Net::HTTP.get_response(URI(check_url))\n response.is_a?(Net::HTTPSuccess)\n rescue OpenURI::HTTPError, Errno::ECONNREFUSED, SocketError\n false\n end", "title": "" }, { "docid": "adf5d9ee7ca54623ccc3d3092dcf82f2", "score": "0.6274574", "text": "def server?\n $PROGRAM_NAME.end_with?('karafka') && ARGV.include?('server')\n end", "title": "" }, { "docid": "e7cc1bea8495122e3d8979209c0e050b", "score": "0.627388", "text": "def running?\n listening?\n end", "title": "" }, { "docid": "72aacf46babf483ef15dc4ecaedc6008", "score": "0.62713844", "text": "def running?\n begin\n http_get(@url) and return true\n rescue Errno::ECONNREFUSED\n return false\n end\n end", "title": "" }, { "docid": "53fb83041068a7232aca47ab84935e0d", "score": "0.62689364", "text": "def in_server_process?\n return @_in_server_process if defined? @_in_server_process\n\n @_in_server_process = Rails.const_defined?(:Server) || begin\n self_caller = caller\n\n self_caller.grep(%r{config.ru}).any? || # EXAMPLE: config.ru:3:in `block in <main>' OR config.ru:3:in `new_from_string'\n self_caller.grep(%r{puma/request}).any? || # EXAMPLE: puma-5.6.4/lib/puma/request.rb:76:in `handle_request'\n self_caller.grep(%{/rack/handler/}).any? || # EXAMPLE: iodine-0.7.44/lib/rack/handler/iodine.rb:13:in `start'\n (Concurrent.on_jruby? && self_caller.grep(%r{jruby/rack/rails_booter}).any?) # EXAMPLE: uri:classloader:/jruby/rack/rails_booter.rb:83:in `load_environment'\n end\n end", "title": "" }, { "docid": "c3bdc846e20a7570585c8dce1365152e", "score": "0.626253", "text": "def connected?\n begin\n srv = DRb.fetch_server(@uri)\n return false if srv.nil?\n return !srv.front.nil?\n rescue\n logger.debug $!.message\n return false\n end\n end", "title": "" }, { "docid": "48f5dee1f1195f51d5a2d69192e7eb7f", "score": "0.62584215", "text": "def running?\n return false if @server_thread && @server_thread.join(0)\n\n res = Net::HTTP.start(local_host, @port) { |http| http.get('/__identify__') }\n\n if res.is_a?(Net::HTTPSuccess) or res.is_a?(Net::HTTPRedirection)\n return res.body == @app.object_id.to_s\n end\n rescue Errno::ECONNREFUSED, Errno::EBADF\n return false\n end", "title": "" }, { "docid": "85c0c3f8daf69a6856d57708be409c05", "score": "0.62548065", "text": "def client_running?\n client_running = check_running_for_type(\"client\")\n return false unless client_running\n end", "title": "" }, { "docid": "b5ff6e905c3b2e38f2d52a889f8b4951", "score": "0.6250105", "text": "def running?\n !!system(mysql_server_path.to_s, 'status', out: '/dev/null', err: '/dev/null')\n end", "title": "" }, { "docid": "4756e3148db69ae77a3e4f42afd1e630", "score": "0.62369335", "text": "def es_is_running?\n require 'socket'\n if @config.nil?\n # getting the longer line possible to avoid problems in different operating systems.\n process_status = system(\"ps auxwwww | grep org.elasticsearch.bootstrap | grep -v grep >> /dev/null\")\n return process_status\n else\n net_status = TCPSocket.open(@config['host'], @config['port'].to_i)\n if net_status.nil?\n return false\n else\n return true\n end\n end\n end", "title": "" }, { "docid": "c702e23175849172679b76d57916c03e", "score": "0.6226357", "text": "def is_server_running?(server=@server)\n begin\n pid_file = ::File.join(server.path, 'php.pid')\n\n if ::File.exists?(pid_file)\n pid = ::File.read(pid_file).to_i\n return ::Process.kill(0, pid) == 1\n end\n\n return false\n rescue\n return false\n end\n end", "title": "" }, { "docid": "73b46e7d24b2065f9b614aee5fe4834a", "score": "0.62232184", "text": "def serving?\n @serve_thread && @serve_thread.alive? && @socket && !@socket.closed?\n end", "title": "" }, { "docid": "94d39464afb65691067f2ec68ff232f4", "score": "0.6221162", "text": "def registered_in_mappy_server?\n is_main_sub_env? ? @client[:mainnet_statuses].include?(GlobalConstant::Client.mainnet_registered_in_mappy_server_status) :\n @client[:sandbox_statuses].include?(GlobalConstant::Client.sandbox_registered_in_mappy_server_status)\n end", "title": "" }, { "docid": "3d450e8d354f4e82ff31b91eada59d9c", "score": "0.62123585", "text": "def server_running_on_port?(port)\n Shell.execute('ps aux | grep ttserver').chomp.split(\"\\n\").any? { |line| line =~ /-port #{port}/ }\n end", "title": "" }, { "docid": "2d2a6c2f82ea26ec34d1e4e7fc9109db", "score": "0.6207046", "text": "def running?(options_or_url = {:port => 7001})\n HTTParty.get(mirage_url(options_or_url))\n true\n rescue Errno::ECONNREFUSED\n false\n end", "title": "" }, { "docid": "089a7b7e5f2d96511cb39a5e4b1512c4", "score": "0.6198769", "text": "def byebug_has_client?\n require 'byebug/core'\n\n ObjectSpace.each_object(Byebug::RemoteInterface).count > 0\nend", "title": "" }, { "docid": "00f4738f934c8e7d35ad7a175b0bb4e4", "score": "0.6195144", "text": "def em_compatible?\n COMPATIBLE_SERVERS.include?(@rack)\n end", "title": "" }, { "docid": "e70b9f10365f69bdbd03ae9a17a4e0d0", "score": "0.6183853", "text": "def service_listening?\n cmd = shell_out!('netstat -lnt')\n cmd.stdout.each_line.select do |l|\n l.split[3] =~ /#{new_resource.port}/\n end.any?\n end", "title": "" }, { "docid": "e70b9f10365f69bdbd03ae9a17a4e0d0", "score": "0.6183853", "text": "def service_listening?\n cmd = shell_out!('netstat -lnt')\n cmd.stdout.each_line.select do |l|\n l.split[3] =~ /#{new_resource.port}/\n end.any?\n end", "title": "" }, { "docid": "8f0d7f58eb0bb57ae216008095083ea5", "score": "0.6176985", "text": "def start?\n !File.exists?(socket_path)\n end", "title": "" }, { "docid": "c8be3231a8e51a6ac942beda269cd43d", "score": "0.61757445", "text": "def service_available?\n true\n end", "title": "" }, { "docid": "471f5a8685fa4e64c6114ec9ea323b63", "score": "0.6173176", "text": "def running?\n case\n when pid_file\n running_via_pid_file?\n when port\n TCPSocket.listening_service?(:port => port, :host => host || \"127.0.0.1\")\n else raise \"Service Manager needs to be able to tell if the service is already running or not. You'll need to specify a pid file or a TCP port to check.\"\n end\n end", "title": "" }, { "docid": "471f5a8685fa4e64c6114ec9ea323b63", "score": "0.6173176", "text": "def running?\n case\n when pid_file\n running_via_pid_file?\n when port\n TCPSocket.listening_service?(:port => port, :host => host || \"127.0.0.1\")\n else raise \"Service Manager needs to be able to tell if the service is already running or not. You'll need to specify a pid file or a TCP port to check.\"\n end\n end", "title": "" }, { "docid": "f52284f42f7716c17caea725dbfc02aa", "score": "0.6162044", "text": "def server_supported?(server)\n Util.dell_cert?(server.puppet_certname)\n end", "title": "" }, { "docid": "f757647d341672c17ef0307094df0453", "score": "0.6159679", "text": "def status\n each_server_app do |server_app|\n server_app.shell.call _status_cmd, :sudo => pick_sudo(server_app.shell)\n end\n true\n\n rescue CmdError => e\n false\n end", "title": "" }, { "docid": "d245b5341b98f17b57ff8ee879f81119", "score": "0.61539495", "text": "def has_readable_server?(cluster, server_selector = nil); true; end", "title": "" }, { "docid": "d245b5341b98f17b57ff8ee879f81119", "score": "0.61539495", "text": "def has_readable_server?(cluster, server_selector = nil); true; end", "title": "" } ]
68d59ed6f391232c45849976d20a0bd8
Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.notifier.reset_password.subject
[ { "docid": "bc632380da5c0197226bc4f73d56eda8", "score": "0.0", "text": "def reset_password\n # TODO: Implement actual functionality -- Wed Jun 13 15:26:53 2012\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "title": "" } ]
[ { "docid": "f88ce5d7aca9a41a22b4857ad5c13749", "score": "0.6762878", "text": "def notify_password_reset!\n with_user_locale do\n reset_single_access_token!\n UserMailer.password_reset(self).deliver!\n end\n end", "title": "" }, { "docid": "5c49df176c0d8b63b317043e3510b06b", "score": "0.67390114", "text": "def forgot_password(user)\n setup_email(user)\n subject \"Password Reset\"\n end", "title": "" }, { "docid": "2f2df066fb9cdec29ff6d64e3ba73a78", "score": "0.6672825", "text": "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", "title": "" }, { "docid": "a4d71fab88f218109eb04432736a8fb8", "score": "0.65418005", "text": "def password_reset(user)\n @user = user\n mail :to => user.email, :subject => I18n.t(\"reset_password\")\n end", "title": "" }, { "docid": "a081976746494bbddb550849c6e6cf2e", "score": "0.64854366", "text": "def subject\n self['subject'] || msg['subject']\n end", "title": "" }, { "docid": "778191bf4265233252452c0170aeff85", "score": "0.6411023", "text": "def reset_password(user)\n @recipients = user.email\n @from = \"#{Site.current.email}\"\n @body [\"name\"] = user.login\n @subject = 'Your password has been reset'\n end", "title": "" }, { "docid": "84daa29168e8b9526810e95c2a48dbd0", "score": "0.64008147", "text": "def email_welcome_and_pass\r\nold_gt = I18n.locale\r\nI18n.locale = self.language unless self.language.blank?\r\nUserMailer.deliver_account_infos(self, @password) # Uniq time with decoded password\r\nI18n.locale = old_gt\r\nend", "title": "" }, { "docid": "b66cc811f865f67c34371a9356027927", "score": "0.63871706", "text": "def reset_password_email(user)\n @user = User.find user.id\n @url = edit_password_reset_url(@user.reset_password_token)\n mail(to: user.email,\n subject: \"[Fjord Bootcamp] #{I18n.t(\"your_password_has_been_reset\")}\")\n end", "title": "" }, { "docid": "937eab6dc402ba40a9ec371589669147", "score": "0.63730806", "text": "def subject\n @options.fetch(:subject) { \"Invitation\" }\n end", "title": "" }, { "docid": "b2b8b7ec62fdce28fce2d13055b6ad9d", "score": "0.6370604", "text": "def reset_notification(user)\n\t\tsetup_email(user)\n\t\tsubject self.site_name+\" : \"+I18n.t('mailer.reset_notification.subject')\n\t\tbody :url => self.daurl+\"/admin/reset_password/#{user.password_reset_code}\",\n\t\t\t:user_login => user.login,\n\t\t\t:site => self.site_name\n end", "title": "" }, { "docid": "8780eaf874a22b8575f2c8ae110d8df9", "score": "0.6358357", "text": "def message_subject=(value)\n @message_subject = value\n end", "title": "" }, { "docid": "ef27f3bd3b0ca06dc1ace2079677a395", "score": "0.6346885", "text": "def password_reset(user)\n mail_to user, password_reset_subject\n end", "title": "" }, { "docid": "89cd8bc92412abe012c3071768c65beb", "score": "0.6341628", "text": "def reset_password_email(user)\n @user = user\n @password_reset_url = edit_password_reset_url(user.reset_password_token)\n mail to: user.email, subject: \"Reset your VCDelta.org password\"\n end", "title": "" }, { "docid": "7340e1b50db5724d885f8fef625f675f", "score": "0.63344544", "text": "def reset_password_subject(token, server_hostname, protocol)\n \"#{server_hostname} password reset\"\n end", "title": "" }, { "docid": "573ef75f60444813d29ace09164c2af0", "score": "0.63273066", "text": "def reset_password\n [send_email(MailPart.new_subject(I18n.t('devise.mailer.reset_password_instructions.subject')),\n nil,\n MailPart.new_body(''),\n EmailStuff::TYPES[:reset_password],\n reset_pass_call),\n @candidate_mailer_text.token]\n end", "title": "" }, { "docid": "c10c28f5ede72c493837c401fd149038", "score": "0.62745005", "text": "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", "title": "" }, { "docid": "40fb622a43743fc984cbe8a2ff2617e3", "score": "0.6258888", "text": "def password_reset(user)\n @user = user\n mail to: user.email, subject: \"Återställning av ditt lösenord på Biblion.\"\n end", "title": "" }, { "docid": "912a77d32c7c004d020596270cae0c0c", "score": "0.62393075", "text": "def password_reset\n AccountMailer.password_reset\n end", "title": "" }, { "docid": "87161814f98bfdab21f8385c8709bfdc", "score": "0.6236337", "text": "def reset_password_instructions(resource, token, _options)\n @resource = resource\n @token = token\n mail(\n to: resource.email,\n subject: ['¿Solicitaste un cambio de contraseña en tus servicios de ',\n 'GurúComm?'].join('')\n )\n end", "title": "" }, { "docid": "b96af7031f0041ab8c83692aa21c2d65", "score": "0.6234433", "text": "def subject\n @mail.subject\n end", "title": "" }, { "docid": "89fee23fbcdc294771274b42a8f3a5e8", "score": "0.6230545", "text": "def password_reset_mail(user)\n subject \"Password Reset Instructions\"\n from \"sender_email_id@test.com\"\n recipients user\n content_type \"text/html\"\n sent_on Time.now\n body \"RESET your Password\"\n end", "title": "" }, { "docid": "7e36dfb55bc363e97ec60ec7a716fcaa", "score": "0.6217302", "text": "def reset_password_email(user)\n @user = user\n @url = edit_password_reset_url(@user.reset_password_token)\n @subject = \"[#{SITE_NAME}] Password reset request\"\n mail(bcc: @user.email, subject: @subject)\n end", "title": "" }, { "docid": "20df65b2b955b425aa84acb470231150", "score": "0.62168807", "text": "def set_EmailSubject(value)\n set_input(\"EmailSubject\", value)\n end", "title": "" }, { "docid": "20df65b2b955b425aa84acb470231150", "score": "0.6216021", "text": "def set_EmailSubject(value)\n set_input(\"EmailSubject\", value)\n end", "title": "" }, { "docid": "c9a55e168455e148efe4e5016c775adb", "score": "0.6212323", "text": "def password_reset\n UserMailMailer.password_reset\n end", "title": "" }, { "docid": "e02b52e7d648e6cbd6506ee3fa1f695f", "score": "0.6211145", "text": "def password_reset(teacher)\n @teacher = teacher\n mail to: teacher.email, subject: \"Password reset\"\n end", "title": "" }, { "docid": "b432e01c1c140f6b86dc4b68b9a04239", "score": "0.6210681", "text": "def password_reset\n #@greeting = \"Pershendetje\"\n\n #mail to: \"to@example.org\"\n end", "title": "" }, { "docid": "9156db726e034189d3557f9a003748fd", "score": "0.6205685", "text": "def student_password_reset\n StudentMailer.student_password_reset\n end", "title": "" }, { "docid": "1b26cae96067a5e6718a60f8697fddce", "score": "0.6202214", "text": "def password_reset\n MailerMailer.password_reset\n end", "title": "" }, { "docid": "b6f4b031ed7b6a6d5dfa7c1de05d0edb", "score": "0.6198084", "text": "def reset_password_email\n UserMailer.reset_password_email(User.first)\n end", "title": "" }, { "docid": "dad0289353f8fc4a21d9c4499908ada0", "score": "0.61811817", "text": "def password_reset\n Notifications.password_reset\n end", "title": "" }, { "docid": "d2f26cb27e81ae8b03fd141a0f231955", "score": "0.61730653", "text": "def subject=(subject); @message_impl.setSubject subject; end", "title": "" }, { "docid": "8b3551aca7e91fb3dc7f29da6cf16c35", "score": "0.6168651", "text": "def reset_notification(doctor)\n setup_email(doctor)\n @subject += 'Link to reset your password'\n @body[:url] = \"http://msgSmart.com/reset/#{doctor.reset_code}\"\n end", "title": "" }, { "docid": "ad071d6c229bdd849fadf58a4a083db3", "score": "0.6140469", "text": "def translate(mapping, key)\n I18n.t(:\"#{mapping.name}_subject\", :scope => [:devise, :mailer, key],\n :default => [:subject, key.to_s.humanize])\n end", "title": "" }, { "docid": "44d4f726ddfff995dcd65a68912ec47e", "score": "0.6140242", "text": "def reset_password_email\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "title": "" }, { "docid": "32569602b3f40917a09a55a2398741e5", "score": "0.61359614", "text": "def reset_password(user)\n setup_email(user)\n subject \"Password reset link\"\n\n body :user => user, :host => FROM_HOST\n end", "title": "" }, { "docid": "1b753f10b336a500338de770d8bf274d", "score": "0.61338407", "text": "def reset_password_email(user)\n @user = User.find(user.id)\n @url = edit_password_reset_url(@user.reset_password_token)\n mail(:to => user.email,\n :subject => \"パスワードリセットのご案内\")\n end", "title": "" }, { "docid": "fe60ba06f4615ffe52abca30852a3fe1", "score": "0.61316067", "text": "def password_reset\n UserMailer.password_reset\n end", "title": "" }, { "docid": "fe60ba06f4615ffe52abca30852a3fe1", "score": "0.61316067", "text": "def password_reset\n UserMailer.password_reset\n end", "title": "" }, { "docid": "fe60ba06f4615ffe52abca30852a3fe1", "score": "0.61316067", "text": "def password_reset\n UserMailer.password_reset\n end", "title": "" }, { "docid": "4a65e5d8ee70b790d61af5b516e9babb", "score": "0.61303574", "text": "def reset_password_instructions(token, resource)\n @token = token\n @resource = resource\n mail to: @resource, subject: \"Reset your password\"\n end", "title": "" }, { "docid": "6d57859e25b3fac6ddfa299b51492592", "score": "0.6127621", "text": "def password_reset( user )\n @user = user\n mail( to: @user.email, subject: 'Restablecer contraseña Happitch' )\n end", "title": "" }, { "docid": "07af6a4687a8a88857c0859f085322a0", "score": "0.6127316", "text": "def reset_password_instructions(user)\n @resource = user\n mail(:to => @resource.email,\n :subject => \"Reset password instructions\",\n :tag => 'password-reset',\n :content_type => \"text/html\") do |format|\n format.html { render \"devise/mailer/reset_password_instructions\" }\n end\n end", "title": "" }, { "docid": "456e20539132b12952c82d91f62f4f0f", "score": "0.6123911", "text": "def i18n_label\n \"email.#{name}_label\"\n end", "title": "" }, { "docid": "3bb0d3bd717c20b62d1b28a7b81522ea", "score": "0.6120646", "text": "def password_reset\n PenggunaMailer.password_reset\n end", "title": "" }, { "docid": "249e7c3ce72515985a038a799bd5d4f3", "score": "0.61177254", "text": "def password_reset(user)\n @user = user\n mail :to => user.email#, :subject => t(\"Password_Reset\")\n end", "title": "" }, { "docid": "f3c6c5e6185dd926ede5b19d88f3b473", "score": "0.6115932", "text": "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", "title": "" }, { "docid": "bd1a30d7684555f505953edd1b57298e", "score": "0.6110163", "text": "def subject=(string)\n set('Subject', string)\n end", "title": "" }, { "docid": "eba00cc822db436dc6235330f971468b", "score": "0.6108203", "text": "def forgot_password(user)\n @recipients = user.email\n @from = \"#{Site.current.email}\"\n @subject = 'Request to change your password'\n @body [\"name\"] = user.login\n @body[\"url\"] = \"http://#{Site.current.domain}/reset_password/#{user.reset_password_code}\" \n end", "title": "" }, { "docid": "6bba6b0e29e449327299b49843f05fb9", "score": "0.6098615", "text": "def send_password_reset_email\n \t\tUserMailer.password_reset(self).deliver_now\n \tend", "title": "" }, { "docid": "204b69b8a21eae6128636fcbf881e6a5", "score": "0.6098436", "text": "def subject\n @subject ||= Envelope::MessageTools.normalize(message.subject || '')\n end", "title": "" }, { "docid": "998901594800e389ec7dd2bbe7dff314", "score": "0.6081885", "text": "def set_EmailSubject(value)\n set_input(\"EmailSubject\", value)\n end", "title": "" }, { "docid": "998901594800e389ec7dd2bbe7dff314", "score": "0.60812336", "text": "def set_EmailSubject(value)\n set_input(\"EmailSubject\", value)\n end", "title": "" }, { "docid": "63f782131a271163fff5fcf26434a34e", "score": "0.6077756", "text": "def password_reset(user)\n @user = user\n\n mail to: user.email, subject: t(:mailer_user_password_reset_subject)\n end", "title": "" }, { "docid": "2612f91edf11e6d8f615d66b5cf02cd7", "score": "0.6068568", "text": "def password_was_changed_notice\n @email = params[:email]\n @token = params[:token]\n\n mail to: @email, subject: 'Your password was changed'\n end", "title": "" }, { "docid": "b146b76de5c58c1983764f64f752120d", "score": "0.60615045", "text": "def forgot_password\n NotificationsMailer.forgot_password\n end", "title": "" }, { "docid": "b146b76de5c58c1983764f64f752120d", "score": "0.60615045", "text": "def forgot_password\n NotificationsMailer.forgot_password\n end", "title": "" }, { "docid": "b146b76de5c58c1983764f64f752120d", "score": "0.60615045", "text": "def forgot_password\n NotificationsMailer.forgot_password\n end", "title": "" }, { "docid": "f6005e5cc061fc986cb4c9bd4e5b86bb", "score": "0.60538685", "text": "def send_password_reset_email\n AdminMailer.password_reset(self).deliver_now\n end", "title": "" }, { "docid": "703df72b6a4f10915f3db094db4ffe22", "score": "0.60457313", "text": "def send_password_reset_email\n UserMailer.password_reset(self).deliver\n end", "title": "" }, { "docid": "703df72b6a4f10915f3db094db4ffe22", "score": "0.60457313", "text": "def send_password_reset_email\n UserMailer.password_reset(self).deliver\n end", "title": "" }, { "docid": "703df72b6a4f10915f3db094db4ffe22", "score": "0.60457313", "text": "def send_password_reset_email\n UserMailer.password_reset(self).deliver\n end", "title": "" }, { "docid": "703df72b6a4f10915f3db094db4ffe22", "score": "0.60457313", "text": "def send_password_reset_email\n UserMailer.password_reset(self).deliver\n end", "title": "" }, { "docid": "703df72b6a4f10915f3db094db4ffe22", "score": "0.60457313", "text": "def send_password_reset_email\n UserMailer.password_reset(self).deliver\n end", "title": "" }, { "docid": "703df72b6a4f10915f3db094db4ffe22", "score": "0.60457313", "text": "def send_password_reset_email\n UserMailer.password_reset(self).deliver\n end", "title": "" }, { "docid": "ed40be9bb8386d468f7a278e4f550ca9", "score": "0.60407", "text": "def forgot_password_mail\n Accounts.forgot_password_mail\n end", "title": "" }, { "docid": "3290c1d3d209fe4d2249c192a0287c7a", "score": "0.60381943", "text": "def send_password_reset_email\n BandMailer.password_reset(self).deliver!\n end", "title": "" }, { "docid": "101181ccedd19606b587b73e0d412055", "score": "0.60362697", "text": "def send_password_reset_email\n \t\tUserMailer.password_reset(self).deliver_now\n \tend", "title": "" }, { "docid": "2809fb6fbc32df25c8f9ac041c0ba932", "score": "0.6034441", "text": "def password_reset(user)\n @user=user\n mail(:to=>@user.email,:subject=>\"Hey there! Thanks for using instaprint\")\n#mail (:to=>@user.email,:from=>'basics.aki@gmail.com',:subject=>\"Please find the password reset instructions\")\n end", "title": "" }, { "docid": "5b80a3ad8ace61be3de54a2535be5e5d", "score": "0.60267025", "text": "def send_password_reset_email\n\t UserMailer.password_reset(self).deliver_now\n\tend", "title": "" }, { "docid": "918888d4b53f0c9631a4224310a3a332", "score": "0.6025667", "text": "def password_reset(user)\n @user = user\n mail to: user.email, subject: \"Password reset for TechScreen.net\"\n end", "title": "" }, { "docid": "ba5cd7362361fd28769f9c2e8d510298", "score": "0.60243845", "text": "def password_reset\n MemberMailer.password_reset\n end", "title": "" }, { "docid": "741925250c25829716275d92206cf7ed", "score": "0.60241544", "text": "def send_password_reset_email\n\t UserMailer.password_reset(self).deliver_now\n\tend", "title": "" }, { "docid": "2270296c2588c46db89b87d2fe7ea583", "score": "0.6019934", "text": "def reset_password_email(user)\n @user = user\n @url = edit_forgot_password_url(user.reset_password_token)\n mail(to: user.email,\n subject: \"Your ClosetGroupie password has been reset\")\n end", "title": "" }, { "docid": "a66e92b4c02a13bb6e6f888a5ab6c26f", "score": "0.60194206", "text": "def send_password_reset_email\r\n UserMailer.password_reset(self).deliver!\r\n end", "title": "" }, { "docid": "5173417cc10e7cb32e81014074257fb7", "score": "0.6014302", "text": "def send_password_reset_email\n UserMailer.password_reset(self.class.name.to_s.downcase.pluralize, self).deliver_now\n logger.info \"email: admin password reset sent to #{email}\"\n end", "title": "" }, { "docid": "1b7172047adcb44bc1cb61daf152742b", "score": "0.60125667", "text": "def password_reset\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "title": "" }, { "docid": "1b7172047adcb44bc1cb61daf152742b", "score": "0.60125667", "text": "def password_reset\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "title": "" }, { "docid": "1b7172047adcb44bc1cb61daf152742b", "score": "0.60125667", "text": "def password_reset\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "title": "" }, { "docid": "655cc36cef07906df99c8909cb7c6859", "score": "0.60067433", "text": "def subject\n message.subject\n end", "title": "" }, { "docid": "741b39f1c6649a9c164db21ac05d0b98", "score": "0.59992266", "text": "def send_password_reset_email\n \tUserMailer.password_reset(self).deliver_now\n end", "title": "" }, { "docid": "3ea8e75243a479234009313a69074118", "score": "0.5998869", "text": "def reset_password_instructions_for_applicant\n Devise::Mailer.reset_password_instructions Applicant.first, 'faketoken'\n end", "title": "" }, { "docid": "f31723db3da11924bca4f6d6e3bfe1f1", "score": "0.5993977", "text": "def password_reset\n @greeting = \"Hi\"\n\n mail to: \"nitish.k008@gmail.com\"\n end", "title": "" }, { "docid": "002f1f9eb4196125ba92ce17111f09ad", "score": "0.5989242", "text": "def send_password_reset_email\n GolferMailer.password_reset(self).deliver_now\n end", "title": "" }, { "docid": "43460dc824dcdb8a35fce1ba2fcb25b5", "score": "0.59869146", "text": "def reset_password\n Notifier.reset_password\n end", "title": "" }, { "docid": "294844e7d9209e08dcf96a09417b4224", "score": "0.5985923", "text": "def reset_password(user, reset_link)\r\n recipients user.email\r\n from system_email(reset_link)\r\n subject \"#{subject_prefix}Forgotton Password\"\r\n body :user => user, :reset_link => reset_link\r\n end", "title": "" }, { "docid": "381d05d9b9abed219b47f5901ab95277", "score": "0.5981116", "text": "def send_password_reset_mail\n UserMailer.password_reset(self).deliver_now\n end", "title": "" }, { "docid": "79afb72bf56822d513a9c96df0b7ed6a", "score": "0.59784746", "text": "def password_reset(user)\n @user = user\n mail to: user.username, subject: \"Umedoc Password Reset\"\n end", "title": "" }, { "docid": "f51920675814aabc9438a625d48b7a10", "score": "0.59754324", "text": "def password_reset(user)\n @user = user\n mail :to => user.email, :subject => \"Password reset for Project Help\"\n end", "title": "" }, { "docid": "ead22a0fe2ed171ac5a20a55bc471479", "score": "0.597506", "text": "def password_reset(user)\n @user = user\n # missing \"from: \"norply@example.com\"\" -> error\n mail to: user.email, subject: \"Password reset\"\n end", "title": "" }, { "docid": "f7f0603c11ccd9394f6dbc6b3a647cfe", "score": "0.59742796", "text": "def password_reset(user)\n #@greeting = \"Hi\"\n @user = user\n #mail to: user.email, subject: \"Password Reset\"\n mail to: user.email, subject: 'Welcome to Project Quest!'\n end", "title": "" }, { "docid": "5a958a502dc32d5dde3462f9d6361a78", "score": "0.5972228", "text": "def password_reset(user)\n @user = user\n mail to: user.email, subject: \"Password reset\"\n end", "title": "" }, { "docid": "64210cdf2c3a4501875d2a6d65903fbd", "score": "0.59717107", "text": "def password_reset(member) \r\n @member = member \r\n mail(to: member.user_name, subject: \"Password Reset\") \r\n end", "title": "" }, { "docid": "827eec9044bdf82d4ff4f3fabb3ccb16", "score": "0.597038", "text": "def reset_password_instructions(user)\n @user = user\n setup_mail(:reset_password_instructions, :headers => {:to => @user.email})\n end", "title": "" }, { "docid": "73c7de6a2c0acb112f9e16635d1f5ada", "score": "0.5966189", "text": "def send_password_reset_email\r\n UserMailer.password_reset(self).deliver_now\r\n end", "title": "" }, { "docid": "fc1a6f1743aebc5fa384137cf9af52b7", "score": "0.5965356", "text": "def send_password_reset_email\n #UserMailer.password_reset(self).deliver_now\n end", "title": "" }, { "docid": "1f9447b115254d4a28f9b152a9d55b39", "score": "0.5964376", "text": "def send_password_reset_email\n UserMailer.password_reset(self).deliver_now\n end", "title": "" }, { "docid": "9acee739df921631b8ddd8d74815e190", "score": "0.59632665", "text": "def password_reset(user)\n @user = user\n\n mail :to => user.email, :subject => t(:password_recover)\n end", "title": "" }, { "docid": "8c521d09737714355c4ecf4649b1902c", "score": "0.59605724", "text": "def forgot_password(to, login, pass, sent_at = Time.now)\n @subject = \"Satori: New password\"\n @body['login'] = login\n @body['pass'] = pass\n @recipients = to\n @from = 'satori@hcl.com'\n @sent_on = sent_at\n @headers = {}\n end", "title": "" }, { "docid": "6add424d74f7fbf99bccacead0104564", "score": "0.59587437", "text": "def send_password_reset_email\n\t\tUserMailer.password_reset(self).deliver_now\n\tend", "title": "" }, { "docid": "6add424d74f7fbf99bccacead0104564", "score": "0.59587437", "text": "def send_password_reset_email\n\t\tUserMailer.password_reset(self).deliver_now\n\tend", "title": "" } ]
bfc31d7ec49c287c97d10f3780091370
DELETE /services/1 DELETE /services/1.json
[ { "docid": "587e00afd4a5a38a4da6959ca893c8e7", "score": "0.70940655", "text": "def destroy\n\t\t@service = Service.find(params[:id])\n\t\t@service.destroy\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to services_url }\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend", "title": "" } ]
[ { "docid": "69b647d0fba19caa74d6918b92ba2528", "score": "0.7644181", "text": "def destroy\n service.destroy\n render json: service, status: 200\n end", "title": "" }, { "docid": "f771df7d19346fc235fe7bb3807d51c9", "score": "0.7445268", "text": "def destroy\n @service = Service.find(params[:id])\n @service.destroy\n\n respond_to do |format|\n format.html { redirect_to services_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "0fd6e28af60b19841bdadb22230b3c65", "score": "0.7421245", "text": "def delete_service(service_id)\n request(:delete, \"/service/#{service_id}\")\n end", "title": "" }, { "docid": "0f189701a29081c00f588657e73e392b", "score": "0.7405554", "text": "def destroy\n @service = Service.find(params[:id])\n @service.destroy\n\n respond_to do |format|\n format.html { redirect_to services_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0f189701a29081c00f588657e73e392b", "score": "0.7405554", "text": "def destroy\n @service = Service.find(params[:id])\n @service.destroy\n\n respond_to do |format|\n format.html { redirect_to services_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0f189701a29081c00f588657e73e392b", "score": "0.7405554", "text": "def destroy\n @service = Service.find(params[:id])\n @service.destroy\n\n respond_to do |format|\n format.html { redirect_to services_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0f189701a29081c00f588657e73e392b", "score": "0.7405554", "text": "def destroy\n @service = Service.find(params[:id])\n @service.destroy\n\n respond_to do |format|\n format.html { redirect_to services_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0f189701a29081c00f588657e73e392b", "score": "0.7405554", "text": "def destroy\n @service = Service.find(params[:id])\n @service.destroy\n\n respond_to do |format|\n format.html { redirect_to services_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0f189701a29081c00f588657e73e392b", "score": "0.7405554", "text": "def destroy\n @service = Service.find(params[:id])\n @service.destroy\n\n respond_to do |format|\n format.html { redirect_to services_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "eddb7680c796c42b17a53483c3a5a9bf", "score": "0.73629504", "text": "def destroy\n @client_service = ClientService.find(params[:id])\n @client_service.destroy\n\n respond_to do |format|\n format.html { redirect_to client_services_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c7d79b440f49ed008c04c56bc999cbaf", "score": "0.7360173", "text": "def delete service\n\t @name_services.delete service\n\tend", "title": "" }, { "docid": "75b5498d8dbcc2393dfbc14aea3b1b94", "score": "0.736012", "text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "75b5498d8dbcc2393dfbc14aea3b1b94", "score": "0.736012", "text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "75b5498d8dbcc2393dfbc14aea3b1b94", "score": "0.736012", "text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "75b5498d8dbcc2393dfbc14aea3b1b94", "score": "0.736012", "text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6ab0b24efa8a15020cd03e0d6960ba84", "score": "0.734309", "text": "def destroy\n\n @service.destroy\n respond_to do |format|\n format.html { redirect_to admin_services_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "67a020d7213b3d0fba15d1bf2946b771", "score": "0.72840434", "text": "def destroy\r\n @service.destroy\r\n respond_to do |format|\r\n format.html { redirect_to services_url }\r\n format.json { head :no_content }\r\n end\r\n end", "title": "" }, { "docid": "9e067292454636b82df1831323ce2199", "score": "0.72763926", "text": "def destroy\n #@service = Service.find(params[:id])\n @service = Service.new\n @service.id = params[:id]\n @service.app_id = params[:app_id]\n @service.destroy\n\n respond_to do |format|\n format.html { redirect_to app_services_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "12ef5be416425ec2398545f0a462a561", "score": "0.72579587", "text": "def destroy\n @service.destroy\n render json: { status: \"your service was deleted\" }\n end", "title": "" }, { "docid": "f0b142d491a852aa8de65454197cc370", "score": "0.72292197", "text": "def delete\n verify_request!\n unless uuids = @request.params[\"uuids\"]\n raise \"Provide list of UUIDs of services to delete.\"\n end\n\n uuids.each do |uuid|\n obj = service.where(:uuid => uuid).first\n next unless obj\n unless obj.destroy\n errors = obj.errors.full_messages.join(',')\n raise \"Deleting service #{uuid} failed: #{errors}\"\n end\n end\n response(:success => \"Services have been deleted.\")\n rescue => e\n response(:error => e.message)\n end", "title": "" }, { "docid": "ea5cb48b122940eb90dec878a00411e6", "score": "0.721976", "text": "def destroy\n service = Service.find_by(id: params[:id])\n service.destroy\n end", "title": "" }, { "docid": "a0092c5fcbbf90545497d4b4eb707e5a", "score": "0.72155255", "text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: \"Service was successfully deleted.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ec2e9002164b056208c610f43ea9c0fb", "score": "0.7205011", "text": "def destroy\n @service = Service.find(params[:id])\n @service.destroy\n\n respond_to do |format|\n format.html { redirect_to company_type_services_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fd25f2ddf99d4be460ba9e627075bc1d", "score": "0.7203911", "text": "def destroy\n\t\tlog_action_result @service\n\t\t@service.destroy\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to services_url }\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend", "title": "" }, { "docid": "6f75957268d0b511e7ce3c14e202ff71", "score": "0.7163755", "text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to all_services_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1a61e98dc0045a2171eab5675d3703fc", "score": "0.71151376", "text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n \n end", "title": "" }, { "docid": "69f4558726a787cdb384f35c523b9d1b", "score": "0.7111978", "text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "69f4558726a787cdb384f35c523b9d1b", "score": "0.7111978", "text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "69f4558726a787cdb384f35c523b9d1b", "score": "0.7111978", "text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "69f4558726a787cdb384f35c523b9d1b", "score": "0.7111978", "text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "69f4558726a787cdb384f35c523b9d1b", "score": "0.7111978", "text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "69f4558726a787cdb384f35c523b9d1b", "score": "0.7111978", "text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "69f4558726a787cdb384f35c523b9d1b", "score": "0.7111978", "text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "69f4558726a787cdb384f35c523b9d1b", "score": "0.7111978", "text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "69f4558726a787cdb384f35c523b9d1b", "score": "0.7111978", "text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "69f4558726a787cdb384f35c523b9d1b", "score": "0.7111978", "text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "69f4558726a787cdb384f35c523b9d1b", "score": "0.7111978", "text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "69f4558726a787cdb384f35c523b9d1b", "score": "0.7111978", "text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "69f4558726a787cdb384f35c523b9d1b", "score": "0.7111978", "text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "69f4558726a787cdb384f35c523b9d1b", "score": "0.7111978", "text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "69f4558726a787cdb384f35c523b9d1b", "score": "0.7111978", "text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "69f4558726a787cdb384f35c523b9d1b", "score": "0.7111978", "text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "93c4e11dca824060f137846480ff34e7", "score": "0.7110992", "text": "def delete_service(id, _options = {})\n delete \"services/#{id}\"\n end", "title": "" }, { "docid": "c38d3e64c4a7e4af7ee7b3f121b9063f", "score": "0.71082026", "text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: 'Servicio eliminado.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cbcf6abdc2f3cda25c3fbf61b5b266ec", "score": "0.7104852", "text": "def delete_service(client, name, host_name)\n result = client.delete_service(name: name, host_name: host_name, cascade: true)\n Chef::Log.debug(result.to_s)\n raise \"Can't open connection to API\" if result.nil?\n raise result.to_s unless result.is_a?(Hash)\n raise \"Failed to delete object Service #{name}: #{result}\" unless [200, 404].include?(result['code'])\n end", "title": "" }, { "docid": "27eb1fdedf80d9b3f6ee4c71a5423bde", "score": "0.7096744", "text": "def destroy\n @service = Service.find(params[:id])\n @service.destroy\n\n respond_to do |format|\n format.html { redirect_to(\"/services\") }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "0d4324ced9ce2f2d3f4e5afe8b72d97d", "score": "0.709304", "text": "def destroy\n @event_service = Event::Service.find(params[:id])\n @event_service.destroy\n\n respond_to do |format|\n format.html { redirect_to event_services_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a783df814746e0dd1f7b9df7707e16c1", "score": "0.70887095", "text": "def destroy\n @service = Service.find(params[:id])\n @service.destroy\n\n respond_to do |format|\n format.html { redirect_to(services_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a783df814746e0dd1f7b9df7707e16c1", "score": "0.70887095", "text": "def destroy\n @service = Service.find(params[:id])\n @service.destroy\n\n respond_to do |format|\n format.html { redirect_to(services_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a783df814746e0dd1f7b9df7707e16c1", "score": "0.70887095", "text": "def destroy\n @service = Service.find(params[:id])\n @service.destroy\n\n respond_to do |format|\n format.html { redirect_to(services_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a783df814746e0dd1f7b9df7707e16c1", "score": "0.70887095", "text": "def destroy\n @service = Service.find(params[:id])\n @service.destroy\n\n respond_to do |format|\n format.html { redirect_to(services_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.7062105", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": "6ad1c41dc020f32fcd020ec50b291ca3", "score": "0.7055645", "text": "def destroy\n @itemservice = Itemservice.find(params[:id])\n @itemservice.destroy\n\n respond_to do |format|\n format.html { redirect_to itemservices_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "57220a6806c1d955256129e5b7add5b1", "score": "0.7049881", "text": "def destroy\n @app_service = AppService.find(params[:id])\n @app_service.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_app_services_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fcdbde88a458f753de6f2cd4b88d1d2b", "score": "0.70491725", "text": "def destroy\r\n @service.destroy\r\n respond_to do |format|\r\n format.html { redirect_to services_url, notice: 'Service was successfully destroyed.' }\r\n format.json { head :no_content }\r\n end\r\n end", "title": "" }, { "docid": "880ddcd281388825b6476f7c1cab3c08", "score": "0.7035954", "text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to root_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "880ddcd281388825b6476f7c1cab3c08", "score": "0.7035954", "text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to root_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e8bf6a8158029733487bfda1cbf43523", "score": "0.7023464", "text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url(:id => @service.service_id), notice: 'Объект успешно удален.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4b80e719427bc3c65957dc2a9f9813a5", "score": "0.7023004", "text": "def destroy\n @service = Service.where(:id => params[:id], :company_id => current_user.company.id).first\n @service.destroy\n\n respond_to do |format|\n format.html { redirect_to services_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "60e39d8d8e24b7a237036dbb85f06993", "score": "0.7007935", "text": "def destroy\n @service.destroy\n head :no_content\n end", "title": "" }, { "docid": "c13fffbd080bcb2bfb5f47f5cde5c703", "score": "0.6975098", "text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to new_salon_path, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2139bd75c39ddfc740753cd569ba3a27", "score": "0.6973402", "text": "def destroy\n bonus = Bonus.find_by_service_id(params[:id])\n if bonus\n bonus.delete\n end\n @service = Service.find(params[:id])\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url }\n format.json { render json: @service.id}\n end\n end", "title": "" }, { "docid": "c21ecea30e09318e4073a044829bce38", "score": "0.6972598", "text": "def destroy\n @app_service = AppService.find(params[:id])\n @app_service.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_accounts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c23635bf99aca683baafba0c59bb753a", "score": "0.6967583", "text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to user_services_path(current_user), notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c17cd02fc84ff4dbf697dbd140e6f79b", "score": "0.6946969", "text": "def destroy\n @setservice = Setservice.find(params[:id])\n @setservice.destroy\n\n respond_to do |format|\n format.html { redirect_to setservices_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3273deb534eadb44175032f597ae60a8", "score": "0.69411117", "text": "def destroy\n @customer_service = CustomerService.find(params[:id])\n @customer_service.destroy\n\n respond_to do |format|\n format.html { redirect_to customer_services_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cea81539720c54414a6771cb0cbfb30d", "score": "0.6932846", "text": "def destroy\n @consultant_service = ConsultantService.find(params[:id])\n @consultant_service.destroy\n\n respond_to do |format|\n format.html { redirect_to consultant_services_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "edb553c114ec3984b647c4af3bcfec29", "score": "0.6926668", "text": "def destroy\n @service_graph = ServiceGraph.find_by(code: @service.id)\n @service.destroy\n @service_graph.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f2119f1e7d12318957fe11bb92449a42", "score": "0.69229037", "text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to @service, notice: 'Votre service a bien été supprimé !' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "94edf4a2bba383ac7c47ddc86af387d9", "score": "0.6920947", "text": "def destroy\n user = User.find(params[:user_id])\n @service = user.services.find(params[:id])\n @service.destroy\n respond_to do |format|\n format.html { redirect_to user_services_url, notice: 'Service was successfully destroyed.'}\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5919e226508b14438bd85f7304bdbec3", "score": "0.69204384", "text": "def destroy\n @service = Service.find(params[:id])\n @service.destroy\n\n respond_to do |format|\n format.html { redirect_to :action => 'list' }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "174b723f9e43bfa7501a9cdc389e4c1b", "score": "0.69196486", "text": "def delete\n @response = self.class.delete(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\")\n end", "title": "" }, { "docid": "9438112e20315845e48ddae935c15d61", "score": "0.6918516", "text": "def destroy\n @service = @site.services.find(params[:id])\n @service.destroy\n\n respond_to do |format|\n format.html { redirect_to(site_services_url(@site)) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "97f1ec3e109727d9371fd8106d731b3c", "score": "0.6906613", "text": "def destroy\n @our_service.destroy\n respond_to do |format|\n format.html { redirect_to our_services_url, notice: 'Our service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "52c1b013a0a7e3bb78e541f08d00fb53", "score": "0.69052345", "text": "def destroy\n \t@service.destroy\n \trespond_to do |format|\n \t\tformat.html { redirect_to services_url }\n \tend\n \tend", "title": "" }, { "docid": "cc08f323ba9ab1ad75ea4603595254b3", "score": "0.690469", "text": "def destroy\n @ivr_service.destroy\n respond_to do |format|\n format.html { redirect_to ivr_services_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "58f2d60b1fdfdf80c9b48173b70e86f9", "score": "0.69029695", "text": "def destroy\n @servicerequest.destroy\n respond_to do |format|\n format.html { redirect_to servicerequests_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c1ef0004f81d2514cd30361d7d124249", "score": "0.6897963", "text": "def destroy\n @service.destroy\n respond_to do |format|\n format.html { redirect_to services_url, notice: t('.service_was_successfully_destroyed') }\n format.json { head :no_content }\n end\n return\n end", "title": "" }, { "docid": "09aff518eb4bd82264a931dc488f8e8e", "score": "0.68933123", "text": "def destroy\n set_services\n set_service_and_provider\n require_permission? or return\n @service.destroy\n respond_to do |format|\n format.html { redirect_to edit_services_path(@provider), notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5bd11f7914ed312c2c8bb3613f0f0412", "score": "0.68932164", "text": "def destroy\n @service_version_so.destroy\n respond_to do |format|\n format.html { redirect_to service_version_sos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d2fd2ddd8d88356538a9bea55b285560", "score": "0.68871665", "text": "def destroy\n @service_type_service.destroy\n respond_to do |format|\n format.html { redirect_to service_type_services_url, notice: 'Service type service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7a90442ccd2f6bd088b573d7f7115f88", "score": "0.6885826", "text": "def test_service_delete\n\t\t\tcount = 0\n\t\t\tbegin\n\t\t\t\texpected = $aut.service_create(\"TestService\".concat((count = count+1).to_s), \"TestService\", \"This is a test description\")\n\t\t\tend while(expected[1].key?(\"error\"))\n\t\t\texpected = expected[1][\"OS-KSADM:service\"][\"id\"]\n\t\t\t$aut.service_get(expected)\n\t\t\texpected = $aut.service_delete(expected)[0]\n\t\t\tassert(expected)\n\t\tend", "title": "" }, { "docid": "07e4922ae2d458cdf9ac5bf538d9ed36", "score": "0.6874296", "text": "def destroy\n @atomic_service = AtomicService.find(params[:id])\n @atomic_service.destroy\n\n respond_to do |format|\n format.html { redirect_to(atomic_services_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "98c2dc39c7bb9f3d4cc055ac5551f9bf", "score": "0.68710715", "text": "def destroy\n @it_service.destroy\n respond_to do |format|\n format.html { redirect_to it_services_url, notice: 'It service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f3d9682e65c20c0a48ff09e96e57803a", "score": "0.687012", "text": "def destroy\n @servservice.destroy\n respond_to do |format|\n format.html { redirect_to servservices_url, notice: 'Servservice was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "169cce382a2b02712a79b7a6e5ce8456", "score": "0.68697095", "text": "def destroy\n @service = @definition.service\n @definition.destroy\n respond_to do |format|\n format.html { redirect_to @service, notice: 'Definition was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "42bf509d63cb36d4d195ef2f26ebbb10", "score": "0.6856234", "text": "def destroy\n @servicios = Servicio.find(params[:id])\n @servicios.destroy\n\n respond_to do |format|\n format.html { redirect_to(servicios_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "0254da1a1243e9d58d537bb6b9a5f3ed", "score": "0.68412983", "text": "def destroy\n @seaservice.destroy\n respond_to do |format|\n format.html { redirect_to seaservices_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "51b2bf04fb207fbc0b453f6e0f08b8ea", "score": "0.6839844", "text": "def destroy\n @amm_o2_service.destroy\n respond_to do |format|\n format.html { redirect_to amm_o2_services_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "19b697638c5a42fe0e37f22258f6ce88", "score": "0.6825793", "text": "def destroy\n @lservice = Lservice.find(params[:id])\n @lservice.destroy\n\n respond_to do |format|\n format.html { redirect_to lservices_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "88261a677fac4b2fcaf1f5e53aaa3bac", "score": "0.68226373", "text": "def destroy\n @phone_service.destroy\n respond_to do |format|\n format.html { redirect_to phone_services_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f874fa20f63f0c01ec288959b8129aa9", "score": "0.6820932", "text": "def destroy\n \n @service.destroy\n respond_to do |format|\n getServices\n # @services =Service.select(\"services.id,services.service_name,services.service_description,service_price\").joins(\"where services.creator_id=#{user_id}\")\n format.html { render :index, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bb436825027024d705bc09b2bbff0d8a", "score": "0.6820275", "text": "def destroy\n @extra_service.destroy\n respond_to do |format|\n format.html { redirect_to extra_services_url, notice: 'Extra service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "151a9c6817683a3bb55bb362770fc1ec", "score": "0.68189853", "text": "def destroy\n @service_version.destroy\n respond_to do |format|\n format.html { redirect_to service_versions_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "38ba72ac281cc5e6e92cdb63b7d74641", "score": "0.68134433", "text": "def destroy\n @service_type.destroy\n respond_to do |format|\n format.html { redirect_to service_type_url, notice: 'Service was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "199c04bca0a79261790f48e1d875d438", "score": "0.6810699", "text": "def destroy\n @service = Service.find(params[:id])\n @service.destroy\n flash[:notice] = 'Service was successfully removed.'\n\n respond_to do |format|\n format.html { redirect_to(services_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "dd5c041547919b45704bc0c9874f2d91", "score": "0.6806878", "text": "def destroy\n @project_service = ProjectService.find(params[:id])\n @project_service.destroy\n\n respond_to do |format|\n format.html { redirect_to project_services_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "20108ae8ae7cce394023e2d7245c0ce3", "score": "0.67949134", "text": "def destroy\n service.delete(key)\n end", "title": "" }, { "docid": "b445c184893647d3482f8fbc6a507a52", "score": "0.6772111", "text": "def delete(path, params = {})\n path += '.json'\n res = @connection.delete(path, @header)\n parse_response(res)\n end", "title": "" }, { "docid": "8924681ffc8dc943100c2801cabbb365", "score": "0.67719626", "text": "def destroy\n authorize @service\n @service.destroy\n protocol_action(\"удаление сервиса #{@service.name}\")\n respond_to do |format|\n flash[:success] = t('flashes.destroy', model: Service.model_name.human)\n format.html { redirect_to session.delete(:return_to) }\n format.json { head :no_content }\n end\n end", "title": "" } ]
e617ee11fddf372926c6f302a7f7728f
PATCH/PUT /special_promotions/1 PATCH/PUT /special_promotions/1.json
[ { "docid": "a5c48c39b9763d646f091cd9ca5fcac6", "score": "0.6289826", "text": "def update\n respond_to do |format|\n if @special_promotion.update(special_promotion_params)\n format.html { redirect_to @special_promotion, notice: 'Special promotion was successfully updated.' }\n format.json { render :show, status: :ok, location: @special_promotion }\n else\n format.html { render :edit }\n format.json { render json: @special_promotion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "f31d51fa59423df5067ae63071fe3afd", "score": "0.6294379", "text": "def update_special_off\n\n respond_to do |format|\n if @promotion.update(promotion_params)\n format.html { redirect_to show_special_off_backend_shop_branch_promotion_path(@current_shop.slug, @current_branch, @promotion), notice: t('special off was successfully updated.') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit_special_off' }\n format.json { render json: @promotion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ec26bee209dc5a65663c66e71e006720", "score": "0.5789583", "text": "def update\n specialty_params.each_pair do |property,value|\n @specialty.send(property+'=',value)if @specialty.respond_to?(property+'=')\n end\n @specialty.updater_id = current_user\n if @specialty.save\n set_specialty\n #respond_with @specialty\n render json: @specialty, :except=> [:updated_at, :created_at], status: :ok\n else\n ##render json: @specialty.errors, status: :unprocessable_entity\n respond_with @specialty.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "0e262f0194e1d4b8629d9c083cf07c35", "score": "0.57895195", "text": "def update\n respond_to do |format|\n if @special.update(special_params)\n format.html { redirect_to @special, notice: 'Special was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @special.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "291d167f3123aaacc3bdb1cb2e1af46c", "score": "0.5768494", "text": "def update\n respond_to do |format|\n if @special_request.update(special_request_params)\n format.html { redirect_to @special_request, notice: 'Special request was successfully updated.' }\n format.json { render :show, status: :ok, location: @special_request }\n else\n format.html { render :edit }\n format.json { render json: @special_request.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "77218a4c18401d62ef7bd749417be77e", "score": "0.5767281", "text": "def refresh_promotions!\n @promotions = _promotions\n end", "title": "" }, { "docid": "5226e3d2997e9921ff8ee32bb019559c", "score": "0.5743298", "text": "def update\n @special_request = SpecialRequest.find(params[:id])\n \n respond_to do |format|\n if @special_request.update_attributes(params[:special_request])\n format.html { redirect_to @special_request, notice: 'Special request was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @special_request.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dc0a78eba47b067a75a6787ebdf0ecea", "score": "0.5733127", "text": "def update\n respond_to do |format|\n if @admin_special.update(admin_special_params)\n format.html { redirect_to @admin_special, notice: 'Special was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_special }\n else\n format.html { render :edit }\n format.json { render json: @admin_special.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6763b22c56514cc0ccb199619501150d", "score": "0.56367356", "text": "def update\n @admin_special = Admin::Special.find(params[:id])\n\n respond_to do |format|\n if @admin_special.update_attributes(params[:admin_special])\n format.html { redirect_to admin_specials_path, notice: 'Special was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_special.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "89d20e12b307622e76bdb7552af25bfd", "score": "0.56033283", "text": "def update\n @special = Special.find(params[:id])\n\n respond_to do |format|\n if @special.update_attributes(params[:special])\n format.html { redirect_to @special, notice: 'Special was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @special.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2bbc4fb296003351d2f189f9f647cb95", "score": "0.55904967", "text": "def update\n @special = Special.find(params[:id])\n\n respond_to do |format|\n if @special.update_attributes(params[:special])\n format.html { redirect_to @special, notice: 'Special was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @special.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2bbc4fb296003351d2f189f9f647cb95", "score": "0.55904967", "text": "def update\n @special = Special.find(params[:id])\n\n respond_to do |format|\n if @special.update_attributes(params[:special])\n format.html { redirect_to @special, notice: 'Special was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @special.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "34b4924d00949adde77c2fe73c8fcf05", "score": "0.55763364", "text": "def update\n respond_to do |format|\n if @special_part.update(special_part_params)\n format.html { redirect_to @special_part, notice: 'Special part was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @special_part.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fff28b9db3580b3fdc2b2ade6d853c3b", "score": "0.5575509", "text": "def update\n @promotion = Promotion.find(params[:id])\n\n if @promotion.update(promotion_params)\n head :no_content\n else\n render json: @promotion.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "bd156f5b4a9345af7bf456178cad1d62", "score": "0.5565", "text": "def update\n params[:promoter][:password] = Digest::MD5.hexdigest(params[:promoter][:password])\t\n @promoter = Promoter.find(params[:id])\n\n respond_to do |format|\n if @promoter.update_attributes(params[:promoter])\n format.html { redirect_to @promoter, :notice => 'Promoter was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @promoter.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f422aa567c38eb8209d91c1ce4de6ef6", "score": "0.5530108", "text": "def update\n admin_only\n respond_to do |format|\n if @promotion.update(promotion_params)\n format.html { redirect_to @promotion, notice: 'La promotion a bien été modifiée.' }\n format.json { render :show, status: :ok, location: @promotion }\n else\n format.html { render :edit }\n format.json { render json: @promotion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dd4437688d187b36af64fe44f4e4458c", "score": "0.55204326", "text": "def update\n @promocion = Promocion.find(params[:id])\n\n respond_to do |format|\n if @promocion.update_attributes(params[:promocion])\n format.html { redirect_to @promocion, notice: 'Promocion was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @promocion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "789b8792630cc79c201466be2f29f744", "score": "0.5519582", "text": "def update_extras\n property = Prop.find(params[:id])\n # The set_features method goes through ea\n property.set_features = params[:extras].to_unsafe_hash\n property.save!\n return render json: property.features\n end", "title": "" }, { "docid": "c7d3119f43599ac623bb69fd611a3b45", "score": "0.54880226", "text": "def set_special_promotion\n @special_promotion = SpecialPromotion.find(params[:id])\n end", "title": "" }, { "docid": "c2faee14f129a64c6a0d74a61d8a56ec", "score": "0.5420886", "text": "def update\n respond_to do |format|\n if @part_promotion.update(part_promotion_params)\n format.html { redirect_to @part_promotion, notice: 'Part promotion was successfully updated.' }\n format.json { render :show, status: :ok, location: @part_promotion }\n else\n format.html { render :edit }\n format.json { render json: @part_promotion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2a6a2e26ccdf71a21a8169aa389d5db4", "score": "0.5401465", "text": "def update\n @custom_promotion = CustomPromotion.find(params[:id])\n\n respond_to do |format|\n if @custom_promotion.update_attributes(params[:custom_promotion])\n format.html { redirect_to(@custom_promotion, :notice => 'CustomPromotion was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @custom_promotion.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1f278e6478b19bba70bd7f528f240112", "score": "0.5395425", "text": "def update\n @promocion = Promocion.find(params[:id])\n\n respond_to do |format|\n if @promocion.update_attributes(params[:promocion])\n format.html { redirect_to @promocion, notice: 'Promocion actualizada.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @promocion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "32dae653d4b65bb2d20be8b46f0e00a4", "score": "0.5385365", "text": "def update\n respond_to do |format|\n if @promotion.update(promotion_params)\n format.html { redirect_to promotions_path, notice: '혜택이 수정되었습니다.' }\n format.json { render :show, status: :ok, location: @promotion }\n else\n format.html { render :edit }\n format.json { render json: @promotion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "661083a540c2217cde3e6fcdfd8c03ac", "score": "0.5360357", "text": "def update\n respond_to do |format|\n if @promotion.update(promotion_params)\n format.html { redirect_to @promotion, notice: 'Promotion was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @promotion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "315230d7137171363996a21fdb1ece1f", "score": "0.53599674", "text": "def update\n @empresa = Empresa.find(params[:empresa_id])\n @producto = @empresa.productos.find(params[:producto_id])\n @prop_general = @producto.prop_generals.find(params[:prop_general_id])\n @prop_general_item = @prop_general.prop_general_items.find(params[:id])\n respond_to do |format|\n if @prop_general_item.update(prop_general_item_params)\n format.html { redirect_to empresa_producto_prop_general_prop_general_items_path, notice: 'Prop general item was successfully updated.' }\n format.json { render :show, status: :ok, location: @prop_general_item }\n else\n format.html { render :edit }\n format.json { render json: @prop_general_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dc7e3e1b2c0d1a411717b74b852d1adc", "score": "0.5358204", "text": "def update\n respond_to do |format|\n if @proverb.update(proverb_params)\n format.html { redirect_to admin_proverb_path(@proverb), notice: 'Proverb was successfully updated.' }\n format.json { render :show, status: :ok, location: @proverb }\n else\n format.html { render :edit }\n format.json { render json: @proverb.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b3b3d6a377fc83e98aebe7473e40fb60", "score": "0.5350638", "text": "def update\r\n @user = User.find(params[:id])\r\n @user.specialisms.destroy_all\r\n @user.status = params[:user][:status]\r\n @user.username = params[:user][:username]\r\n @user.email = params[:user][:email]\r\n @user.fullname = params[:user][:fullname]\r\n @user.role_id = params[:user][:role_id]\r\n @user.kinect_angle = params[:user][:kinect_angle]\r\n\r\n @specialities = params[:specialisms]\r\n if !@specialities.nil?\r\n @specialities.each do |id|\r\n Specialismship.new({:specialism_id => id, :user_id => @user.id}).save\r\n end\r\n end\r\n\r\n respond_to do |format|\r\n if @user.save\r\n format.html { redirect_to @user}\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @user.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "f9d63d20d5a0c52c606e79a677f48792", "score": "0.53279865", "text": "def update\n respond_to do |format|\n if @speciality_pull.update(speciality_pull_params)\n format.html { redirect_to @speciality_pull, notice: 'Speciality pull was successfully updated.' }\n format.json { render :show, status: :ok, location: @speciality_pull }\n else\n format.html { render :edit }\n format.json { render json: @speciality_pull.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "205827d6680ca5a389ce2cc186a48b8f", "score": "0.5316199", "text": "def update\n respond_to do |format|\n if @special_feature.update(special_feature_params)\n format.html { redirect_to @special_feature, notice: 'Special feature was successfully updated.' }\n format.json { render :show, status: :ok, location: @special_feature }\n else\n format.html { render :edit }\n format.json { render json: @special_feature.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "534d4edd0f9d8430c0bfc613c85bc331", "score": "0.53131676", "text": "def update\n respond_to do |format|\n if @promo_request.update(promo_request_params)\n format.html { redirect_to @promo_request, notice: 'Promo request was successfully updated.' }\n format.json { render :show, status: :ok, location: @promo_request }\n else\n format.html { render :edit }\n format.json { render json: @promo_request.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3cf3f4325cdbebac5ed04b9133f5f211", "score": "0.5306966", "text": "def update\n @equipo_promocion = EquipoPromocion.find(params[:id])\n\n respond_to do |format|\n if @equipo_promocion.update_attributes(params[:equipo_promocion])\n format.html { redirect_to @equipo_promocion, notice: 'Equipo promocion was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @equipo_promocion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "66f5b340dd50d4ee1b87a0fe10221c53", "score": "0.529051", "text": "def update\n respond_to do |format|\n if @promotion.update(promotion_params)\n format.html { redirect_to @promotion, notice: 'Promotion was successfully updated.' }\n format.json { render :show, status: :ok, location: @promotion }\n else\n format.html { render :edit }\n format.json { render json: @promotion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "66f5b340dd50d4ee1b87a0fe10221c53", "score": "0.529051", "text": "def update\n respond_to do |format|\n if @promotion.update(promotion_params)\n format.html { redirect_to @promotion, notice: 'Promotion was successfully updated.' }\n format.json { render :show, status: :ok, location: @promotion }\n else\n format.html { render :edit }\n format.json { render json: @promotion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "05a871e893ef6a299f72f280f9b99348", "score": "0.5273634", "text": "def update\n respond_to do |format|\n if @promotion.update(promotion_params)\n format.html { redirect_to comentarios_promotion_path, notice: 'Promotion was successfully updated.' }\n format.json { render :show, status: :ok, location: @promotion }\n else\n format.html { render :edit }\n format.json { render json: @promotion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3bf5cc0e63d154378c233d794d0dcd54", "score": "0.5261879", "text": "def update\n @admin_promo = Admin::Promo.find(params[:id])\n\n respond_to do |format|\n if @admin_promo.update_attributes(params[:admin_promo])\n format.html { redirect_to @admin_promo, notice: 'Promo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_promo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fc5706a639565f81335039f8de984213", "score": "0.5253586", "text": "def update\n @po = Po.find(params[:id])\n #authorize! :update, @po\n\n @po.update_attributes pick(params, :approved, :confirmed)\n respond_with @po\n end", "title": "" }, { "docid": "9dd97ab82bc46fdd9a35469c7073dcd2", "score": "0.52517396", "text": "def update\n respond_to do |format|\n if @specialisation.update(specialisation_params)\n format.html { redirect_to person_path(@person), notice: 'Specialisation was successfully updated.' }\n format.json { render :show, status: :ok, location: @specialisation }\n else\n format.html { render :edit }\n format.json { render json: @specialisation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "af95507b759ebce4d53f3d60de3d3491", "score": "0.52446336", "text": "def update\n respond_to do |format|\n if @promote.update(promote_params)\n format.html { redirect_to @promote, notice: 'Promote was successfully updated.' }\n format.json { render :show, status: :ok, location: @promote }\n else\n format.html { render :edit }\n format.json { render json: @promote.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d0fbe8585bd60d85fc51f5612a5acf2c", "score": "0.5244365", "text": "def update\n @special_status = SpecialStatus.find(params[:id])\n\n respond_to do |format|\n if @special_status.update_attributes(params[:special_status])\n format.html { redirect_to @special_status, notice: 'Special status was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @special_status.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b4ac6b04312402439cf79e75e468c696", "score": "0.5235119", "text": "def update\n @empresa = Empresa.find(params[:empresa_id]) \n @producto = @empresa.productos.find(params[:producto_id])\n @prop_general = @producto.prop_generals.find(params[:id])\n respond_to do |format|\n if @prop_general.update(prop_general_params)\n format.html { redirect_to empresa_producto_prop_generals_path, notice: 'Prop general was successfully updated.' }\n format.json { render :show, status: :ok, location: @prop_general }\n else\n format.html { render :edit }\n format.json { render json: @prop_general.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0c9362fb99942d088e1692fae601d0e7", "score": "0.52216464", "text": "def update\n respond_to do |format|\n if @special_recipe.update(special_recipe_params)\n format.html { redirect_to @special_recipe, notice: 'Special recipe was successfully updated.' }\n format.json { render :show, status: :ok, location: @special_recipe }\n else\n format.html { render :edit }\n format.json { render json: @special_recipe.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7802235c05ac0054f12adcdc57370e8e", "score": "0.5220647", "text": "def update\n respond_to do |format|\n if @specialty_master.update(specialty_master_params)\n format.html { redirect_to @specialty_master, notice: 'Specialty master was successfully updated.' }\n format.json { render :show, status: :ok, location: @specialty_master }\n else\n format.html { render :edit }\n format.json { render json: @specialty_master.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b9c6eb044ed76ca29397b800ffed835d", "score": "0.5214027", "text": "def update\n respond_to do |format|\n if @special_part_user.update(special_part_user_params)\n format.html { redirect_to @special_part_user, notice: 'Special part user was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @special_part_user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "72dd57c454cc539dfa55a035b0ab76ba", "score": "0.52138853", "text": "def update\n\n puts \"update params\"\n p promo_params\n \n respond_to do |format|\n if @promo.update(promo_params)\n format.html { redirect_to '/admin', notice: 'Promo was successfully updated.' }\n format.json { render :show, status: :ok, location: @promo }\n else\n format.html { render :edit }\n format.json { render json: @promo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0a0077747d69506417bd9db469d57c15", "score": "0.5210346", "text": "def update\n authorize_action_for @promotion, at: current_store\n\n respond_to do |format|\n if @promotion.update(promotion_params)\n track @promotion\n format.html { redirect_to admin_promotion_path(@promotion),\n notice: t('.notice', promotion: @promotion) }\n format.json { render :show, status: :ok, location: admin_promotion_path(@promotion) }\n else\n format.html { render :edit }\n format.json { render json: @promotion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "20d8e5c4103797231dd69df6848e887b", "score": "0.520671", "text": "def update\n params['new_person'].permit!\n @request.person.update(params['new_person']); \n params['mainwork'].permit!\n @request.mainwork.update(params['mainwork']); \n params['secondwork'].permit!\n @request.secondwork.update(params['secondwork']); \n params['firstcr'].permit!\n params['secondcr'].permit!\n\n respond_to do |format|\n if @request.update(request_params)\n format.html { redirect_to requests_url, notice: 'Заявка успешно изменена' }\n format.json { render :show, status: :ok, location: @request }\n else\n format.html { render :edit }\n format.json { render json: @request.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3b75b547ed7a063097c1ce68ace30530", "score": "0.5194544", "text": "def update\n respond_to do |format|\n if @promotor.update(promotor_params)\n format.html { redirect_to @promotor, notice: 'Promotor was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @promotor.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b891b559d088883f84437ae9a35e776d", "score": "0.5187801", "text": "def update\n PaperTrail.whodunnit = current_admin.email\n if remotipart_submitted?\n p \"remotipart_submitted! remotipart_submitted! remotipart_submitted! remotipart_submitted! remotipart_submitted! \"\n end\n respond_to do |format|\n if @persona.update(persona_params)\n format.html { redirect_to @persona, notice: 'Persona was successfully updated.' }\n format.json { render :show, status: :ok, location: @persona }\n else\n format.html { render :edit }\n format.json { render json: @persona.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "323b0b58799587eaa4739bbea2799a88", "score": "0.51832765", "text": "def update\n respond_to do |format|\n if @special_number.update(special_number_params)\n format.html { redirect_to @special_number, notice: 'Special number was successfully updated.' }\n format.json { render :show, status: :ok, location: @special_number }\n else\n format.html { render :edit }\n format.json { render json: @special_number.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e673ee2901efe140965e740ae74c7dd9", "score": "0.51777846", "text": "def update\n respond_to do |format|\n if @special_rule.update(special_rule_params)\n format.html { redirect_to @special_rule, notice: 'Special rule was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @special_rule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d8a477f2db2330ecade920280c0b11ad", "score": "0.51649725", "text": "def update\n \n respond_to do |format|\n if @potion.update(potion_params)\n if params[\"ingredients\"] && params[\"ingredients\"].size > 0\n \n Potion.destroy_recipes(@potion.id)\n Potion.save_ingredients(params[\"ingredients\"], @potion.id)\n \n costs = Potion.compute_production_costs(params[\"ingredients\"])\n @potion.production_cost = costs\n @potion.save\n end\n format.html { redirect_to @potion, notice: 'Potion was successfully updated.' }\n format.json { render :show, status: :ok, location: @potion }\n else\n format.html { render :edit }\n format.json { render json: @potion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e37f7adc85e38eb14a4cad622d6e2379", "score": "0.516284", "text": "def update\n respond_to do |format|\n if @specialist.update(specialists_profile_params)\n format.html { redirect_to specialists_profiles_path, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @specialist }\n else\n format.html { render :edit }\n format.json { render json: @specialist.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "668d3ae8643cdfa756b3f1f704fc7d54", "score": "0.51575005", "text": "def update\n @special_number = SpecialNumber.find(params[:id])\n\n respond_to do |format|\n if @special_number.update_attributes(params[:special_number])\n format.html { redirect_to @special_number, notice: 'Special number was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @special_number.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4dac489d172196fdc18549f8a8c8092c", "score": "0.5154498", "text": "def update\n respond_to do |format|\n if @special_tag.update(special_tag_params)\n format.html { redirect_to special_tags_path, notice: 'Special tag was successfully updated.' }\n format.json { render :show, status: :ok, location: @special_tag }\n format.js\n else\n format.html { render :edit }\n format.json { render json: @special_tag.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end", "title": "" }, { "docid": "8ba18d072664f8b849f63295de46674c", "score": "0.5148266", "text": "def update\n respond_to do |format|\n if @specialist.update(specialist_params)\n format.html { redirect_to @specialist, notice: 'Dados do especialista alterado com sucesso.' }\n format.json { render :show, status: :ok, location: @specialist }\n else\n format.html { render :edit }\n format.json { render json: @specialist.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d5eaea298e64625a71a15a970f3b75ed", "score": "0.51480633", "text": "def patch *args\n make_request :patch, *args\n end", "title": "" }, { "docid": "b4cc3ee2207b39abaf779a6078bbaf3a", "score": "0.5146168", "text": "def patch\n PATCH\n end", "title": "" }, { "docid": "b4cc3ee2207b39abaf779a6078bbaf3a", "score": "0.5146168", "text": "def patch\n PATCH\n end", "title": "" }, { "docid": "d6e8453fe6d7bfae6e0a7921f3f1e9c6", "score": "0.5146144", "text": "def update\n respond_to do |format|\n if @special_group.update(special_group_params)\n format.html { redirect_to @special_group, notice: 'Special group was successfully updated.' }\n format.json { render :show, status: :ok, location: @special_group }\n else\n format.html { render :edit }\n format.json { render json: @special_group.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e418b3e4bab0a122e4dcc8c156938b3f", "score": "0.5141356", "text": "def update\n respond_to do |format|\n if @special_price.update(special_price_params)\n format.html { redirect_to dashboard_special_prices_path, notice: 'Период обновлен.' }\n format.json { render :show, status: :ok, location: @special_price }\n else\n format.html { render :edit }\n format.json { render json: @special_price.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "677b328a5cc57b6d0e9d6b9079b14a68", "score": "0.5138762", "text": "def update\n @speciality.user_updated_id = current_user.id\n respond_to do |format|\n if @speciality.update(speciality_params)\n format.html { redirect_to specialities_path, notice: I18n.t('specialities.controller.update') }\n format.json { render :show, status: :ok, location: @speciality }\n else\n format.html { render :edit }\n format.json { render json: @speciality.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9de6c81dd9c26117b815f82321b881eb", "score": "0.5133278", "text": "def _proposal_update(new_prop, params)\n # replaced with Attributes \n end", "title": "" }, { "docid": "02eebe78434d11b15a06626e60444577", "score": "0.512771", "text": "def check_self_update\n if @current_user.specialist || @current_user.persona == 'admin' || @user.id == @current_user.id\n update\n else\n render json: {errors: ResponseHelper::BAD_TOKEN}, status: :unauthorized\n end\n end", "title": "" }, { "docid": "7df20bebcbf066aa468401bea532e08f", "score": "0.51230097", "text": "def update(json)\n command = json.delete(:command).tr('-', '_')\n if json.empty?\n send command\n else\n send command, **json\n end\n end", "title": "" }, { "docid": "d4bcbf7b924abbd82bf9756f2fffbca6", "score": "0.51210296", "text": "def update\n respond_to do |format|\n if @like_special_part_user_user.update(like_special_part_user_user_params)\n format.html { redirect_to @like_special_part_user_user, notice: 'Like special part user user was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @like_special_part_user_user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "904075503da9ce8a26e22fcd45967197", "score": "0.5121005", "text": "def update\n respond_to do |format|\n if @motogp.update(motogp_params)\n format.html { redirect_to :action=>'index', notice: 'Motogp was successfully updated.' }\n format.json { render :index, status: :ok, location: @motogp }\n else\n format.html { render :edit }\n format.json { render json: @motogp.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0c1a09a9d20ee815b5c9f998eda70b44", "score": "0.5119319", "text": "def patch(path, params = {}, options = {})\n options[:content_type] ||= :json\n options[:Authorization] = \"simple-token #{self.access_token}\"\n RestClient.patch(request_url(path), params.to_json, options)\n end", "title": "" }, { "docid": "fae471985567c264fb41b51a8168ea36", "score": "0.5116278", "text": "def update\n respond_to do |format|\n if @potion_subtype.update(potion_subtype_params)\n format.html { redirect_to @potion_subtype, notice: 'Potion subtype was successfully updated.' }\n format.json { render :show, status: :ok, location: @potion_subtype }\n else\n format.html { render :edit }\n format.json { render json: @potion_subtype.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "97ab2b27fe58e15d84f1a75f6b60b30a", "score": "0.5112474", "text": "def update\n respond_to do |format|\n if @promotion_action.update(promotion_action_params)\n format.html { redirect_to promotion_path(@promotion), notice: 'Promotion action was successfully updated.' }\n format.json { render :show, status: :ok, location: @promotion_action }\n else\n format.html { render :edit }\n format.json { render json: @promotion_action.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5fd5f00640bdb0c785bcac4689a46f3c", "score": "0.5109245", "text": "def patch(data, options={})\n raise NotImplementedError, \"We only patchs to singular resources.\" if count > 1\n first.patch(data, options)\n end", "title": "" }, { "docid": "3c9148461a415a91a17aeb38f8f801ba", "score": "0.51090163", "text": "def update\n @user = current_user\n owner_id = product_params[ :owner_id ]\n if not (owner_id && (owner_id.to_i > 0))\n # To not choose box once again.\n @box_id = product_params[ :box_id ]\n respond_to do |format|\n format.html { redirect_to edit_product_path( @product.id ), notice: 'ERROR: It is necessary to provide a person in charge explicitly!!!' }\n format.json { head :no_content }\n end\n return\n end\n\n # Set box id and exactly in this order.\n product_params[ :box_id ] ||= @product.box_id\n\n respond_to do |format|\n if @product.update(product_params)\n @product.set_status( product_params[ :status ] )\n log( \"Product is updated: \" + @product.serial_number, @user )\n \n format.html { redirect_to @product, notice: 'Product was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c1e60db11398db6cd44eb2f7a57580e9", "score": "0.51074195", "text": "def update\n @promotion = @shop.promotions.find params[:id]\n promotion_rules = params[:promotion].delete(:promotion_rules_attributes)\n @promotion.promotion_rules = [ProductGroupPromotionRule.new(promotion_rules.first)] unless promotion_rules.nil?\n\n respond_to do |format|\n if @promotion.update_attributes(params[:promotion])\n format.html { redirect_to shop_promotions_path(@shop), notice: 'Promotion was successfully updated.' }\n format.json { render json: @promotion }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @promotion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cd75eb71c5b4284f793eb23360712dda", "score": "0.51057935", "text": "def update\n respond_to do |format|\n if @pending_toot.update(pending_toot_params)\n format.html { redirect_to @pending_toot, notice: 'Pending toot was successfully updated.' }\n format.json { render :show, status: :ok, location: @pending_toot }\n else\n format.html { render :edit }\n format.json { render json: @pending_toot.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "08ec8f25378311587c36772abd863388", "score": "0.5101793", "text": "def update\n respond_to do |format|\n if @potluck.update(potluck_params)\n format.json { render :show, status: :ok, location: @potluck }\n else\n format.json { render json: @potluck.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "47da3e7dea808face234a7010502a608", "score": "0.5098712", "text": "def update\n respond_to do |format|\n if @promo.update(promo_params)\n format.html { redirect_to @promo, notice: 'Promo was successfully updated.' }\n format.json { render :show, status: :ok, location: @promo }\n else\n format.html { render :edit }\n format.json { render json: @promo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "35e371495aa4f5496b51c925a2e53aea", "score": "0.5098316", "text": "def update\n respond_to do |format|\n if @mini_special_offer.update(mini_special_offer_params)\n format.html { redirect_to admin_mini_special_offer_path @mini_special_offer, notice: 'Mini Special offer was successfully updated.' }\n format.json { render :show, status: :ok, location: @mini_special_offer }\n else\n format.html { render :edit }\n format.json { render json: @mini_special_offer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1cdc084dfab829ba75979f895d3e281c", "score": "0.50979334", "text": "def update\n respond_to do |format|\n if @provision.update(provision_params)\n format.html { redirect_to @provision, notice: 'Provision was successfully updated.' }\n format.json { render :show, status: :ok, location: @provision }\n else\n format.html { render :edit }\n format.json { render json: @provision.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5a50a2dd08442de6903e2130e9118a13", "score": "0.5091097", "text": "def special_promotion_params\n params.require(:special_promotion).permit(:prom_start_date, :prom_end_date, :prom_title, :old_price, :new_price, :user_id, :restoraunt_id)\n end", "title": "" }, { "docid": "4ec40f5499ec22f8282cb7c786e723b7", "score": "0.5090261", "text": "def update\n respond_to do |format|\n if @promocao.update(promocao_params)\n format.html { redirect_to [:admin, @promocao], notice: 'Promocao was successfully updated.' }\n format.json { render :show, status: :ok, location: [:admin, @promocao] }\n else\n format.html { render :edit }\n format.json { render json: @promocao.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d24573c3412f155e56aac789e9d2b190", "score": "0.50818485", "text": "def update\n @custom = Custom.find(params[:id])\n\n respond_to do |format|\n if @custom.update_attributes(params[:custom])\n format.html { redirect_to @custom, notice: 'Custom was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @custom.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "06c9489fed5a81c05d9eee2dacb5b8ee", "score": "0.50804", "text": "def update\n if @propietario.update(propietario_params)\n render json: @propietario\n else\n render json: @propietario.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "11412e36cb58e14999bfc3e57a572aca", "score": "0.50793034", "text": "def update\n respond_to do |format|\n if @misc_promotional_rule.update(misc_promotional_rule_params)\n format.html { redirect_to @misc_promotional_rule, notice: 'Misc promotional rule was successfully updated.' }\n format.json { render :show, status: :ok, location: @misc_promotional_rule }\n else\n format.html { render :edit }\n format.json { render json: @misc_promotional_rule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bdec049f94d8dac02c77e01bbeef025d", "score": "0.5079088", "text": "def update\n respond_to do |format|\n if @promotion.update(promotion_params)\n format.html { redirect_to @promotion, notice: 'Oferta foi atualizada com sucesso.' }\n format.json { render :show, status: :ok, location: @promotion }\n else\n format.html { render :edit }\n format.json { render json: @promotion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e0e2553476c31d678aaed6733fc65267", "score": "0.50728184", "text": "def update\n authorize! :update, @person_request\n \n #@person_request.user_id=@user.id\n #@person_request.update!(person_request_params.merge(trigger_notification_mail: (@person_request.user_id==current_user.id)))\n @person_request.update!(person_request_params)\n render json: {status: :ok}\n end", "title": "" }, { "docid": "7184e2bf041da2afa5a0f9f819e9b2ec", "score": "0.50723517", "text": "def update\n respond_to do |format|\n if @opcion.update(opcion_params)\n format.html { redirect_to @opcion, notice: 'Opcion was successfully updated.' }\n format.json { render :show, status: :ok, location: api_v1_pregunta_opcion_url(@opcion.pregunta_id,@opcion) }\n else\n format.html { render :edit }\n format.json { render json: @opcion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3705eaabcf65e27d4f535fc22790a7d4", "score": "0.50717914", "text": "def patch_equipment_psu_with_http_info(moid, equipment_psu, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: EquipmentApi.patch_equipment_psu ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling EquipmentApi.patch_equipment_psu\"\n end\n # verify the required parameter 'equipment_psu' is set\n if @api_client.config.client_side_validation && equipment_psu.nil?\n fail ArgumentError, \"Missing the required parameter 'equipment_psu' when calling EquipmentApi.patch_equipment_psu\"\n end\n # resource path\n local_var_path = '/api/v1/equipment/Psus/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\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(equipment_psu)\n\n # return_type\n return_type = opts[:debug_return_type] || 'EquipmentPsu'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"EquipmentApi.patch_equipment_psu\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: EquipmentApi#patch_equipment_psu\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "b6799590fcd5c47d1adbd4215b42a385", "score": "0.50693065", "text": "def update\n respond_to do |format|\n if @provider_specialty.update(provider_specialty_params)\n format.html { redirect_to @provider_specialty, notice: 'Provider specialty was successfully updated.' }\n format.json { render :show, status: :ok, location: @provider_specialty }\n else\n format.html { render :edit }\n format.json { render json: @provider_specialty.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2201c8459e41fa0e0d3e05197ca9d54e", "score": "0.50611943", "text": "def update\n respond_to do |format|\n if @phenotype.update(phenotype_params)\n format.html { redirect_to @phenotype, notice: \"Phenotype was successfully updated.\" }\n format.json { render :show, status: :ok, location: @phenotype }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @phenotype.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "abce1dfbfa7adc8a127622108f732a95", "score": "0.50597775", "text": "def update_person(api, cookie, perstoupdate, person)\n pers_id = perstoupdate['id']\n option_hash = { content_type: :json, accept: :json, cookies: cookie }\n pers = nil\n res = api[\"people/#{pers_id}\"].patch person.to_json, option_hash unless $dryrun\n if res&.code == 201\n pers = JSON.parse(res.body)\n end\n pers\nend", "title": "" }, { "docid": "508f3123c827a165965ac5c9e043b60e", "score": "0.50545204", "text": "def update!(**args)\n @simple_responses = args[:simple_responses] if args.key?(:simple_responses)\n end", "title": "" }, { "docid": "508f3123c827a165965ac5c9e043b60e", "score": "0.50545204", "text": "def update!(**args)\n @simple_responses = args[:simple_responses] if args.key?(:simple_responses)\n end", "title": "" }, { "docid": "508f3123c827a165965ac5c9e043b60e", "score": "0.50545204", "text": "def update!(**args)\n @simple_responses = args[:simple_responses] if args.key?(:simple_responses)\n end", "title": "" }, { "docid": "508f3123c827a165965ac5c9e043b60e", "score": "0.50545204", "text": "def update!(**args)\n @simple_responses = args[:simple_responses] if args.key?(:simple_responses)\n end", "title": "" }, { "docid": "93ec12788531c94fd9cec689ad31de7c", "score": "0.5043703", "text": "def update\n respond_to do |format|\n if @special_rule.update(special_rule_params)\n format.html { redirect_to @special_rule, notice: 'Special rule was successfully updated.' }\n format.json { render :show, status: :ok, location: @special_rule }\n else\n format.html { render :edit }\n format.json { render json: @special_rule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ad628f1fbccc9ec84489acc4f44a2ff1", "score": "0.50429237", "text": "def patch_update\n user = @company.public_send(ScimRails.config.scim_users_scope).find(params[:id])\n update_status(user)\n json_scim_response(object: user)\n end", "title": "" }, { "docid": "10ab37b76ae206143b366665cc7aeae9", "score": "0.5042427", "text": "def update\n respond_to do |format|\n if @custom_notification.update(custom_notification_params)\n format.html { redirect_to @custom_notification, notice: 'Custom notification was successfully updated.' }\n format.json { render :show, status: :ok, location: @custom_notification }\n else\n format.html { render :edit }\n format.json { render json: @custom_notification.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "efeb8903a9655b544550037e138720f8", "score": "0.50419647", "text": "def update\n respond_to do |format|\n if @special_rule.update(special_rule_params)\n format.html { redirect_to @special_rule, notice: \"Special rule was successfully updated.\" }\n format.json { render :show, status: :ok, location: @special_rule }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @special_rule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "30c79d657301006e871a2b54802ca82f", "score": "0.5040194", "text": "def edit!(properties)\n payload = edit_payload(properties)\n payload[:bid] = (payload[:bid] * 100) unless payload[:bid].nil?\n @edit_api_body = update_with_api(payload)\n end", "title": "" }, { "docid": "c771050f538a2127869c0ebe464413a8", "score": "0.5036068", "text": "def update\n p = provision_request_params\n\n Rails.logger.info 'PR UPDATE'\n Rails.logger.info \"old status #{@provision_request.status}, new status #{p[:status]}\"\n\n p[:status] = p[:status].to_i\n if @provision_request.status != p[:status]\n Rails.logger.info \"UPDATE STATUS TRUE\"\n update_status = true\n else\n Rails.logger.info \"UPDATE STATUS FALSE\"\n end\n\n respond_to do |format|\n if @provision_request.update(p)\n if update_status\n case p[:status]\n when 1\n Rails.logger.info \"...accepting\"\n\n @provision_request.accept!\n flash_message 'success', 'Provision request was successfully accepted.'\n when 2\n Rails.logger.info \"...denying\"\n\n @provision_request.devices.update_all(provisioned: false)\n @provision_request.deny!\n flash_message 'warning', 'Provision request was successfully denied.'\n else\n Rails.logger.info \"...ELSE\"\n end\n end\n\n# PublishDevicesJob.perform_later(@provision_request.network)\n\n flash_message 'success', 'Provision request was successfully updated.'\n\n format.html { redirect_to @provision_request }\n format.json { render :show, status: :ok, location: @provision_request }\n else\n format.html { render :edit }\n format.json { render json: @provision_request.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4295bf3904403ed5de10c0adc8ffea3c", "score": "0.5034114", "text": "def prop_patch(prop_patch)\n @properties = prop_patch.mutations\n prop_patch.remaining_result_code = 200\n end", "title": "" }, { "docid": "6cc2018acaa6891d9bd735e9e3353641", "score": "0.5031705", "text": "def update\n @promotion_type = PromotionType.find(params[:id])\n\n respond_to do |format|\n if @promotion_type.update_attributes(params[:promotion_type])\n format.html { redirect_to promotion_types_path, notice: 'Promotion type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @promotion_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
35eb461d3c233ff092fc3e1595130642
When not closed but current time period is closed
[ { "docid": "7a95bec80c177bdb521c4792d4a47003", "score": "0.6987588", "text": "def maybe_build_reopened_time_period\n return if closed?\n return unless current_time_period&.closed?\n\n reconcile_time_period(:reopened)\n\n true\n end", "title": "" } ]
[ { "docid": "b7b671b8f90f25b803b594771bc0f915", "score": "0.7476847", "text": "def closed?\n !closed_at.blank?\n end", "title": "" }, { "docid": "ba50fcdd9499e61fe7614b140bebc6a7", "score": "0.7440737", "text": "def is_closed?(timeslot)\n !self.is_open?(timeslot)\n end", "title": "" }, { "docid": "379b7c16a93508bda80b4fc08c1f63e1", "score": "0.72214633", "text": "def closed?\n closed_at.try(:past?)\n end", "title": "" }, { "docid": "756de00fe11ef945f54a2a2e5d0e78aa", "score": "0.7128553", "text": "def is_closed\n if ((self.closed) && self.closed > 0 && self.closed < Time.now.to_i)\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "154290b8621ac89743be899f4ae5edf4", "score": "0.71198946", "text": "def closed?\n closed_on.present?\n end", "title": "" }, { "docid": "b1f9d48a01d8c1e259d80227f0d0bb04", "score": "0.706694", "text": "def do_close\n self.closed_at = Time.now.utc\n end", "title": "" }, { "docid": "93e58dfbdba2e92305b95b210ffbbe38", "score": "0.70319206", "text": "def closed?\n minutes_open = (Time.zone.now - self.created_at)/60.0\n time_limit = workout_offering.time_limit_for(user)\n\n !time_limit.nil? && minutes_open >= time_limit\n end", "title": "" }, { "docid": "93e58dfbdba2e92305b95b210ffbbe38", "score": "0.70319206", "text": "def closed?\n minutes_open = (Time.zone.now - self.created_at)/60.0\n time_limit = workout_offering.time_limit_for(user)\n\n !time_limit.nil? && minutes_open >= time_limit\n end", "title": "" }, { "docid": "2ec296ea5ff572ca4f21f35afec7e842", "score": "0.7022677", "text": "def closed?\n status == 'closed'\n end", "title": "" }, { "docid": "238084a50dce1e6bb0652699dc80e459", "score": "0.69971764", "text": "def closed?\n status == \"closed\"\n end", "title": "" }, { "docid": "b6609de387ee4ad3f8025192f5659c8d", "score": "0.699006", "text": "def close_entry?\n closed_at < DateTime.now\n end", "title": "" }, { "docid": "9c431968952735ccee7c12ee1d51d6eb", "score": "0.6865387", "text": "def close\n self.closed_at ||= Time.zone.now\n end", "title": "" }, { "docid": "b6d395d6ae2ed954613d7cac72a66dc6", "score": "0.6864061", "text": "def closed?\n self.status.eql?(\"closed\")\n end", "title": "" }, { "docid": "4155b83277e9ba48c4be33441340e3a6", "score": "0.67957306", "text": "def closed?\n self.status.is_closed?\n end", "title": "" }, { "docid": "4155b83277e9ba48c4be33441340e3a6", "score": "0.67957306", "text": "def closed?\n self.status.is_closed?\n end", "title": "" }, { "docid": "eed3a30e03fefdec6157da2ddccc6d06", "score": "0.6741514", "text": "def not_yet_open?\n opened_at > DateTime.now\n end", "title": "" }, { "docid": "c2bc8a6d20965cbcc05c41f78b02baaf", "score": "0.67268795", "text": "def closed?\n state == \"closed\"\n end", "title": "" }, { "docid": "9fb3cea3ca03cdd889c60d132cc126fa", "score": "0.6714744", "text": "def is_closed_at?(evaluation_date = Date.today)\n get_end_date < evaluation_date\n end", "title": "" }, { "docid": "3b29ffcfe66dc3e4262835e2e20b6e24", "score": "0.6619373", "text": "def has_closed_rent\r\n if ((self.rent_closed) && (self.rent_closed != 0))\r\n if Time.at(rent_closed) <= Time.now\r\n return true\r\n else\r\n return false\r\n end\r\n else\r\n return false\r\n end\r\n end", "title": "" }, { "docid": "fa3f8bf7a778956c72c2e3b796e03e89", "score": "0.659143", "text": "def closed?\n self.state == 'CLOSED'\n end", "title": "" }, { "docid": "0bbdca4f3282a0999abb4a491d783e48", "score": "0.65677595", "text": "def closed\n wrap(@inner.select { |event| event.event == 'closed' })\n end", "title": "" }, { "docid": "46001328bdfc34b75cdc1b1e67903fda", "score": "0.65390253", "text": "def close_date(event)\n ((event.start_date-Time.now)< 259146.01469397545)\n end", "title": "" }, { "docid": "1644976d2ff1dd274975c579817b24b4", "score": "0.6530842", "text": "def close\n self.closed = true\n self.date_closed = Date.today\n self.save!\n end", "title": "" }, { "docid": "c512e99963087c62ec0ecd1cfad4ea82", "score": "0.65130067", "text": "def closed?\n state == :closed\n end", "title": "" }, { "docid": "f0554edef939debe45d9865f2edc721c", "score": "0.6505425", "text": "def closed?\n state_name == \"closed\"\n end", "title": "" }, { "docid": "7aaa14874a5ad03131d7c2bd5656bf21", "score": "0.6495248", "text": "def open?\n open_date < Time.now && !past_deadline? rescue nil\n end", "title": "" }, { "docid": "98f8f37addb169ad326404b6d326e3bf", "score": "0.64729214", "text": "def comments_closed?\n return false if self.comments_expire_at.nil?\n Date.today >= self.comments_expire_at.to_date\n end", "title": "" }, { "docid": "30533f97a0297f1640b8abafd27a3b5c", "score": "0.64690864", "text": "def set_or_unset_closed_at\n if self.status_changed? and\n if self.status == \"closed\"\n self.closed_at = Time.current\n else\n self.closed_at = nil\n end\n end\n end", "title": "" }, { "docid": "8b3605843858c37c3b59df3e04d28e5f", "score": "0.63918704", "text": "def check_for_close\n if self.event_name == 'spree.set_special_price'\n current_date = Time.zone.now\n if self.promotion_rules.present?\n if self.changed.include? 'expires_at'\n if self.expires_at < current_date\n PromotionJob.start_promotion(self,'close') if self.promotion_actions.where(:type =>'Spree::Promotion::Actions::Discount').present?\n end\n if self.expires_at > current_date && self.starts_at < current_date\n PromotionJob.start_promotion(self,'start') if self.promotion_actions.where(:type =>'Spree::Promotion::Actions::Discount').present?\n end\n end\n if self.changed.include? 'starts_at'\n if self.starts_at < current_date\n PromotionJob.start_promotion(self,'start') if self.promotion_actions.where(:type =>'Spree::Promotion::Actions::Discount').present?\n end\n end\n end\n end\n end", "title": "" }, { "docid": "fc3d9ca445b909a2c563e66bb24df05d", "score": "0.63909686", "text": "def closed(opts={})\n ordered(:closed_at)\n date_time_filter(:closed_at, time_range(opts[:on], opts[:during], opts[:since], opts[:until]))\n self\n end", "title": "" }, { "docid": "0cddf462990edabf5593cd4651a48f14", "score": "0.6384721", "text": "def overdue?\n if is_appointment?\n start_date.to_date < Time.zone.now.to_date\n else\n open? && end_date.to_date < Time.zone.now.to_date\n end\n end", "title": "" }, { "docid": "76db6938a85d4333af1572130f80f170", "score": "0.6384319", "text": "def show_only?\n now = Time.now.to_i\n now >= end_time && now <= close_time\n end", "title": "" }, { "docid": "efc38f242d28c625d53e11da4dfb643f", "score": "0.63720435", "text": "def closed?\n not @open\n end", "title": "" }, { "docid": "cad880d33476e4a01caa92a1a1e857c1", "score": "0.6362553", "text": "def bidding_open?\n return self.auction_end.blank? || self.auction_end.future?\n end", "title": "" }, { "docid": "0636d339e7ba3967c9da6269c03bf3e0", "score": "0.63571715", "text": "def closed?\n @closed\n end", "title": "" }, { "docid": "0636d339e7ba3967c9da6269c03bf3e0", "score": "0.63571715", "text": "def closed?\n @closed\n end", "title": "" }, { "docid": "0636d339e7ba3967c9da6269c03bf3e0", "score": "0.63571715", "text": "def closed?\n @closed\n end", "title": "" }, { "docid": "0636d339e7ba3967c9da6269c03bf3e0", "score": "0.63571715", "text": "def closed?\n @closed\n end", "title": "" }, { "docid": "e138f0da411396004bddbac565fa5702", "score": "0.63077503", "text": "def closing?\n action == 'closed'\n end", "title": "" }, { "docid": "b05d36216e19e432e2588a0af3184b60", "score": "0.62927705", "text": "def closing_stock\n closing_stock_on_date(Time.zone.now.to_date, nil)\n end", "title": "" }, { "docid": "eeef82fa5f3b0668db95c5e3fb4c89e0", "score": "0.62886393", "text": "def open\n self.closed_at = nil\n end", "title": "" }, { "docid": "fa598cdecc307d920b0643d1d9ed5488", "score": "0.62837166", "text": "def hours_until_close\n (self.closing_date.to_time - Time.zone.now.to_time) / 1.hours\n end", "title": "" }, { "docid": "ca61109c7308052089d102e5d098366f", "score": "0.6282046", "text": "def closed_date_time\n return @closed_date_time\n end", "title": "" }, { "docid": "5c453cfcdacf92b5edb5cdfd7f8d1065", "score": "0.6275538", "text": "def ending?\n active? && !canceled_at.nil?\n end", "title": "" }, { "docid": "0b9cb06325c6ac53e7542a8479fc5b15", "score": "0.6264109", "text": "def closed?\n @closed.true?\n end", "title": "" }, { "docid": "dfdb4948be2b9678b745cd8013647fd5", "score": "0.6260153", "text": "def not_open\n if self.time.to_i < restaurant.open_at.to_i || self.time.to_i > restaurant.close_at.to_i\n errors.add(:date, \"Restaurant not open at that time\")\n end\n end", "title": "" }, { "docid": "a1f96be8b47acf7e68364bf4f1e75b16", "score": "0.6257916", "text": "def closed?\n open ? false : true\n end", "title": "" }, { "docid": "7cf51a6f89e9ef5100469ee377486058", "score": "0.62347645", "text": "def open?\n return false if close_today?\n today = self.time_tables.find_by(day_of_week: Time.now.wday)\n (today.opened_at...today.closed_at).include?(Time.now.hour)\nend", "title": "" }, { "docid": "fa6e090f70a1feb93473148b352633b1", "score": "0.62106484", "text": "def cancelled\n !ends_at.nil?\n end", "title": "" }, { "docid": "54a93e166770c24470240ebb434bb3a8", "score": "0.62091994", "text": "def closed?\n !open?\n end", "title": "" }, { "docid": "f54ca6a5b7445ff0852229f32c9eb24d", "score": "0.61991084", "text": "def closed_value\n \"to:#{midnight_today}\"\n end", "title": "" }, { "docid": "48bd91e2b4cb3b401ff21a35351b0544", "score": "0.6195537", "text": "def open?\n return\n (Time.now.hour >= 9 && Time.now.hour <= 12) ||\n super\n end", "title": "" }, { "docid": "f1aaef5282e828b672098a7b017e3f9d", "score": "0.6179754", "text": "def check_close_data_presence(meeting)\n return if meeting.closed_at.present? || !minutes_data?(meeting)\n\n meeting.closed_at = Time.current\nend", "title": "" }, { "docid": "b3965e2a2f94f41cc9f69f89ee7a2eff", "score": "0.61760163", "text": "def update_closed_on\n if closing?\n self.closed_on = updated_on\n end\n end", "title": "" }, { "docid": "26ac00cc41ed574c494a5bf678023904", "score": "0.6172452", "text": "def time_over?\r\n return self.due_date <= Time.now\r\n end", "title": "" }, { "docid": "22c31c6e9d1f18d8c8939fbed05ccee2", "score": "0.61708313", "text": "def closed?\n end", "title": "" }, { "docid": "22c31c6e9d1f18d8c8939fbed05ccee2", "score": "0.61708313", "text": "def closed?\n end", "title": "" }, { "docid": "5c9ea0b14f2e2519d012829b650cb913", "score": "0.6157531", "text": "def missed_deadline?\n if self.closeDate.nil?\n self.dueDate.to_date < Date.today\n else\n self.dueDate.to_date < self.closeDate.to_date\n end\n end", "title": "" }, { "docid": "e10f9a894ec424cb1189f0a8ca69a16a", "score": "0.6152275", "text": "def check_for_closed_incidents\n incidents.where(status: 'Closed').each(&:check_closed_at_time)\n end", "title": "" }, { "docid": "eb0db4cd62a1a866ed2cd8c1885261c4", "score": "0.6149098", "text": "def canceled?\n #if canceled_on && approved_on && canceled_on.to_time > approved_on.to_time\n if canceled_on != nil\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "2c79510d43de9ca7dc177beace756dbd", "score": "0.61477834", "text": "def expired?\n pledging_ends_on.past?\n end", "title": "" }, { "docid": "9fad9872b43bfe49f50c061e1359d55c", "score": "0.61445904", "text": "def closed?\n (contact && contact.closed?) && (event && event.closed?)\n end", "title": "" }, { "docid": "5c4a32fae66a9d4412679c2de16c5083", "score": "0.6141173", "text": "def can_close?; end", "title": "" }, { "docid": "24f5e68cd3ef6db0430be8998c80a382", "score": "0.613388", "text": "def open?\n return Time.now.hour >= 18 && Time.now.hour <= 22\n end", "title": "" }, { "docid": "8001357669e1a198b63b05c63a93d0fe", "score": "0.61322904", "text": "def closed?\n @closed || false\n end", "title": "" }, { "docid": "9680f0b0510a995c1a6aa928819e3ab4", "score": "0.6125587", "text": "def closed?\n @closed\n end", "title": "" }, { "docid": "9680f0b0510a995c1a6aa928819e3ab4", "score": "0.6125587", "text": "def closed?\n @closed\n end", "title": "" }, { "docid": "9680f0b0510a995c1a6aa928819e3ab4", "score": "0.6125587", "text": "def closed?\n @closed\n end", "title": "" }, { "docid": "9680f0b0510a995c1a6aa928819e3ab4", "score": "0.6125587", "text": "def closed?\n @closed\n end", "title": "" }, { "docid": "9680f0b0510a995c1a6aa928819e3ab4", "score": "0.6125587", "text": "def closed?\n @closed\n end", "title": "" }, { "docid": "9680f0b0510a995c1a6aa928819e3ab4", "score": "0.6125587", "text": "def closed?\n @closed\n end", "title": "" }, { "docid": "9680f0b0510a995c1a6aa928819e3ab4", "score": "0.6125587", "text": "def closed?\n @closed\n end", "title": "" }, { "docid": "9680f0b0510a995c1a6aa928819e3ab4", "score": "0.6125587", "text": "def closed?\n @closed\n end", "title": "" }, { "docid": "9680f0b0510a995c1a6aa928819e3ab4", "score": "0.6125587", "text": "def closed?\n @closed\n end", "title": "" }, { "docid": "9680f0b0510a995c1a6aa928819e3ab4", "score": "0.6125587", "text": "def closed?\n @closed\n end", "title": "" }, { "docid": "9680f0b0510a995c1a6aa928819e3ab4", "score": "0.6125587", "text": "def closed?\n @closed\n end", "title": "" }, { "docid": "9680f0b0510a995c1a6aa928819e3ab4", "score": "0.6125587", "text": "def closed?\n @closed\n end", "title": "" }, { "docid": "9680f0b0510a995c1a6aa928819e3ab4", "score": "0.6125587", "text": "def closed?\n @closed\n end", "title": "" }, { "docid": "154de1d860d14513ab563ed11f043a14", "score": "0.6108392", "text": "def closed_reason\n NOTIFICATION[:get_closed_reason].call @notification\n end", "title": "" }, { "docid": "0f2c3ced480eb535793095b8f1c1d9ff", "score": "0.6105907", "text": "def open_entry?\n opened_at <= DateTime.now.to_date && closed_at >= DateTime.now.to_date\n end", "title": "" }, { "docid": "d0f7d589eaa3702dc219e3138e1dad9d", "score": "0.6104795", "text": "def closed?\n !!@closed\n end", "title": "" }, { "docid": "5a82d83c0dc478040343eb7c2d8130a5", "score": "0.6104307", "text": "def open?(time = nil)\n time = Time.new if time.nil?\n time = time.in_time_zone(self.time_zone)\n day_index = time.wday\n return unless open_on_day? day_index\n hours = hours_on_day day_index\n (time > hours[0]) && (time < hours[1])\n end", "title": "" }, { "docid": "6d244119751458e2ac5ee198931c2617", "score": "0.6103748", "text": "def implement_closed_status\n # when closing the baseline, close all estimations of the baseline\n self.estimations.each do |e|\n e.close! unless e.status ==:closed or e.status==:final\n end\n end", "title": "" }, { "docid": "740dbe8ffe03cd8f68718f2ffc082108", "score": "0.61028194", "text": "def closed?() @closed end", "title": "" }, { "docid": "4176c4f9ce4c45ba873d614baa2afe95", "score": "0.6097003", "text": "def on_grace_period\n !!(ends_at && ends_at.future?)\n end", "title": "" }, { "docid": "6c2ea501fd8cfcc19869c2dedf0a7689", "score": "0.6059774", "text": "def cancel_appointment appointment\n time_range = TimeRange.new appointment.started_at, appointment.finished_at\n if appointment.daily_schedule_id == self.id\n self.free time_range\n true\n end\n false\n end", "title": "" }, { "docid": "de6cd544baec9f8d5d34d9534da890f9", "score": "0.6049039", "text": "def do_close\n self.void_pending_purchase_orders\n self.closed_at = Time.now.utc\n self.kase.sweep_max_reward_price_cache if self.kase\n self.send_canceled\n end", "title": "" }, { "docid": "2b1e658cb22b03f2ff2a61e34320b23c", "score": "0.60471827", "text": "def closed?\n @closed\n end", "title": "" }, { "docid": "cd84f22b1b29aaeee1245de1631c3f81", "score": "0.6038907", "text": "def closed?\n defined?(@closed) && @closed\n end", "title": "" }, { "docid": "88b773040dc19d65b5f422e569314ef4", "score": "0.6034099", "text": "def open\n return start_date <= Time.now.to_date && end_date >= Time.now.to_date\n end", "title": "" }, { "docid": "87a42c88d643c01549942804ef75383f", "score": "0.6028308", "text": "def close(date_time)\n self.update_attributes({:closed => date_time})\n end", "title": "" }, { "docid": "db15301223bbc305af05d25be974ac01", "score": "0.6026498", "text": "def open?\n @ban_until > Time.now\n end", "title": "" }, { "docid": "db15301223bbc305af05d25be974ac01", "score": "0.6026498", "text": "def open?\n @ban_until > Time.now\n end", "title": "" }, { "docid": "c8d8a077b95c06980be61825f5292877", "score": "0.6024148", "text": "def confirmation_period_expired?; end", "title": "" }, { "docid": "4d43421977e2ca71bb3cdead5ea4d2d6", "score": "0.6019046", "text": "def open?\n return closetime && closetime > DateTime.now\n end", "title": "" }, { "docid": "0cb2ad37633cb3d85dbddcf7025e5650", "score": "0.60161555", "text": "def overdue?\n due < Date.current\n end", "title": "" }, { "docid": "9234a3d16acd3345acb2d079ec498095", "score": "0.6013185", "text": "def closed?\n @state == :disconnected\n end", "title": "" }, { "docid": "894fb1485b2f60e210bba67a20333782", "score": "0.5988467", "text": "def ended\n !!(cancelled && !on_grace_period)\n end", "title": "" }, { "docid": "58d94d34fa69f667d5f8a9a40e973a65", "score": "0.59877634", "text": "def open?\n\t\t@time = Time.now.to_formatted_s(:time)\n\t\t#Recupere le numero du jour actuel\n\t\tday = Time.now\n\t\tday = day.strftime(\"%w\")\n\t#Recupere l'operating_hour du jour actuel\n\t\t@open = self.operating_hours.find_by(day: day)\n\t\t@open.update(close_soon: false)\n\n\t\t@open_time = @open[:open].to_formatted_s(:time)\n\t\t@close_time = @open[:close].to_formatted_s(:time)\n\n\n\t\tif @open_time < @close_time\n\t\t\tif @time >= @open_time && @time <= @close_time\n\t\t\t\tif @time >= @open[:close] - 60*30\n\t\t\t\t\t@open.update(close_soon: true)\n\t\t\t\tend\n\t\t\treturn true\n\t\t\telse\n\t\t\treturn false\n\t\t\tend\n\t\telse\n\t\t\tif @time <= @open_time && @time >= @close_time\n\t\t\t\treturn false\n\t\t\t\telse\n\t\t\t\t\tif @time >= @open[:close] - 60*45\n\t\t\t\t\t\t@open.update(close_soon: true)\n\t\t\t\t\tend\n\t\t\t\treturn true\n\t\t\t\tend\n\t\t\tend\n\tend", "title": "" }, { "docid": "6ac47fac6490732c6813e775c7ef0bbe", "score": "0.5986997", "text": "def closed?()\n #This is a stub, used for indexing\n end", "title": "" } ]
f31bb9834d4c3d3c7c4f91983408f555
GET /cart_items/1 GET /cart_items/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "18435c8b319cf3e78c08e2c11b96d1c2", "score": "0.7769855", "text": "def index\n @cart_items = CartItem.all\n\n render json: @cart_items\n end", "title": "" }, { "docid": "6d2204244eaed56c3a80295fed07d816", "score": "0.7608788", "text": "def show\n render json: @cart_item\n end", "title": "" }, { "docid": "8bed0cec7d2550669be5ffaf94811cbb", "score": "0.75968546", "text": "def show\n\t\trender json: @cart_item\n\tend", "title": "" }, { "docid": "53b68c8189e22000724b479b6e8d81a8", "score": "0.7593721", "text": "def index\n\t@cart_items = CartItem.all\n\n\trender json: @cart_items\n\tend", "title": "" }, { "docid": "c589ee1320104ebff7478e8579cc8b1a", "score": "0.7565653", "text": "def show\n @cart_item = CartItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cart_item }\n end\n end", "title": "" }, { "docid": "c589ee1320104ebff7478e8579cc8b1a", "score": "0.7565653", "text": "def show\n @cart_item = CartItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cart_item }\n end\n end", "title": "" }, { "docid": "03d1e163ebbc1ef686748c75f33b5950", "score": "0.7384345", "text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cart_items }\n end\n end", "title": "" }, { "docid": "33593cd1ba069140f05aca6e73e9ec95", "score": "0.7379109", "text": "def index\n @auth_shopping_cart_items = @auth_shopping_cart_item_class.find_cart_items({:resource => lookup_resource}).page 1\n respond_with @auth_shopping_cart_items\n end", "title": "" }, { "docid": "d8a328e4e1f395a5262854ca366b6cf6", "score": "0.7352747", "text": "def index\n if params[:cart_id]\n get_cart\n @items = Item.where(cart: @cart)\n elsif params[:order_id]\n get_order\n @items = Item.where(order: @order)\n end\n render json: @items, status: 200\n end", "title": "" }, { "docid": "cc0fc5be2f244f2626adc7f4aff51494", "score": "0.73462725", "text": "def show \n cart = Cart.find(params[:id])\n render json: cart\n end", "title": "" }, { "docid": "91457d9ff36a526a904158d6c516dbd0", "score": "0.73137695", "text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cart_item }\n end\n end", "title": "" }, { "docid": "a5da705aaf5923de38af74ec8904ca4a", "score": "0.72800833", "text": "def show\n @items = cart.items\n @products = @items.collect(&:product)\n \n respond_to do |format|\n format.html { render layout: false } \n format.json { render json: @items }\n end\n end", "title": "" }, { "docid": "bb1dd3b2b7b4fc30c973291cafb53616", "score": "0.72466755", "text": "def show_cart\n render json: User.find(params[:id]).cart_products\n end", "title": "" }, { "docid": "6f49884ed58c4c6f6d4effc3f9392e54", "score": "0.7174546", "text": "def view_cart\n render json: products_in_cart(false)\n end", "title": "" }, { "docid": "3323d98e268da07c701d9aba8d8c6d58", "score": "0.7071415", "text": "def index\n render json: { carts: current_user.carts.select(:id, :product_id, :quantity).to_json }\n end", "title": "" }, { "docid": "dbe4fdc12aaf91eb40eb9e139f3a97d0", "score": "0.7070208", "text": "def new\n @cart_item = CartItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cart_item }\n end\n end", "title": "" }, { "docid": "dbe4fdc12aaf91eb40eb9e139f3a97d0", "score": "0.7070208", "text": "def new\n @cart_item = CartItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cart_item }\n end\n end", "title": "" }, { "docid": "8c70ecd174a85df4d195b3cc5d636542", "score": "0.70121604", "text": "def show\n @cart = Cart.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cart }\n end\n end", "title": "" }, { "docid": "8c70ecd174a85df4d195b3cc5d636542", "score": "0.70121604", "text": "def show\n @cart = Cart.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cart }\n end\n end", "title": "" }, { "docid": "f28f196df324c585dc432232600d1e65", "score": "0.69788265", "text": "def index\n @shopping_cart_items = current_user.shopping_cart_items\n render json: {} unless @shopping_cart_items\n end", "title": "" }, { "docid": "94abbf9a6ea892da7421bd7fd214e43a", "score": "0.6967014", "text": "def index\n @cart_items = CartItem.all\n end", "title": "" }, { "docid": "94abbf9a6ea892da7421bd7fd214e43a", "score": "0.6967014", "text": "def index\n @cart_items = CartItem.all\n end", "title": "" }, { "docid": "94abbf9a6ea892da7421bd7fd214e43a", "score": "0.6967014", "text": "def index\n @cart_items = CartItem.all\n end", "title": "" }, { "docid": "94abbf9a6ea892da7421bd7fd214e43a", "score": "0.6967014", "text": "def index\n @cart_items = CartItem.all\n end", "title": "" }, { "docid": "94abbf9a6ea892da7421bd7fd214e43a", "score": "0.6967014", "text": "def index\n @cart_items = CartItem.all\n end", "title": "" }, { "docid": "f239f66d00cc23dd8f486aa1b2ee6c10", "score": "0.69310814", "text": "def index\n @carts = Cart.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @carts }\n end\n end", "title": "" }, { "docid": "f239f66d00cc23dd8f486aa1b2ee6c10", "score": "0.69310814", "text": "def index\n @carts = Cart.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @carts }\n end\n end", "title": "" }, { "docid": "3f74be3d02d9457bd02cb99107f2d11d", "score": "0.69308627", "text": "def show\n @carts_product = @cart.carts_products.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @carts_product }\n end\n end", "title": "" }, { "docid": "e36da4a2dac5504806124a614e31ca70", "score": "0.69261134", "text": "def index\n @carts_products = @cart.carts_products.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @carts_products }\n end\n end", "title": "" }, { "docid": "152d581951efef6e558168d5e08c64a4", "score": "0.6862929", "text": "def show_the_cart\n @cart_items = Nacho.find(cart)\n end", "title": "" }, { "docid": "cb8a03105a54606bc472415686438b85", "score": "0.6860977", "text": "def show\n #session_id = request.session_options[:id]\n session_id = cookies[:cart_id]\n @carts = Cart.where(\"session_id = ?\", session_id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cart }\n end\n end", "title": "" }, { "docid": "81da49dcaa8aff8f5a4a9f6de50fa915", "score": "0.68440765", "text": "def show\n @order = Order.find(params[:id])\n @items_in_order = ItemsInCart.where(order_id: @order.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @order }\n end\n end", "title": "" }, { "docid": "fa475aa76a84322e1d21bbd031fcf927", "score": "0.6840887", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cart_item }\n end\n end", "title": "" }, { "docid": "a3ea4da3fb720ebebc4c78d7fe331bf6", "score": "0.6746355", "text": "def show\n @shopping_cart = ShoppingCart.find(params[:id])\n if(@shopping_cart.user == current_user)\n @shopping_cart_hash = eval(@shopping_cart.item_list)\n @shopping_item_list = Array.new\n @total_price = 0\n @shopping_cart_hash.each do |item_id, quantity|\n @item = Item.find(Integer(item_id))\n @shopping_item_list += [{:item => @item, :quantity => quantity, :price => (quantity * @item.price)}]\n @total_price += (quantity * @item.price)\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shopping_cart }\n end\n else\n redirect_to root_path\n end\n end", "title": "" }, { "docid": "1157d3e59ccbc635d120463e7cf5091c", "score": "0.6744956", "text": "def get_item(account_number, cart_id, item_id)\r\n # the base uri for api requests\r\n query_builder = Configuration.base_uri.dup\r\n\r\n # prepare query string for API call\r\n query_builder << '/accounts/{account_number}/carts/{cart_id}/items/{item_id}'\r\n\r\n # process optional query parameters\r\n query_builder = APIHelper.append_url_with_template_parameters query_builder, {\r\n 'account_number' => account_number,\r\n 'cart_id' => cart_id,\r\n 'item_id' => item_id\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 'X-Auth-Token' => Configuration.x_auth_token\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 == 401\r\n raise APIException.new 'You are not authenticated', 401, response.raw_body\r\n elsif response.code == 403\r\n raise APIException.new 'This action needs a valid WSSE header', 403, response.raw_body\r\n elsif response.code == 404\r\n raise APIException.new 'Resource not found', 404, response.raw_body\r\n elsif response.code == 400\r\n raise APIException.new 'Http bad request', 400, response.raw_body\r\n elsif !response.code.between?(200, 206) # [200,206] = HTTP OK\r\n raise APIException.new 'HTTP Response Not OK', response.code, response.raw_body\r\n end\r\n\r\n response.body\r\n end", "title": "" }, { "docid": "de861b9d0d06a72b4003e635cc8c0fdd", "score": "0.67446256", "text": "def index\n @cart = get_cart()\n end", "title": "" }, { "docid": "8f9f8dae1c8112b56acf6356122941f7", "score": "0.66865224", "text": "def index\n @shopping_carts = ShoppingCart.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shopping_carts }\n end\n end", "title": "" }, { "docid": "6fde0326f933993929330fc3a46c64e6", "score": "0.66744953", "text": "def create \n @cart = Cart.create({User_id: cart_params[\"id\"]})\n \n @response = {\n cart: @cart,\n items: Item.all\n }\n \n render json: @response.to_json\n end", "title": "" }, { "docid": "a813de056ceac9ad9e6d88a13c5c5571", "score": "0.66605735", "text": "def show\n @order = Order.find(params[:id])\n @user = current_or_guest_user\n\t @cartitems = @user.orders.find(@order.id).cart_items.where(:item_type=>\"order\") \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @order }\n end\n end", "title": "" }, { "docid": "776883e59aa15c7d4f21dc7821adfc69", "score": "0.6651166", "text": "def show\n @cart = current_user.cart\n @all_items = @cart.items\n end", "title": "" }, { "docid": "50d5a8baea8a271aed88483ae1d8a08e", "score": "0.6624341", "text": "def create\n @cart_item = CartItem.new(cart_item_params)\n\n if @cart_item.save\n render json: @cart_item, status: :created, location: @cart_item\n else\n render json: @cart_item.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "8adec3f7e42edf4b4326eafedec4d5df", "score": "0.661411", "text": "def show\n @order = Order.find(params[:id])\n\t @items = CartItem.where(:order_id=>@order.id)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_order }\n end\n end", "title": "" }, { "docid": "75528ac534fa49a52187dcdd461e6230", "score": "0.6613114", "text": "def cart_get(cart_id, hmac)\n cg = CartGet.new\n cg.params.merge!( { 'CartId' => cart_id, 'HMAC' => hmac } )\n\n @rg = ResponseGroup.new( 'Cart' )\n cart = search( cg, @rg ).cart_get_response.cart\n\n @cart_id = cart.cart_id\n @hmac = cart.hmac\n @purchase_url = cart.purchase_url\n\n if ci = cart.cart_items\n @cart_items = ci.cart_item\n else\n @cart_items = []\n end\n\n if sfl = cart.saved_for_later_items\n @saved_for_later_items = sfl.saved_for_later_item\n else\n @saved_for_later_items = []\n end\n\n self\n end", "title": "" }, { "docid": "7948933fe034c3c272ed9a7c58eeae4a", "score": "0.6606209", "text": "def getPendingItemInfo\n @output = []\n @items = Item.where(status: \"pending\")\n for item in @items do\n for cart in item.carts do\n @user = User.find(cart.user_id)\n @output << {user: @user, item: item, cart_id: cart.id }\n end\n end\n render :json => @output\n end", "title": "" }, { "docid": "dbcde1464e2d4ee2beb043e7d4d6c157", "score": "0.66038173", "text": "def show\n @cartum = Cartum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cartum }\n end\n end", "title": "" }, { "docid": "85d01ffdc5cfb2ae949b6c570415bdd1", "score": "0.6599771", "text": "def all\n @carts = Cart.get_all_of_carts(@user, params[:page])\n if @carts.present?\n @carts\n else\n @object = 'Cart'\n render \"api/v1/errors/404\", status: 401\n end\n end", "title": "" }, { "docid": "6bc2edf63539196d0091addc89295a23", "score": "0.6580697", "text": "def items\n \tbegin\n \t\t@categories = Category.all.includes(items: [:dimensions])\n\t \tif user_signed_in?\n\t \t\t@cart = Cart.find_by(user_id: current_user.id, purchased: false)\n\t \t\telse\n\t \t\t@cart = Cart.find_by(session_id: session[:session_id], purchased: false)\n\t \tend\n\t \trender :items, status: :ok\n \trescue Exception => e\n \t\terror_handling_bad_request(e)\n \tend\n\n\tend", "title": "" }, { "docid": "6f16e8c8ec8ec3b3d459c21033fc0fe0", "score": "0.6565349", "text": "def index\n @cart_items = current_customer.cart_items\n @cart_item = CartItem.new\n end", "title": "" }, { "docid": "6d04a48280046048b34192aa8f0f3979", "score": "0.6561273", "text": "def items_from_cart\n items = session[:cart]\n products = []\n items.each do |item|\n product = Product.find(item['product'])\n products << { name: product.name, price: product.price, image: product.product_images[0].image.url(:thumb), quantity: item['quantity'] }\n end\n return products\n end", "title": "" }, { "docid": "1105e2ec6b788d4081460910b4dc7686", "score": "0.65374845", "text": "def show\n @cart_item = CartItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @cart_item }\n end\n end", "title": "" }, { "docid": "1105e2ec6b788d4081460910b4dc7686", "score": "0.65374845", "text": "def show\n @cart_item = CartItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @cart_item }\n end\n end", "title": "" }, { "docid": "1105e2ec6b788d4081460910b4dc7686", "score": "0.65374845", "text": "def show\n @cart_item = CartItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @cart_item }\n end\n end", "title": "" }, { "docid": "6f3acb04ace9796b255d64487e819559", "score": "0.65314424", "text": "def show\n redirect_to cart_items_url\n end", "title": "" }, { "docid": "9d22a48d10d1a421e3ba60da69d1c39b", "score": "0.6526838", "text": "def create\n\t\t@cart_item = CartItem.new(cart_item_params)\n\n\t\tif @cart_item.save\n\t\t render json: @cart_item, status: :created, location: @cart_item\n\t\telse\n\t\t render json: @cart_item.errors, status: :unprocessable_entity\n\t\tend\n\tend", "title": "" }, { "docid": "bb7f1dd546fc5b64a1fc93e79068fb49", "score": "0.6524373", "text": "def show\n begin\n @cart = Cart.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n logger.error \"Attempt to access invalid cart #{params[:id]}\"\n redirect_to root_url, :notice => 'Invalid cart'\n else\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cart }\n end\n end\n end", "title": "" }, { "docid": "54748291efc0ecbbc050090a2600e1b8", "score": "0.6518547", "text": "def show\n @items = Item.find(params[:id])\n render json: @items\n end", "title": "" }, { "docid": "196801831a75757e64bd58ddbfa8c969", "score": "0.6493899", "text": "def get_item( item )\n @session.base_url = \"http://cl.ly\"\n resp = @session.get( \"/\" + item )\n \n raise ItemNotFound if resp.status == 404\n Crack::JSON.parse(resp.body)\n end", "title": "" }, { "docid": "6a8346c3d0b463005b475217f2bd7e53", "score": "0.6483404", "text": "def get_food_item_quanity key, item_id, index\n\t\tcart = cookies.fetch(:cart, '{}')\n\t cart = JSON.parse(cart)\n\t if cart[key][index][\"item_id\"] == item_id\n\t \tcart[key][index][\"quantity\"]\n\t end\n\tend", "title": "" }, { "docid": "bcb7a3b845a2d64af07ce93fb8da8cdb", "score": "0.6474745", "text": "def index\n @cart_products = if current_user.cart.present?\n current_user.cart.carts_products.includes(:product).all\n else\n []\n end\n render formats: :json\n end", "title": "" }, { "docid": "bb121b2aacbdf4346229f53c78b945a6", "score": "0.6451481", "text": "def new\n @cart = Cart.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cart }\n end\n end", "title": "" }, { "docid": "bb121b2aacbdf4346229f53c78b945a6", "score": "0.6451481", "text": "def new\n @cart = Cart.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cart }\n end\n end", "title": "" }, { "docid": "bb121b2aacbdf4346229f53c78b945a6", "score": "0.6451481", "text": "def new\n @cart = Cart.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cart }\n end\n end", "title": "" }, { "docid": "bb121b2aacbdf4346229f53c78b945a6", "score": "0.6451481", "text": "def new\n @cart = Cart.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cart }\n end\n end", "title": "" }, { "docid": "bb121b2aacbdf4346229f53c78b945a6", "score": "0.6451481", "text": "def new\n @cart = Cart.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cart }\n end\n end", "title": "" }, { "docid": "bb121b2aacbdf4346229f53c78b945a6", "score": "0.6451481", "text": "def new\n @cart = Cart.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cart }\n end\n end", "title": "" }, { "docid": "bb121b2aacbdf4346229f53c78b945a6", "score": "0.6451481", "text": "def new\n @cart = Cart.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cart }\n end\n end", "title": "" }, { "docid": "bb121b2aacbdf4346229f53c78b945a6", "score": "0.6451481", "text": "def new\n @cart = Cart.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cart }\n end\n end", "title": "" }, { "docid": "4accf45f23cc09e3050a11c611261dd6", "score": "0.6447483", "text": "def show\n @cart = Cart.find( params[\"id\"] )\n # raise\n\n respond_to :html, :json\n\n\n end", "title": "" }, { "docid": "a10e2787f5a09c82e9cadb7afa98762f", "score": "0.63917255", "text": "def set_cart_item\n @cart_item = @cart.cart_items.find(params[:id])\n end", "title": "" }, { "docid": "d94325b99086f6989b0f398906d67b67", "score": "0.63621277", "text": "def cart\n Product.find(session[:user_cart])\n end", "title": "" }, { "docid": "4e7c50e6d92c21801c515798c541495a", "score": "0.6355504", "text": "def set_cart_item\r\n \t \t@cart_item = CartItem.find(params[:id])\r\n \t\tend", "title": "" }, { "docid": "acaf6167c14c8057efbbdb663952cc5f", "score": "0.6347742", "text": "def update\n cart_item = current_user.cart.cart_items.where(\"item_id = ?\", cart_items_params[:item_id]).first\n cart_item.quantity += cart_items_params[:quantity].to_i\n if cart_item.quantity < 1\n if cart_item.delete\n @cart = CartItem.where(cart_id: current_user.cart_id).order(created_at: :desc)\n render 'carts/show'\n else\n render json: ['no such product in the cart'], status: 404\n end\n else\n if cart_item.save\n @cart = CartItem.where(cart_id: current_user.cart_id).order(created_at: :desc)\n render 'carts/show'\n else\n render cart_item.errors.full_messages, status: 422\n end\n end\n end", "title": "" }, { "docid": "8b83c5ddf9e5abadedcbc0a066131980", "score": "0.63447803", "text": "def get_items(product_id, params={})\n self.client.get(\"products/#{product_id}/items\", params)\n end", "title": "" }, { "docid": "627cf40dc193777ad9d3f9ce9d348114", "score": "0.6324245", "text": "def view_cart\n @products\n end", "title": "" }, { "docid": "23c242a34cee10e8e5b1a2506b537f7c", "score": "0.6323103", "text": "def get_cart\n if session[:cart]\n @cart = session[:cart]\n else\n @cart = []\n end\n end", "title": "" }, { "docid": "5fcdcd302822b76c2a4cecd0717d4e40", "score": "0.6322944", "text": "def index\n @mycarts = Mycart.all\n end", "title": "" }, { "docid": "98e1288315a0075486b7f175b6da82c8", "score": "0.6320391", "text": "def create\n if @cart_item = CartItem.find_by(cart_id: cart_item_params[:cart_id], product_id: cart_item_params[:product_id])\n @cart_item.quantity += cart_item_params[:quantity] || 1\n else\n @cart_item = CartItem.new(cart_item_params)\n end\n\n if @cart_item.save\n form = nil\n view_context.form_for(@cart_item.cart) { |f| form = f }\n\n render json: {\n html: render_to_string(\n \"_cart_items\",\n layout: false,\n locals: {\n cart_items: @cart_item.cart.cart_items,\n f: form\n }\n )\n }\n else\n render json: @cart_item.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "452cac6bd955fa6d366c25d4e27074d0", "score": "0.63203645", "text": "def index\n @categories = Category.all\n @cart_item = current_cart.cart_items.new\n end", "title": "" }, { "docid": "e58a7455a1ba35a2a2b9fdef49a65150", "score": "0.6311726", "text": "def index\n @items = if params[:cart_id]\n Cart.find(params[:cart_id]).items\n elsif params[:customer_id]\n Customer.find(params[:customer_id]).items\n elsif params[:sort]\n case params[:sort]\n when 'cart_id'\n Item.order(\"cart_id #{params[:cart_sort_direction]}\")\n when 'product_color_id'\n Item.order(\"product_color_id #{params[:product_color_sort_direction]}\")\n when 'size_id'\n Item.order(\"size_id #{params[:size_sort_direction]}\")\n when 'purchased'\n Item.order(\"charges.result #{params[:purchased_sort_direction]}\").joins(:charges)\n when 'coupon'\n Item.order(\"coupons.name #{params[:coupon_sort_direction]}\").joins(:coupons)\n end\n else\n Item\n end.order('created_at desc').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", "title": "" }, { "docid": "73c3400fbe47cd5caedc0a583482e72f", "score": "0.63109565", "text": "def show\n @cart = Cart.find(params[:id])\n end", "title": "" }, { "docid": "92a477a5b13db7219176acc542048b4c", "score": "0.6291494", "text": "def index\n @carts = Cart.all\n end", "title": "" }, { "docid": "92a477a5b13db7219176acc542048b4c", "score": "0.6291494", "text": "def index\n @carts = Cart.all\n end", "title": "" }, { "docid": "92a477a5b13db7219176acc542048b4c", "score": "0.6291494", "text": "def index\n @carts = Cart.all\n end", "title": "" }, { "docid": "92a477a5b13db7219176acc542048b4c", "score": "0.6291494", "text": "def index\n @carts = Cart.all\n end", "title": "" }, { "docid": "6d2a86c3ad6054a737fef331438dc85c", "score": "0.62864804", "text": "def create\n cart_uuid = params[:cart_id]\n @item = Item.new(item_params.merge(cart_uuid: cart_uuid))\n if @item.save\n render json: @item, status: 201\n else\n render_errors 400, @item.errors.full_messages\n end\n end", "title": "" }, { "docid": "7cf3724fb858eceaa9663578543d2a76", "score": "0.62821686", "text": "def set_cart_item\n @cart_item = CartItem.find(params[:id])\n end", "title": "" }, { "docid": "7cf3724fb858eceaa9663578543d2a76", "score": "0.62821686", "text": "def set_cart_item\n @cart_item = CartItem.find(params[:id])\n end", "title": "" }, { "docid": "7cf3724fb858eceaa9663578543d2a76", "score": "0.62821686", "text": "def set_cart_item\n @cart_item = CartItem.find(params[:id])\n end", "title": "" }, { "docid": "7cf3724fb858eceaa9663578543d2a76", "score": "0.62821686", "text": "def set_cart_item\n @cart_item = CartItem.find(params[:id])\n end", "title": "" }, { "docid": "7cf3724fb858eceaa9663578543d2a76", "score": "0.62821686", "text": "def set_cart_item\n @cart_item = CartItem.find(params[:id])\n end", "title": "" }, { "docid": "7cf3724fb858eceaa9663578543d2a76", "score": "0.62821686", "text": "def set_cart_item\n @cart_item = CartItem.find(params[:id])\n end", "title": "" }, { "docid": "7cf3724fb858eceaa9663578543d2a76", "score": "0.62821686", "text": "def set_cart_item\n @cart_item = CartItem.find(params[:id])\n end", "title": "" }, { "docid": "7cf3724fb858eceaa9663578543d2a76", "score": "0.62821686", "text": "def set_cart_item\n @cart_item = CartItem.find(params[:id])\n end", "title": "" }, { "docid": "db3d0532756eda3da11f2060700b0c84", "score": "0.6269247", "text": "def set_cart\n render json: {cart: nil} and return if session[:cart_id].nil?\n @cart = Cart.find(session[:cart_id])\n end", "title": "" }, { "docid": "826ccdcb28f865ef7461d9aefc965db6", "score": "0.6260362", "text": "def get_cart(cart_id, hmac)\n cart(:CartGet, {:CartId => cart_id, :HMAC => hmac})\n end", "title": "" }, { "docid": "207e1fa4808f91b883eee815023863b6", "score": "0.62569135", "text": "def cart_params\n { cart: { } }\n end", "title": "" }, { "docid": "1b5fa123565050997af874576cfe24dd", "score": "0.625071", "text": "def get_cart_items\n\n @cart_id = params[:cart]\n @card_used = params[:card].present? ? params[:card][:type] : params[:card] #if user has chosen from existing cards.\n @card_used = params[:card_id] if @card_used.blank? #if user has chosen from existng cards.\n\n if @cart_id.present? && @card_used.present?\n\n @cart = Cart.where(id: @cart_id).first\n @items = @cart.cart_items.select('variant_id')\n @item_array = []\n\n @items.each do |item|\n @item_array.push({variant_id: item.variant_id })\n end #end of loop\n\n end #end of if condition\n\n end", "title": "" }, { "docid": "2bb02008789ce408d0b1241fb9bdbada", "score": "0.6247879", "text": "def index\n #@items = Item.find_by_user_id(Session[user_id])\n @items = Item.all\n render json: @items\n end", "title": "" }, { "docid": "162993305977e16b02498f4aa3fdd2fd", "score": "0.62471795", "text": "def index\n if session[:cart] then\n @cart = session[:cart]\n $cart = @cart\n\n else\n @cart = {}\n end\n end", "title": "" }, { "docid": "35b4b7f52081c319e8c2bc29abd8507b", "score": "0.62419915", "text": "def index\n @carts = CartItem.where(cart: Cart.last)\n end", "title": "" }, { "docid": "eb354ffc8205e277e16c339add996ccd", "score": "0.62366146", "text": "def show\n item = Item.find(params[:id])\n render json: item\n end", "title": "" } ]
6a1206ec6b494e7b1a910db152c05d22
Different districts export assessment data in different ways, and import different specific assessments or use different code to process it.
[ { "docid": "7ea8c58006fd0a81453889c97628f909", "score": "0.5247276", "text": "def choose_assessment_importer_row_class(row)\n if @district_key == SOMERVILLE\n case row[:assessment_test]\n when 'MCAS' then McasRow\n when 'ACCESS', 'WIDA', 'WIDA-ACCESS' then AccessRow\n when 'DIBELS' then DibelsRow\n else nil\n end\n elsif @district_key == BEDFORD\n if /MCAS Gr (\\d+) (Math|ELA)/.match(row[:assessment_test]).present?\n McasRow\n else\n nil\n end\n elsif @district_key == NEW_BEDFORD\n case row[:assessment_test]\n when 'MCAS' then McasRow\n when 'ACCESS' then AccessRow\n else nil\n end\n else\n raise_not_handled!\n end\n end", "title": "" } ]
[ { "docid": "a87f06f1cb62f2e10f0499f570dcfd20", "score": "0.5704015", "text": "def test_diploma_export\n assert_equal %w( start end sign duration teacher responsible description contents ),\n @net.export_check\n\n @net.start = '01.02.03'\n @net.end = '04.05.03'\n @net.sign = '04.06.03'\n @net.duration = 72\n @net.teacher = @admin\n @net.responsible = @secretaire\n @net.description = 'Cours de base'\n @net.contents = \"Word\\nExcel\\nLinux\"\n\n assert_nil @net.export_check\n\n assert_equal \"base_gestion\\nAdmin The\\n Le Secretaire\\n 72\\n Cours de base\\n Word\\nExcel\\nLinux\\n\\n 1er février 03\\n 4 mai 03\\n 4 juin 03\\n\",\n @net.export_diploma\n\n @net.students = %w( admin surf )\n\n Entities.Grades.save_data({:student => @admin,\n :course => @net, :means => [11]})\n Entities.Grades.save_data({:student => @surf,\n :course => @net, :means => [9], :remark => 'http://ndjair.net'})\n\n assert_equal COURSE_STR, @net.export_diploma\n end", "title": "" }, { "docid": "373153379ea072f9ce8afb94bdff2888", "score": "0.5664116", "text": "def download_assessment_report_csv \n assessment_learners = Learner.find_all_by_assessment_id_and_active(params[:id],\"yes\",:conditions => [\"lesson_status != 'not attempted' and type_of_test_taker = 'learner'\"], :include => [:user,:group])\n assessment = Assessment.find_by_id(params[:id])\n admin_learner = Learner.find_by_assessment_id_and_admin_id_and_type_of_test_taker(params[:id],current_user.id,\"learner\")\n question_bank_arr = Array.new\n question_bank_arr = [\"Learner ID\",\"Name\",\"Email\",\"Group\"]\n unless assessment.demographics.nil? or assessment.demographics.blank?\n unless assessment.demographics.demographic_type_1.nil? or assessment.demographics.demographic_type_1.blank?\n question_bank_arr << assessment.demographics.demographic_type_1\n end\n unless assessment.demographics.demographic_type_2.nil? or assessment.demographics.demographic_type_2.blank?\n question_bank_arr << assessment.demographics.demographic_type_2\n end\n unless assessment.demographics.demographic_type_3.nil? or assessment.demographics.demographic_type_3.blank?\n question_bank_arr << assessment.demographics.demographic_type_3\n end\n unless assessment.demographics.demographic_type_4.nil? or assessment.demographics.demographic_type_4.blank?\n question_bank_arr << assessment.demographics.demographic_type_4\n end\n unless assessment.demographics.demographic_type_5.nil? or assessment.demographics.demographic_type_5.blank?\n question_bank_arr << assessment.demographics.demographic_type_5\n end\n unless assessment.demographics.demographic_type_6.nil? or assessment.demographics.demographic_type_6.blank?\n question_bank_arr << assessment.demographics.demographic_type_6\n end\n unless assessment.demographics.demographic_type_7.nil? or assessment.demographics.demographic_type_7.blank?\n question_bank_arr << assessment.demographics.demographic_type_7\n end\n unless assessment.demographics.demographic_type_8.nil? or assessment.demographics.demographic_type_8.blank?\n question_bank_arr << assessment.demographics.demographic_type_8\n end\n unless assessment.demographics.demographic_type_9.nil? or assessment.demographics.demographic_type_9.blank?\n question_bank_arr << assessment.demographics.demographic_type_9\n end\n unless assessment.demographics.demographic_type_10.nil? or assessment.demographics.demographic_type_10.blank?\n question_bank_arr << assessment.demographics.demographic_type_10\n end\n unless assessment.demographics.demographic_type_11.nil? or assessment.demographics.demographic_type_11.blank?\n question_bank_arr << assessment.demographics.demographic_type_11\n end\n unless assessment.demographics.demographic_type_12.nil? or assessment.demographics.demographic_type_12.blank?\n question_bank_arr << assessment.demographics.demographic_type_12\n end\n unless assessment.demographics.demographic_type_13.nil? or assessment.demographics.demographic_type_13.blank?\n question_bank_arr << assessment.demographics.demographic_type_13\n end\n unless assessment.demographics.demographic_type_14.nil? or assessment.demographics.demographic_type_14.blank?\n question_bank_arr << assessment.demographics.demographic_type_14\n end\n unless assessment.demographics.demographic_type_15.nil? or assessment.demographics.demographic_type_15.blank?\n question_bank_arr << assessment.demographics.demographic_type_15\n end\n end\n qb_ids = Array.new\n admin_learner.entry.split(',').each { |qb_id|\n qb_ids << qb_id\n }\n question_banks = QuestionBank.find(:all, :select => :name, :conditions => [\"id in (?)\",qb_ids])\n question_banks.each do |qb|\n question_bank_arr << qb.name\n end\n question_bank_arr << \"Total\"\n question_bank_arr << \"Status\"\n if !(assessment.pass_score.nil? or assessment.pass_score.blank?) and assessment.pass_score.to_i > 0\n question_bank_arr << \"Result\"\n end\n question_bank_arr << \"Attempted Time\"\n csv_string = CSV.generate do |csv|\n #set the header\n csv << question_bank_arr\n\n assessment_learners.each do |learner|\n # assessment_learners.each do | learner |\n initial_csv = Array.new\n # user_obj = User.find_by_id(learner.user_id)\n unless learner.user.nil? or learner.user.blank?\n initial_csv = [learner.id,learner.user.login,learner.user.email,learner.group.group_name]\n unless assessment.demographics.nil? or assessment.demographics.blank?\n unless assessment.demographics.demographic_type_1.nil? or assessment.demographics.demographic_type_1.blank?\n initial_csv << learner.demographic_1\n end\n unless assessment.demographics.demographic_type_2.nil? or assessment.demographics.demographic_type_2.blank?\n initial_csv << learner.demographic_2\n end\n unless assessment.demographics.demographic_type_3.nil? or assessment.demographics.demographic_type_3.blank?\n initial_csv << learner.demographic_3\n end\n unless assessment.demographics.demographic_type_4.nil? or assessment.demographics.demographic_type_4.blank?\n initial_csv << learner.demographic_4\n end\n unless assessment.demographics.demographic_type_5.nil? or assessment.demographics.demographic_type_5.blank?\n initial_csv << learner.demographic_5\n end\n unless assessment.demographics.demographic_type_6.nil? or assessment.demographics.demographic_type_6.blank?\n initial_csv << learner.demographic_6\n end\n unless assessment.demographics.demographic_type_7.nil? or assessment.demographics.demographic_type_7.blank?\n initial_csv << learner.demographic_7\n end\n unless assessment.demographics.demographic_type_8.nil? or assessment.demographics.demographic_type_8.blank?\n initial_csv << learner.demographic_8\n end\n unless assessment.demographics.demographic_type_9.nil? or assessment.demographics.demographic_type_9.blank?\n initial_csv << learner.demographic_9\n end\n unless assessment.demographics.demographic_type_10.nil? or assessment.demographics.demographic_type_10.blank?\n initial_csv << learner.demographic_10\n end\n unless assessment.demographics.demographic_type_11.nil? or assessment.demographics.demographic_type_11.blank?\n initial_csv << learner.demographic_11\n end\n unless assessment.demographics.demographic_type_12.nil? or assessment.demographics.demographic_type_12.blank?\n initial_csv << learner.demographic_12\n end\n unless assessment.demographics.demographic_type_13.nil? or assessment.demographics.demographic_type_13.blank?\n initial_csv << learner.demographic_13\n end\n unless assessment.demographics.demographic_type_14.nil? or assessment.demographics.demographic_type_14.blank?\n initial_csv << learner.demographic_14\n end\n unless assessment.demographics.demographic_type_15.nil? or assessment.demographics.demographic_type_15.blank?\n initial_csv << learner.demographic_15\n end\n end\n unless learner.lesson_exit.nil? or learner.lesson_exit.blank?\n scores = learner.lesson_exit.split(',')\n scores.each {|score|\n initial_csv << score\n }\n else\n unless learner.test_details.nil? or learner.test_details.blank?\n lesson_exit = assessment.calculate_and_save_qb_wise_score_for_learner(learner)\n unless lesson_exit.nil? or lesson_exit.blank?\n scores = learner.lesson_exit.split(',')\n scores.each {|score|\n initial_csv << score\n }\n end\n else\n question_banks.each do |qb|\n initial_csv << \"-\"\n end\n end\n end\n if learner.lesson_status == \"completed\" or learner.lesson_status == \"time up\" or learner.lesson_status == \"incomplete\"\n initial_csv << learner.score_raw\n else\n initial_csv << \"-\"\n end\n initial_csv << learner.lesson_status\n if !(assessment.pass_score.nil? or assessment.pass_score.blank?) and assessment.pass_score.to_i > 0\n if learner.lesson_status == \"completed\" or learner.lesson_status == \"time up\" or learner.lesson_status == \"incomplete\"\n initial_csv << learner.credit\n else\n initial_csv << \"-\"\n end\n end\n learner_test_start_time = assessment.convert_utc_time_to_system_time(learner.test_start_time,assessment.tenant)\n initial_csv << learner_test_start_time.strftime('%d %b %Y %I:%M%p')\n csv << initial_csv\n end\n end\n end\n generate_csv_file(csv_string,assessment.name)\n end", "title": "" }, { "docid": "0ec8fbdd6fc30f898b18e8057f27b8fa", "score": "0.55889654", "text": "def export_daos\n logger.info \"Exporting DAOs to PULFA SVN\"\n grouped_objects.keys.each do |collection_code|\n file = ead_for(collection_code)\n if file\n update_ead(file, grouped_objects[collection_code])\n else\n Honeybadger.notify(\"Unable to find EAD for collection #{collection_code}\")\n end\n end\n svn_client.commit\n notify\n end", "title": "" }, { "docid": "80bcdb48a4c396c374cdf2cb0fbec9f4", "score": "0.55404586", "text": "def relay\n export_data_for = params[:data]\n case export_data_for\n when 'individual' \n redirect_to export_student_export_index_path(:student_id => params[:student_id], :admin_id => params[:admin_id], :user_id => params[:user_id])\n when 'classroom'\n redirect_to export_classroom_export_index_path(:admin_id => params[:admin_id], :user_id => params[:user_id])\n when 'school'\n redirect_to export_school_export_index_path(:admin_id => params[:admin_id])\n else\n render_page_not_found\n end\n end", "title": "" }, { "docid": "03be107dfa9d4aad110a519cd5b5000f", "score": "0.5531963", "text": "def policy_mission_export_excel\n @policy_mission = Assessment::PolicyMission.find(params[:policy_mission_id])\n authorize! :manage, @policy_mission\n\n @summary = {}\n #Extract all of the students data\n #student_courses = @course.user_courses.student.order('lower(name)')\n\n if @policy_mission.progression_policy.isForwardPolicy?\n forwardPolicy = @policy_mission.progression_policy.getForwardPolicy\n forwardPolicyLevels = forwardPolicy.forward_policy_levels\n @summary[:forwardContent] = {}\n @summary[:forwardContent][:tagGroup] = []\n forwardPolicyLevels.each do |singleLevel|\n packagedLevelQuestions = {}\n packagedLevelQuestions[:name] = singleLevel.getTag.name\n packagedLevelQuestions[:questions] = singleLevel.getAllRelatedQuestions @policy_mission.assessment\n @summary[:forwardContent][:tagGroup] << packagedLevelQuestions\n end\n\n #Overall statistics for each student\n @summary[:forwardContent][:studentSubmissions] = []\n\n #Record each submission separately - completed first\n @policy_mission.submissions.where(status: :submitted).each do |singleSubmission|\n student_course = singleSubmission.std_course\n next if !student_course.is_student?\n unit = process_submission_excel student_course.user, true, singleSubmission\n\t@summary[:forwardContent][:studentSubmissions] << unit\n end\n #Record each submission separately - uncompleted second\n @policy_mission.submissions.where(status: :attempting).each do |singleSubmission|\n student_course = singleSubmission.std_course\n next if !student_course.is_student?\n unit = process_submission_excel student_course.user, false, singleSubmission\n\t@summary[:forwardContent][:studentSubmissions] << unit\n end\n\n @sbms = @policy_mission.submissions\n @submitted = @sbms.where(status: 'submitted').map { |sbm| sbm.std_course }\n @attempting = @sbms.where(status: 'attempting').map { |sbm| sbm.std_course }\n all_std = @course.student_courses\n @unsubmitted = all_std - @attempting - @submitted\n @summary[:forwardContent][:unsubmitted] = @unsubmitted\n unsubmittedEmails = @unsubmitted.map { |stdCourse| stdCourse.user.email }\n @summary[:forwardContent][:unsubmittedEmails] = unsubmittedEmails.join(\";\")\n end\n\n respond_to do |format|\n headers[\"Content-Disposition\"] = \"attachment; filename=\\\"Assignment #{@policy_mission.title}\\\"\"\n headers[\"Content-Type\"] = \"xls\"\n format.xls\n end\n end", "title": "" }, { "docid": "4648514093185071724ed7cf1bc4435a", "score": "0.55045396", "text": "def import_assessment_questions\n # Location & Institution assessment questions\n puts 'Importing resource assessment questions...'\n\n aq_sheets = %w(Resource-Paper-Unbound Resource-Photo Resource-AV\n Resource-Paper-Bound Resource-Objects)\n aq_sheets.each do |sheet|\n @xls.sheet(sheet).each_with_index do |row, index|\n if index > 0 and row[7].present? # skip header & trailing rows\n # Skip assessment questions that have already been imported.\n next if AssessmentQuestion.find_by_qid(row[6].to_i)\n\n properties = {\n qid: row[6].to_i,\n name: row[7].strip,\n question_type: (row[14].present? and row[14].downcase == 'checkboxes') ?\n AssessmentQuestion::Type::CHECKBOX : AssessmentQuestion::Type::RADIO,\n index: index,\n weight: row[11].to_f,\n help_text: row[8] ? row[8].strip : nil,\n advanced_help_page: row[9] ? row[9].strip.gsub('.html', '') : nil,\n advanced_help_anchor: row[10] ? row[10].strip : nil\n }\n resource_assessment = Assessment.find_by_key('resource')\n case row[5][0..2].strip.downcase\n when 'use'\n properties[:assessment_section] =\n AssessmentSection.find_by(name: 'Use | Access',\n assessment: resource_assessment)\n when 'sto'\n properties[:assessment_section] =\n AssessmentSection.find_by(name: 'Storage | Container',\n assessment: resource_assessment)\n else\n properties[:assessment_section] =\n AssessmentSection.find_by(name: 'Condition',\n assessment: resource_assessment)\n end\n\n unless row[12].blank? or row[12].to_s.include?('TBD') or row[13].blank?\n properties[:parent] = AssessmentQuestion.find_by_qid(row[12].to_i)\n properties[:enabling_assessment_question_options] = []\n row[13].split(';').map(&:strip).each do |dep|\n eaqo = properties[:parent].assessment_question_options.where(name: dep)[0]\n if eaqo\n properties[:enabling_assessment_question_options] << eaqo\n else\n puts 'AQO error: QID ' + row[10].to_s + ': ' + dep\n end\n end\n end\n\n properties[:formats] = Format.where('fid IN (?)',\n row[4].to_s.split(';').map{ |f| f.strip.to_i })\n\n question = AssessmentQuestion.new(properties)\n question.assessment_question_options.build(\n name: row[15], index: 0, value: row[16]) if row[15].present? and row[16].present?\n question.assessment_question_options.build(\n name: row[17], index: 1, value: row[18]) if row[17].present? and row[18].present?\n question.assessment_question_options.build(\n name: row[19], index: 2, value: row[20]) if row[19].present? and row[20].present?\n question.assessment_question_options.build(\n name: row[21], index: 3, value: row[22]) if row[21].present? and row[22].present?\n question.assessment_question_options.build(\n name: row[23], index: 4, value: row[24]) if row[23].present? and row[24].present?\n question.assessment_question_options.build(\n name: row[25], index: 5, value: row[26]) if row[25].present? and row[26].present?\n\n puts \"Importing question ID #{question.qid}\"\n question.save!\n end\n end\n end\n\n # Location & Institution assessment questions\n puts 'Importing location & institution assessment questions...'\n aq_sheets = %w(Location Institution)\n aq_sheets.each do |sheet|\n @xls.sheet(sheet).each_with_index do |row, index|\n if index > 0 and row[2].present? # skip header & trailing rows\n # Skip assessment questions that have already been imported.\n next if AssessmentQuestion.find_by_qid(row[1].to_i)\n\n properties = {\n qid: row[1].to_i,\n name: row[2].strip,\n question_type: AssessmentQuestion::Type::RADIO,\n index: index,\n weight: row[6].to_f,\n help_text: row[3] ? row[3].strip : nil,\n advanced_help_page: row[4] ? row[4].strip.gsub('.html', '') : nil,\n advanced_help_anchor: row[5] ? row[5].strip : nil\n }\n institution_assessment = Assessment.find_by_key('institution')\n location_assessment = Assessment.find_by_key('location')\n case row[0][0..2].strip.downcase\n when 'col'\n properties[:assessment_section] =\n AssessmentSection.find_by(name: 'Collection Planning',\n assessment: institution_assessment)\n when 'dis'\n properties[:assessment_section] =\n AssessmentSection.find_by(name: 'Disaster Recovery',\n assessment: institution_assessment)\n when 'env'\n properties[:assessment_section] =\n AssessmentSection.find_by(name: 'Environment',\n assessment: location_assessment)\n when 'eme'\n properties[:assessment_section] =\n AssessmentSection.find_by(name: 'Emergency Preparedness',\n assessment: location_assessment)\n when 'mat'\n properties[:assessment_section] =\n AssessmentSection.find_by(name: 'Material Inspection',\n assessment: institution_assessment)\n when 'pla'\n properties[:assessment_section] =\n AssessmentSection.find_by(name: 'Playback Equipment',\n assessment: institution_assessment)\n when 'sec'\n properties[:assessment_section] =\n AssessmentSection.find_by(name: 'Security',\n assessment: institution_assessment)\n when 'use'\n properties[:assessment_section] =\n AssessmentSection.find_by(name: 'Use | Access',\n assessment: institution_assessment)\n end\n\n unless row[9].blank? or row[8].blank?\n properties[:parent] = AssessmentQuestion.find_by_qid(row[7].to_i)\n properties[:enabling_assessment_question_options] = []\n row[8].split(';').map(&:strip).each do |dep|\n eaqo = properties[:parent].assessment_question_options.where(name: dep)[0]\n if eaqo\n properties[:enabling_assessment_question_options] << eaqo\n else\n puts 'AQO error: QID ' + row[7].to_s + ': ' + dep\n end\n end\n end\n\n question = AssessmentQuestion.new(properties)\n question.assessment_question_options.build(\n name: row[9], index: 0, value: row[10]) if row[9]\n question.assessment_question_options.build(\n name: row[11], index: 1, value: row[12]) if row[11]\n question.assessment_question_options.build(\n name: row[13], index: 2, value: row[14]) if row[13]\n question.assessment_question_options.build(\n name: row[15], index: 3, value: row[16]) if row[15]\n question.assessment_question_options.build(\n name: row[17], index: 4, value: row[18]) if row[17]\n\n puts \"Importing question ID #{question.qid}\"\n question.save!\n end\n end\n end\n end", "title": "" }, { "docid": "087c65113d388a600b27e43693a76307", "score": "0.5501374", "text": "def segregate(batch_ids)\n checks = CheckInformation.by_batch(batch_ids)\n @facility = checks.first.batch.facility\n @client = @facility.client\n @client_name = @client.name.upcase\n @zip_type = checks.collect(&:batch).collect(&:correspondence).uniq\n\n if FacilityOutputConfig.insurance_eob(@facility.id) &&\n FacilityOutputConfig.insurance_eob(@facility.id).length > 0\n insurance_eob_output_config = FacilityOutputConfig.insurance_eob(@facility.id).first\n if !insurance_eob_output_config.blank?\n xml_output_config_format = insurance_eob_output_config.format.to_s.upcase == 'XML'\n end\n end\n\n checks = checks.delete_if {|c| c.job.incomplete?}\n checks.group_by do |check|\n payer = check.payer\n job = check.job\n payer_type = job.payer_group if !job.blank?\n if insurance_eob_output_config.payment_corres_patpay_in_one_file ||\n insurance_eob_output_config.payment_patpay_in_one_corres_in_separate_file\n output_config = insurance_eob_output_config\n else\n output_config = @facility.output_config(payer_type)\n end\n if !xml_output_config_format\n if output_config.payment_corres_patpay_in_one_file ||\n output_config.payment_patpay_in_one_corres_in_separate_file\n patient_pay_group_name(check, @ins_grouping)\n else\n case payer_type(check)\n when 'insurancepay'\n group_name(check, @ins_grouping)\n when 'patpay'\n if @pat_grouping\n if @client_name == \"BARNABAS\"\n group_name(check, @pat_grouping)\n else\n patient_pay_group_name(check, @pat_grouping)\n end\n else\n raise \"Patient Pay output configuration must be present to generate Patient Pay output.\"\n end\n when 'notapplicable'\n if @pat_grouping\n group_name(check, @pat_grouping)\n else\n raise \"Patient Pay output configuration must be present to generate Patient Pay output.\"\n end\n end\n end\n else\n case payer_type(check)\n when 'insurancepay' \n group_name(check, @ins_grouping)\n when 'patpay', 'notapplicable'\n if @pat_grouping\n group_name(check, @pat_grouping)\n else\n raise \"Patient Pay output configuration must be present to generate Patient Pay output.\"\n end\n end\n end\n end\n end", "title": "" }, { "docid": "e2cfd4df758573d6972a6319bfd46022", "score": "0.55007213", "text": "def assessment_statistics(*args) # returns district's cluster average from start_time to end_time\n\t\tif args.size < 2\n\t\t\tCluster.find_by_sql(\"SELECT start_time as 'date_c',AVG(assessment_details.average_monthly_consumption) as 'average_monthly_consumption_average_c', AVG(assessment_details.students_grade4) as 'students_grade4_average_c',AVG(assessment_details.students_grade5) as 'students_grade5_average_c', AVG(assessment_details.teachers_present) as 'teachers_present_average_c', AVG(assessment_details.tasks_identified) as 'tasks_identified_average_c' FROM `districts` INNER JOIN `schools` ON `schools`.`district_id` = `districts`.`district_id` LEFT OUTER JOIN `assessment_details` ON `assessment_details`.`emis_code` = `schools`.`emiscode` INNER JOIN `phone_entries` ON `phone_entries`.`id` = `assessment_details`.`assessment_id` AND `phone_entries`.`type` IN ('Assessment') WHERE `districts`.`district_name` = '#{self.district_name}' AND (`phone_entries`.`start_time` >= '2012-01-01 00:00:00') Group BY MONTH(start_time)\")\n\t\telse\n\t\t\tCluster.find_by_sql(\"SELECT start_time as 'date_c',AVG(assessment_details.average_monthly_consumption) as 'average_monthly_consumption_average_c', AVG(assessment_details.students_grade4) as 'students_grade4_average_c',AVG(assessment_details.students_grade5) as 'students_grade5_average_c', AVG(assessment_details.teachers_present) as 'teachers_present_average_c', AVG(assessment_details.tasks_identified) as 'tasks_identified_average_c' FROM `districts` INNER JOIN `schools` ON `schools`.`district_id` = `districts`.`district_id` LEFT OUTER JOIN `assessment_details` ON `assessment_details`.`emis_code` = `schools`.`emiscode` INNER JOIN `phone_entries` ON `phone_entries`.`id` = `assessment_details`.`assessment_id` AND `phone_entries`.`type` IN ('Assessment') WHERE `districts`.`district_name` = '#{self.district_name}' AND (`phone_entries`.`start_time` BETWEEN '#{args[0]}' AND '#{args[1]}')\")\n\t\tend\n\tend", "title": "" }, { "docid": "ffd2b634a5930df954565e736bbedc93", "score": "0.5367729", "text": "def analysis_emerald\n if params[:do_emerald]\n # do the CSV export\n @student = Student.find( params[:id])\n @session = Session.find( params[:session_id])\n @session.certify\n notes_flag = params[:include_notes] ? true: false\n\n events = SessionEvent.where( session_id: params[:session_id])\n send_data events.to_csv( notes_flag), filename: emerald_filename( @student, @session)\n else\n # setup the form for Emerald export\n @student = Student.find(params[:id])\n @sessions = Session.where(session_student: @student.id)\n end\n end", "title": "" }, { "docid": "6f70e1e1baabf69fbe83b6d010f6011d", "score": "0.52809894", "text": "def import\n create_guide\n create_questions_and_answers\n set_subject_metadatas\n end", "title": "" }, { "docid": "9c19de7e363ef9205685452f3578899d", "score": "0.5230886", "text": "def archived_students_exam_report\n @batch = Batch.shod(params[:id])\n @students ||= @batch.archived_students\n @exam_groups ||= @batch.result_published\n @subjects ||= @batch.subjects\n @general_setting = GeneralSetting.first\n render 'archived_students_exam_report', layout: false\n end", "title": "" }, { "docid": "9855a03432075616c27a0899611a18c0", "score": "0.5196841", "text": "def seed_individual_pda()\n\n begin\n\n # individual seed data sets\n ind_pda_1 = {\"county\" => \"Allegheny\",\n \"municipality_name\" => \"Mt Oliver Boro\",\n \"pda_date\" => \"03/18/2017\",\n \"incident_type\" => \"subsidence\", # flood, tornado, subsidence, fire\n \"page\" => \"1\",\n \"total_pages\" => \"1\",\n \"pda_team_hlo\" => \"\", # need clarification on valid value here\n \"af_own_single\" => \"1\",\n \"af_own_multi\" => \"0\",\n \"af_own_mob\" => \"0\",\n \"af_own_p_fl_ins\" => \"0\",\n \"af_own_p_ho_ins\" => \"0\",\n \"af_own_p_lo_inc\" => \"0\",\n \"af_own_num_inac\" => \"1\",\n \"af_rent_single\" => \"0\",\n \"af_rent_multi\" => \"0\",\n \"af_rent_mob\" => \"0\",\n \"af_rent_p_fl_ins\" => \"0\",\n \"af_rent_p_ho_ins\" => \"0\",\n \"af_rent_p_lo_inc\" => \"0\",\n \"af_rent_num_inac\" => \"0\",\n \"af_sec_single\" => \"0\",\n \"af_sec_multi\" => \"0\",\n \"af_sec_mob\" => \"0\",\n \"mn_own_single\" => \"0\",\n \"mn_own_multi\" => \"0\",\n \"mn_own_mob\" => \"0\",\n \"mn_own_p_fl_ins\" => \"0\",\n \"mn_own_p_ho_ins\" => \"0\",\n \"mn_own_p_lo_inc\" => \"0\",\n \"mn_own_num_inac\" => \"0\",\n \"mn_rent_single\" => \"0\",\n \"mn_rent_multi\" => \"0\",\n \"mn_rent_mob\" => \"0\",\n \"mn_rent_p_fl_ins\" => \"0\",\n \"mn_rent_p_ho_ins\" => \"0\",\n \"mn_rent_p_lo_inc\" => \"0\",\n \"mn_rent_num_inac\" => \"0\",\n \"mn_sec_single\" => \"0\",\n \"mn_sec_multi\" => \"0\",\n \"mn_sec_mob\" => \"0\",\n \"mj_own_single\" => \"0\",\n \"mj_own_multi\" => \"0\",\n \"mj_own_mob\" => \"0\",\n \"mj_own_p_fl_ins\" => \"0\",\n \"mj_own_p_ho_ins\" => \"0\",\n \"mj_own_p_lo_inc\" => \"0\",\n \"mj_own_num_inac\" => \"0\",\n \"mj_rent_single\" => \"0\",\n \"mj_rent_multi\" => \"0\",\n \"mj_rent_mob\" => \"0\",\n \"mj_rent_p_fl_ins\" => \"0\",\n \"mj_rent_p_ho_ins\" => \"0\",\n \"mj_rent_p_lo_inc\" => \"0\",\n \"mj_rent_num_inac\" => \"0\",\n \"mj_sec_single\" => \"0\",\n \"mj_sec_multi\" => \"0\",\n \"mj_sec_mob\" => \"0\",\n \"d_own_single\" => \"0\",\n \"d_own_multi\" => \"0\",\n \"d_own_mob\" => \"0\",\n \"d_own_p_fl_ins\" => \"0\",\n \"d_own_p_ho_ins\" => \"0\",\n \"d_own_p_lo_inc\" => \"0\",\n \"d_own_num_inac\" => \"0\",\n \"d_rent_single\" => \"0\",\n \"d_rent_multi\" => \"0\",\n \"d_rent_mob\" => \"0\",\n \"d_rent_p_fl_ins\" => \"0\",\n \"d_rent_p_ho_ins\" => \"0\",\n \"d_rent_p_lo_inc\" => \"0\",\n \"d_rent_num_inac\" => \"0\",\n \"d_sec_single\" => \"0\",\n \"d_sec_multi\" => \"0\",\n \"d_sec_mob\" => \"0\",\n \"roads_bridges_damaged\" => \"1\",\n \"households_impacted\" => \"1\",\n \"households_no_utilities\" => \"0\",\n \"comments\" => \"10' wide sinkhole at Lacrosse St near 2117 Lacrosse St\"}\n\n ind_pda_2 = {\"county\" => \"Allegheny\",\n \"municipality_name\" => \"Mt Oliver Boro\",\n \"pda_date\" => \"03/18/2017\",\n \"incident_type\" => \"flood\", # flood, tornado, subsidence, fire\n \"page\" => \"1\",\n \"total_pages\" => \"1\",\n \"pda_team_hlo\" => \"\", # need clarification on valid value here\n \"af_own_single\" => \"9\",\n \"af_own_multi\" => \"3\",\n \"af_own_mob\" => \"0\",\n \"af_own_p_fl_ins\" => \"25\",\n \"af_own_p_ho_ins\" => \"75\",\n \"af_own_p_lo_inc\" => \"25\",\n \"af_own_num_inac\" => \"2\",\n \"af_rent_single\" => \"0\",\n \"af_rent_multi\" => \"4\",\n \"af_rent_mob\" => \"0\",\n \"af_rent_p_fl_ins\" => \"0\",\n \"af_rent_p_ho_ins\" => \"50\",\n \"af_rent_p_lo_inc\" => \"75\",\n \"af_rent_num_inac\" => \"1\",\n \"af_sec_single\" => \"0\",\n \"af_sec_multi\" => \"0\",\n \"af_sec_mob\" => \"0\",\n \"mn_own_single\" => \"3\",\n \"mn_own_multi\" => \"0\",\n \"mn_own_mob\" => \"0\",\n \"mn_own_p_fl_ins\" => \"100\",\n \"mn_own_p_ho_ins\" => \"100\",\n \"mn_own_p_lo_inc\" => \"0\",\n \"mn_own_num_inac\" => \"3\",\n \"mn_rent_single\" => \"0\",\n \"mn_rent_multi\" => \"1\",\n \"mn_rent_mob\" => \"0\",\n \"mn_rent_p_fl_ins\" => \"0\",\n \"mn_rent_p_ho_ins\" => \"100\",\n \"mn_rent_p_lo_inc\" => \"100\",\n \"mn_rent_num_inac\" => \"1\",\n \"mn_sec_single\" => \"0\",\n \"mn_sec_multi\" => \"0\",\n \"mn_sec_mob\" => \"0\",\n \"mj_own_single\" => \"2\",\n \"mj_own_multi\" => \"0\",\n \"mj_own_mob\" => \"0\",\n \"mj_own_p_fl_ins\" => \"50\",\n \"mj_own_p_ho_ins\" => \"100\",\n \"mj_own_p_lo_inc\" => \"0\",\n \"mj_own_num_inac\" => \"2\",\n \"mj_rent_single\" => \"0\",\n \"mj_rent_multi\" => \"0\",\n \"mj_rent_mob\" => \"0\",\n \"mj_rent_p_fl_ins\" => \"0\",\n \"mj_rent_p_ho_ins\" => \"0\",\n \"mj_rent_p_lo_inc\" => \"0\",\n \"mj_rent_num_inac\" => \"0\",\n \"mj_sec_single\" => \"0\",\n \"mj_sec_multi\" => \"0\",\n \"mj_sec_mob\" => \"0\",\n \"d_own_single\" => \"0\",\n \"d_own_multi\" => \"0\",\n \"d_own_mob\" => \"0\",\n \"d_own_p_fl_ins\" => \"0\",\n \"d_own_p_ho_ins\" => \"0\",\n \"d_own_p_lo_inc\" => \"0\",\n \"d_own_num_inac\" => \"0\",\n \"d_rent_single\" => \"0\",\n \"d_rent_multi\" => \"0\",\n \"d_rent_mob\" => \"0\",\n \"d_rent_p_fl_ins\" => \"0\",\n \"d_rent_p_ho_ins\" => \"0\",\n \"d_rent_p_lo_inc\" => \"0\",\n \"d_rent_num_inac\" => \"0\",\n \"d_sec_single\" => \"0\",\n \"d_sec_multi\" => \"0\",\n \"d_sec_mob\" => \"0\",\n \"roads_bridges_damaged\" => \"1\",\n \"households_impacted\" => \"40\",\n \"households_no_utilities\" => \"10\",\n \"est_date_utility_restore\" => \"03/25/2017\",\n \"comments\" => \"Preliminary data - will need to assess further to determine entire scope.\"}\n\n # aggregate user data into multi-dimensional array for iteration\n ind_pda_forms = []\n ind_pda_forms.push(ind_pda_1, ind_pda_2)\n\n # connect to the database\n db_params = { # AWS db\n host: ENV['host'],\n port:ENV['port'],\n dbname:ENV['dbname'],\n user:ENV['dbuser'],\n password:ENV['dbpassword']\n }\n # db_params = { # local db\n # dbname:ENV['dbname'],\n # user:ENV['dbuser'],\n # password:ENV['dbpassword']\n # }\n conn = PG::Connection.new(db_params)\n\n # determine current max index (id) in details table\n max_id = conn.exec(\"select max(id) from common\")[0]\n\n # set index variable based on current max index value\n max_id[\"max\"] == nil ? v_id = 1 : v_id = max_id[\"max\"].to_i + 1\n\n # iterate through multi-dimensional users array for data\n ind_pda_forms.each do |form|\n\n # initialize variables for SQL insert statements (common table)\n v_county = form[\"county\"]\n v_municipality_name = form[\"municipality_name\"]\n\n # prepare SQL statement to insert common individual form fields into common table\n conn.prepare('q_statement',\n \"insert into common\n (id, county, municipality_name)\n values($1, $2, $3)\") # bind parameters\n\n # execute prepared SQL statement\n conn.exec_prepared('q_statement', [v_id, v_county, v_municipality_name])\n\n # deallocate prepared statement variable (avoid error \"prepared statement already exists\")\n conn.exec(\"deallocate q_statement\")\n\n # initialize variables for SQL insert statements (ind_pda table)\n v_pda_date = form[\"pda_date\"]\n v_incident_type = form[\"incident_type\"]\n v_page = form[\"page\"]\n v_total_pages = form[\"total_pages\"]\n v_pda_team_fema = form[\"pda_team_fema\"]\n v_pda_team_state = form[\"pda_team_state\"]\n v_pda_team_sba = form[\"pda_team_sba\"]\n v_pda_team_hlo = form[\"pda_team_hlo\"]\n v_af_own_single = form[\"af_own_single\"]\n v_af_own_multi = form[\"af_own_multi\"]\n v_af_own_mob = form[\"af_own_mob\"]\n v_af_own_p_fl_ins = form[\"af_own_p_fl_ins\"]\n v_af_own_p_ho_ins = form[\"af_own_p_ho_ins\"]\n v_af_own_p_lo_inc = form[\"af_own_p_lo_inc\"]\n v_af_own_num_inac = form[\"af_own_num_inac\"]\n v_af_rent_single = form[\"af_rent_single\"]\n v_af_rent_multi = form[\"af_rent_multi\"]\n v_af_rent_mob = form[\"af_rent_mob\"]\n v_af_rent_p_fl_ins = form[\"af_rent_p_fl_ins\"]\n v_af_rent_p_ho_ins = form[\"af_rent_p_ho_ins\"]\n v_af_rent_p_lo_inc = form[\"af_rent_p_lo_inc\"]\n v_af_rent_num_inac = form[\"af_rent_num_inac\"]\n v_af_sec_single = form[\"af_sec_single\"]\n v_af_sec_multi = form[\"af_sec_multi\"]\n v_af_sec_mob = form[\"af_sec_mob\"]\n v_mn_own_single = form[\"mn_own_single\"]\n v_mn_own_multi = form[\"mn_own_multi\"]\n v_mn_own_mob = form[\"mn_own_mob\"]\n v_mn_own_p_fl_ins = form[\"mn_own_p_fl_ins\"]\n v_mn_own_p_ho_ins = form[\"mn_own_p_ho_ins\"]\n v_mn_own_p_lo_inc = form[\"mn_own_p_lo_inc\"]\n v_mn_own_num_inac = form[\"mn_own_num_inac\"]\n v_mn_rent_single = form[\"mn_rent_single\"]\n v_mn_rent_multi = form[\"mn_rent_multi\"]\n v_mn_rent_mob = form[\"mn_rent_mob\"]\n v_mn_rent_p_fl_ins = form[\"mn_rent_p_fl_ins\"]\n v_mn_rent_p_ho_ins = form[\"mn_rent_p_ho_ins\"]\n v_mn_rent_p_lo_inc = form[\"mn_rent_p_lo_inc\"]\n v_mn_rent_num_inac = form[\"mn_rent_num_inac\"]\n v_mn_sec_single = form[\"mn_sec_single\"]\n v_mn_sec_multi = form[\"mn_sec_multi\"]\n v_mn_sec_mob = form[\"mn_sec_mob\"]\n v_mj_own_single = form[\"mj_own_single\"]\n v_mj_own_multi = form[\"mj_own_multi\"]\n v_mj_own_mob = form[\"mj_own_mob\"]\n v_mj_own_p_fl_ins = form[\"mj_own_p_fl_ins\"]\n v_mj_own_p_ho_ins = form[\"mj_own_p_ho_ins\"]\n v_mj_own_p_lo_inc = form[\"mj_own_p_lo_inc\"]\n v_mj_own_num_inac = form[\"mj_own_num_inac\"]\n v_mj_rent_single = form[\"mj_rent_single\"]\n v_mj_rent_multi = form[\"mj_rent_multi\"]\n v_mj_rent_mob = form[\"mj_rent_mob\"]\n v_mj_rent_p_fl_ins = form[\"mj_rent_p_fl_ins\"]\n v_mj_rent_p_ho_ins = form[\"mj_rent_p_ho_ins\"]\n v_mj_rent_p_lo_inc = form[\"mj_rent_p_lo_inc\"]\n v_mj_rent_num_inac = form[\"mj_rent_num_inac\"]\n v_mj_sec_single = form[\"mj_sec_single\"]\n v_mj_sec_multi = form[\"mj_sec_multi\"]\n v_mj_sec_mob = form[\"mj_sec_mob\"]\n v_d_own_single = form[\"d_own_single\"]\n v_d_own_multi = form[\"d_own_multi\"]\n v_d_own_mob = form[\"d_own_mob\"]\n v_d_own_p_fl_ins = form[\"d_own_p_fl_ins\"]\n v_d_own_p_ho_ins = form[\"d_own_p_ho_ins\"]\n v_d_own_p_lo_inc = form[\"d_own_p_lo_inc\"]\n v_d_own_num_inac = form[\"d_own_num_inac\"]\n v_d_rent_single = form[\"d_rent_single\"]\n v_d_rent_multi = form[\"d_rent_multi\"]\n v_d_rent_mob = form[\"d_rent_mob\"]\n v_d_rent_p_fl_ins = form[\"d_rent_p_fl_ins\"]\n v_d_rent_p_ho_ins = form[\"d_rent_p_ho_ins\"]\n v_d_rent_p_lo_inc = form[\"d_rent_p_lo_inc\"]\n v_d_rent_num_inac = form[\"d_rent_num_inac\"]\n v_d_sec_single = form[\"d_sec_single\"]\n v_d_sec_multi = form[\"d_sec_multi\"]\n v_d_sec_mob = form[\"d_sec_mob\"]\n v_roads_bridges_damaged = form[\"roads_bridges_damaged\"]\n v_households_impacted = form[\"households_impacted\"]\n v_households_no_utilities = form[\"households_no_utilities\"]\n v_est_date_utility_restore = form[\"est_date_utility_restore\"]\n v_comments = form[\"comments\"]\n\n # prepare SQL statement to insert unique individual form fields into ind_pda table\n conn.prepare('q_statement',\n \"insert into ind_pda (id, common_id, pda_date, incident_type,\n page, total_pages, pda_team_fema, pda_team_state,\n pda_team_sba, pda_team_hlo, af_own_single, af_own_multi,\n af_own_mob, af_own_p_fl_ins, af_own_p_ho_ins, af_own_p_lo_inc,\n af_own_num_inac, af_rent_single, af_rent_multi, af_rent_mob,\n af_rent_p_fl_ins, af_rent_p_ho_ins, af_rent_p_lo_inc, af_rent_num_inac,\n af_sec_single, af_sec_multi, af_sec_mob, mn_own_single,\n mn_own_multi, mn_own_mob, mn_own_p_fl_ins, mn_own_p_ho_ins,\n mn_own_p_lo_inc, mn_own_num_inac, mn_rent_single, mn_rent_multi,\n mn_rent_mob, mn_rent_p_fl_ins, mn_rent_p_ho_ins, mn_rent_p_lo_inc,\n mn_rent_num_inac, mn_sec_single, mn_sec_multi, mn_sec_mob,\n mj_own_single, mj_own_multi, mj_own_mob, mj_own_p_fl_ins,\n mj_own_p_ho_ins, mj_own_p_lo_inc, mj_own_num_inac, mj_rent_single,\n mj_rent_multi, mj_rent_mob, mj_rent_p_fl_ins, mj_rent_p_ho_ins,\n mj_rent_p_lo_inc, mj_rent_num_inac, mj_sec_single, mj_sec_multi,\n mj_sec_mob, d_own_single, d_own_multi, d_own_mob,\n d_own_p_fl_ins, d_own_p_ho_ins, d_own_p_lo_inc, d_own_num_inac,\n d_rent_single, d_rent_multi, d_rent_mob, d_rent_p_fl_ins,\n d_rent_p_ho_ins, d_rent_p_lo_inc, d_rent_num_inac, d_sec_single,\n d_sec_multi, d_sec_mob, roads_bridges_damaged, households_impacted,\n households_no_utilities, est_date_utility_restore, comments)\n values($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14,\n $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27,\n $28, $29, $30, $31, $32, $33, $34, $35, $36, $37, $38, $39, $40,\n $41, $42, $43, $44, $45, $46, $47, $48, $49, $50, $51, $52, $53,\n $54, $55, $56, $57, $58, $59, $60, $61, $62, $63, $64, $65, $66,\n $67, $68, $69, $70, $71, $72, $73, $74, $75, $76, $77, $78, $79,\n $80, $81, $82, $83)\")\n\n # execute prepared SQL statement\n conn.exec_prepared('q_statement', [v_id, v_id, v_pda_date, v_incident_type,\n v_page, v_total_pages, v_pda_team_fema, v_pda_team_state,\n v_pda_team_sba, v_pda_team_hlo, v_af_own_single, v_af_own_multi,\n v_af_own_mob, v_af_own_p_fl_ins, v_af_own_p_ho_ins, v_af_own_p_lo_inc,\n v_af_own_num_inac, v_af_rent_single, v_af_rent_multi, v_af_rent_mob,\n v_af_rent_p_fl_ins, v_af_rent_p_ho_ins, v_af_rent_p_lo_inc, v_af_rent_num_inac,\n v_af_sec_single, v_af_sec_multi, v_af_sec_mob, v_mn_own_single,\n v_mn_own_multi, v_mn_own_mob, v_mn_own_p_fl_ins, v_mn_own_p_ho_ins,\n v_mn_own_p_lo_inc, v_mn_own_num_inac, v_mn_rent_single, v_mn_rent_multi,\n v_mn_rent_mob, v_mn_rent_p_fl_ins, v_mn_rent_p_ho_ins, v_mn_rent_p_lo_inc,\n v_mn_rent_num_inac, v_mn_sec_single, v_mn_sec_multi, v_mn_sec_mob,\n v_mj_own_single, v_mj_own_multi, v_mj_own_mob, v_mj_own_p_fl_ins,\n v_mj_own_p_ho_ins, v_mj_own_p_lo_inc, v_mj_own_num_inac, v_mj_rent_single,\n v_mj_rent_multi, v_mj_rent_mob, v_mj_rent_p_fl_ins, v_mj_rent_p_ho_ins,\n v_mj_rent_p_lo_inc, v_mj_rent_num_inac, v_mj_sec_single, v_mj_sec_multi,\n v_mj_sec_mob, v_d_own_single, v_d_own_multi, v_d_own_mob,\n v_d_own_p_fl_ins, v_d_own_p_ho_ins, v_d_own_p_lo_inc, v_d_own_num_inac,\n v_d_rent_single, v_d_rent_multi, v_d_rent_mob, v_d_rent_p_fl_ins,\n v_d_rent_p_ho_ins, v_d_rent_p_lo_inc, v_d_rent_num_inac, v_d_sec_single,\n v_d_sec_multi, v_d_sec_mob, v_roads_bridges_damaged, v_households_impacted,\n v_households_no_utilities, v_est_date_utility_restore, v_comments])\n\n # deallocate prepared statement variable (avoid error \"prepared statement already exists\")\n conn.exec(\"deallocate q_statement\")\n\n # increment index value for next iteration\n v_id += 1\n\n end\n\n rescue PG::Error => e\n\n puts 'Exception occurred'\n puts e.message\n\n ensure\n\n conn.close if conn\n\n end\n\nend", "title": "" }, { "docid": "688978848d4a731399119ec9cb51987d", "score": "0.5182398", "text": "def export\n @users = User.all\n @all_sampletags = Article.sampletag_counts\n @user_answer_counts = Answer.total_by_user_id\n @all_answer_types = Answer.types \n \n @show_results = false\n if params.has_key? :sampletag\n @show_results = true\n @selected_type = params[:answer][:type]\n # collect the passed params from the user \n @selected_sampletags = (params[:sampletag].keep_if {|k,v| v.to_i==1}).keys\n # load users\n @selected_users = self.parse_out_selected_users\n @selected_user_ids = self.parse_out_selected_users.collect {|u| u.id}\n # load answers\n @articles = Article.where(:sampletag=>@selected_sampletags)\n end\n \n respond_to do |format|\n format.html {\n }\n format.csv {\n timestamp = Time.now.strftime('%Y-%m-%d_%H:%M:%S')\n # do some csv config\n @filename = \"raw_\" + @selected_type + \"_answers_\" + @selected_sampletags.join(\"_\") + \"_\" + timestamp + \".csv\"\n @output_encoding = 'UTF-8'\n }\n end\n \n end", "title": "" }, { "docid": "6ac29cece6bd03bae4fa81a400c2524b", "score": "0.5169334", "text": "def per_district_attributes\n included_attributes = {}\n per_district = PerDistrict.new\n\n if per_district.import_student_house?\n included_attributes.merge!(house: row[:house])\n end\n\n if per_district.import_student_counselor?\n counselor_last_name = if row[:counselor] then row[:counselor].split(\",\")[0] else nil end\n included_attributes.merge!(counselor: counselor_last_name)\n end\n\n if per_district.import_student_sped_liaison?\n included_attributes.merge!(sped_liaison: row[:sped_liaison])\n end\n\n included_attributes\n end", "title": "" }, { "docid": "4ec7ad1c171fbda8a3dc6be5ce91dcd9", "score": "0.5157608", "text": "def grades\n\t\tid = params[:id]\n\t\t@mappings = ReviewMapping.find_all_by_review_assignment_id(id)\n\t\t@questions = ReviewQuestion.find_all_by_review_assignment_id(id)\n\t\t@answers = {}\n\t\t@mappings.each do |mapping|\n\t\t\t@answers[mapping.id] = ReviewAnswer.order(:review_question_id).find_all_by_user_id_and_other_id_and_review_question_id(mapping.user_id,mapping.other_user_id,@questions.collect(&:id))\n\t\tend\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.xls\n\t\t\tformat.csv {send_data ReviewAssignment.find(id).to_csv(@mappings,@questions,@answers) }\n\t\tend\n\t\t\n\tend", "title": "" }, { "docid": "2ffad28b354b6e6f5a07f86f70359e21", "score": "0.5157516", "text": "def set_future_enrollment_projections\n # both subdistrict from database and subdistricts input by the user\n subdistricts = self.subdistricts_from_db + self.subdistricts_from_user\n\n districts = subdistricts.map { |d| d['district'] }\n\n enrollment_projection_by_district = CeqrData::ScaEnrollmentProjectionsBySd.version(\n data_package.table_for(\"sca_enrollment_projections_by_sd\")\n ).enrollment_projection_by_subdistrict_for_year(buildYearMaxed, districts)\n\n self.future_enrollment_projections = enrollment_projection_by_district.map do |pr|\n {\n ps: pr[:ps],\n ms: pr[:is], # this is legacy and should change to 'is'\n district: pr[:district],\n school_year: pr[:school_year]\n }\n end\nend", "title": "" }, { "docid": "a6497f7747688460aedbb42fc2949ae1", "score": "0.51416314", "text": "def import_deviation\n project_id = params[:project_id]\n project = Project.find(:first, :conditions=>[\"id= ?\", project_id])\n begin\n if project and project.deviation_spider and !project.deviation_spider_svt and !project.deviation_spider_svf\n file = params[:upload]\n if file\n file_name = file['datafile'].original_filename\n file_ext = File.extname(file_name)\n if (file_ext == \".xls\")\n psu_file_hash = Deviation.import(file, project.lifecycle_id)\n if psu_file_hash == \"tab_error\"\n redirect_to :action=>:spider_configuration, :project_id=>project_id, :status_import=>\"4\"\n elsif psu_file_hash == \"empty_value\"\n redirect_to :action=>:spider_configuration, :project_id=>project_id, :status_import=>\"5\"\n elsif psu_file_hash == \"wrong_value_formula\"\n redirect_to :action=>:spider_configuration, :project_id=>project_id, :status_import=>\"6\"\n elsif psu_file_hash == \"wrong_psu_file\"\n redirect_to :action=>:spider_configuration, :project_id=>project_id, :status_import=>\"7\"\n else\n # Save psu reference\n deviation_spider_reference = DeviationSpiderReference.new\n deviation_spider_reference.version_number = 1\n DeviationSpiderReference.find(:all, :conditions=>[\"project_id = ?\", project_id], :order=>\"version_number asc\").each do |devia|\n deviation_spider_reference.version_number = devia.version_number + 1\n end\n deviation_spider_reference.project_id = project_id\n deviation_spider_reference.created_at = DateTime.now\n deviation_spider_reference.updated_at = DateTime.now\n deviation_spider_reference.save\n\n # Save psu settings\n psu_file_hash.each do |psu|\n deviation_spider_setting = DeviationSpiderSetting.new\n deviation_spider_setting.deviation_spider_reference_id = deviation_spider_reference.id\n deviation_spider_setting.activity_name = psu[\"activity\"]\n deviation_spider_setting.deliverable_name = psu[\"deliverable\"]\n deviation_spider_setting.answer_1 = psu[\"methodology_template\"]\n deviation_spider_setting.answer_2 = psu[\"is_justified\"]\n deviation_spider_setting.answer_3 = psu[\"other_template\"]\n deviation_spider_setting.justification = psu[\"justification\"]\n deviation_spider_setting.created_at = DateTime.now\n deviation_spider_setting.updated_at = DateTime.now\n deviation_spider_setting.save\n end\n\n redirect_to :action=>:spider_configuration, :project_id=>project_id, :status_import=>\"1\"\n end\n else\n redirect_to :action=>:spider_configuration, :project_id=>project_id, :status_import=>\"0\"\n end\n else\n redirect_to :action=>:spider_configuration, :project_id=>project_id, :status_import=>\"3\"\n end\n elsif project and project.deviation_spider_svt and !project.deviation_spider_svf\n file = params[:upload]\n if file\n file_name = file['datafile'].original_filename\n file_ext = File.extname(file_name)\n if (file_ext == \".xls\")\n psu_file_hash, psu_file_error_type, psu_file_error_lines = DeviationSvt.import(file, project.lifecycle_id)\n if psu_file_error_type == \"tab_error\"\n redirect_to :action=>:spider_configuration, :project_id=>project_id, :status_import=>\"4\"\n elsif psu_file_error_type == \"empty_value\"\n redirect_to :action=>:spider_configuration, :project_id=>project_id, :status_import=>\"5\", :error_lines=>psu_file_error_lines\n elsif psu_file_error_type == \"wrong_value_formula\"\n redirect_to :action=>:spider_configuration, :project_id=>project_id, :status_import=>\"6\"\n elsif psu_file_error_type == \"wrong_psu_file\"\n redirect_to :action=>:spider_configuration, :project_id=>project_id, :status_import=>\"7\"\n else\n # Save psu reference\n deviation_spider_reference = SvtDeviationSpiderReference.new\n deviation_spider_reference.version_number = 1\n SvtDeviationSpiderReference.find(:all, :conditions=>[\"project_id = ?\", project_id], :order=>\"version_number asc\").each do |devia|\n deviation_spider_reference.version_number = devia.version_number + 1\n end\n deviation_spider_reference.project_id = project_id\n deviation_spider_reference.created_at = DateTime.now\n deviation_spider_reference.updated_at = DateTime.now\n deviation_spider_reference.save\n\n # Save psu settings\n psu_file_hash.each do |psu|\n deviation_spider_setting = SvtDeviationSpiderSetting.new\n deviation_spider_setting.svt_deviation_spider_reference_id = deviation_spider_reference.id\n deviation_spider_setting.activity_name = psu[\"activity\"]\n deviation_spider_setting.macro_activity_name = psu[\"macro_activity\"]\n deviation_spider_setting.deliverable_name = psu[\"deliverable\"]\n deviation_spider_setting.answer_1 = psu[\"methodology_template\"]\n deviation_spider_setting.answer_2 = psu[\"is_justified\"]\n deviation_spider_setting.answer_3 = psu[\"other_template\"]\n deviation_spider_setting.justification = psu[\"justification\"]\n deviation_spider_setting.created_at = DateTime.now\n deviation_spider_setting.updated_at = DateTime.now\n deviation_spider_setting.save\n\n #if a macro_activity or a deliverable from a row is not know in the database, it's a flight one and it's saved.\n #it will be used for the deviation extract.\n macro_activity_to_add_in_flight_table = deliverable_to_add_in_flight_table = nil\n macro_activity_to_add_in_flight_table = SvtDeviationMacroActivity.find(:first, :conditions=>[\"name = ?\", psu[\"macro_activity\"]])\n deliverable_to_add_in_flight_table = SvtDeviationDeliverable.find(:first, :conditions=>[\"name = ?\", psu[\"deliverable\"]])\n if !macro_activity_to_add_in_flight_table or !deliverable_to_add_in_flight_table\n svt_deviation_flight = SvtDeviationMacroActivityDeliverableFlight.new\n svt_deviation_flight.svt_deviation_macro_activity_name = psu[\"macro_activity\"]\n svt_deviation_flight.svt_deviation_deliverable_name = psu[\"deliverable\"]\n svt_deviation_flight.svt_deviation_activity_name = psu[\"activity\"]\n svt_deviation_flight.project_id = project.id\n svt_deviation_flight.answer_1 = psu[\"methodology_template\"]\n svt_deviation_flight.answer_2 = psu[\"is_justified\"]\n svt_deviation_flight.answer_3 = psu[\"other_template\"]\n svt_deviation_flight.justification = psu[\"justification\"]\n svt_deviation_flight.save\n end\n end\n\n redirect_to :action=>:spider_configuration, :project_id=>project_id, :status_import=>\"1\"\n end\n else\n redirect_to :action=>:spider_configuration, :project_id=>project_id, :status_import=>\"0\"\n end\n else\n redirect_to :action=>:spider_configuration, :project_id=>project_id, :status_import=>\"3\"\n end\n elsif project and !project.deviation_spider_svt and project.deviation_spider_svf\n file = params[:upload]\n if file\n file_name = file['datafile'].original_filename\n file_ext = File.extname(file_name)\n if (file_ext == \".xls\")\n psu_file_hash, psu_file_error_type, psu_file_error_lines = DeviationSvf.import(file, project.lifecycle_id)\n if psu_file_error_type == \"tab_error\"\n redirect_to :action=>:spider_configuration, :project_id=>project_id, :status_import=>\"4\"\n elsif psu_file_error_type == \"empty_value\"\n redirect_to :action=>:spider_configuration, :project_id=>project_id, :status_import=>\"5\", :error_lines=>psu_file_error_lines\n elsif psu_file_error_type == \"wrong_value_formula\"\n redirect_to :action=>:spider_configuration, :project_id=>project_id, :status_import=>\"6\"\n elsif psu_file_error_type == \"wrong_psu_file\"\n redirect_to :action=>:spider_configuration, :project_id=>project_id, :status_import=>\"7\"\n else\n # Save psu reference\n deviation_spider_reference = SvfDeviationSpiderReference.new\n deviation_spider_reference.version_number = 1\n SvfDeviationSpiderReference.find(:all, :conditions=>[\"project_id = ?\", project_id], :order=>\"version_number asc\").each do |devia|\n deviation_spider_reference.version_number = devia.version_number + 1\n end\n deviation_spider_reference.project_id = project_id\n deviation_spider_reference.created_at = DateTime.now\n deviation_spider_reference.updated_at = DateTime.now\n deviation_spider_reference.save\n\n # Save psu settings\n psu_file_hash.each do |psu|\n deviation_spider_setting = SvfDeviationSpiderSetting.new\n deviation_spider_setting.svf_deviation_spider_reference_id = deviation_spider_reference.id\n deviation_spider_setting.activity_name = psu[\"activity\"]\n deviation_spider_setting.macro_activity_name = psu[\"macro_activity\"]\n deviation_spider_setting.deliverable_name = psu[\"deliverable\"]\n deviation_spider_setting.answer_1 = psu[\"methodology_template\"]\n deviation_spider_setting.answer_2 = psu[\"is_justified\"]\n deviation_spider_setting.answer_3 = psu[\"other_template\"]\n deviation_spider_setting.justification = psu[\"justification\"]\n deviation_spider_setting.created_at = DateTime.now\n deviation_spider_setting.updated_at = DateTime.now\n deviation_spider_setting.save\n\n #if a macro_activity or a deliverable from a row is not know in the database, it's a flight one and it's saved.\n #it will be used for the deviation extract.\n macro_activity_to_add_in_flight_table = deliverable_to_add_in_flight_table = nil\n macro_activity_to_add_in_flight_table = SvfDeviationMacroActivity.find(:first, :conditions=>[\"name = ?\", psu[\"macro_activity\"]])\n deliverable_to_add_in_flight_table = SvfDeviationDeliverable.find(:first, :conditions=>[\"name = ?\", psu[\"deliverable\"]])\n if !macro_activity_to_add_in_flight_table or !deliverable_to_add_in_flight_table\n svf_deviation_flight = SvfDeviationMacroActivityDeliverableFlight.new\n svf_deviation_flight.svf_deviation_macro_activity_name = psu[\"macro_activity\"]\n svf_deviation_flight.svf_deviation_deliverable_name = psu[\"deliverable\"]\n svf_deviation_flight.svf_deviation_activity_name = psu[\"activity\"]\n svf_deviation_flight.project_id = project.id\n svf_deviation_flight.answer_1 = psu[\"methodology_template\"]\n svf_deviation_flight.answer_2 = psu[\"is_justified\"]\n svf_deviation_flight.answer_3 = psu[\"other_template\"]\n svf_deviation_flight.justification = psu[\"justification\"]\n svf_deviation_flight.save\n end\n end\n redirect_to :action=>:spider_configuration, :project_id=>project_id, :status_import=>\"1\"\n end\n else\n redirect_to :action=>:spider_configuration, :project_id=>project_id, :status_import=>\"0\"\n end\n else\n redirect_to :action=>:spider_configuration, :project_id=>project_id, :status_import=>\"3\"\n end\n else\n redirect_to :action=>:spider_configuration, :project_id=>project_id, :status_import=>\"2\"\n end\n rescue Exception => e\n redirect_to :action=>:spider_configuration, :project_id=>project_id, :status_import=>\"-1\"\n end\n end", "title": "" }, { "docid": "0f57786c3f1b757ad4c80a2f18ed9c85", "score": "0.5118754", "text": "def analyze_exports!\n @interconnects.each do |region_code, data|\n analysis = Merit::Convergence::ExportAnalyzer.new(\n @first_order, @other_orders[region_code], data[:capacity])\n\n add_export(region_code, analysis.load_curve)\n end\n end", "title": "" }, { "docid": "3980a62376af4c444614ce20eb8028a9", "score": "0.5115336", "text": "def merge(data = {})\n if is_feature_enabled\n final_exam_conversion = Berkeley::FinalExamSchedule.fetch\n # for students\n if (academics_data = parse_academic_data data[:semesters])\n assign_exams(academics_data, final_exam_conversion)\n # Sort by semester, current first\n data[:examSchedule] = academics_data.sort_by { |semester| semester[:timeBucket] == 'current' ? 0 : 1 }\n end\n\n # for instructors\n if (teaching_data = data[:teachingSemesters])\n parse_courses_for_instructor(teaching_data, final_exam_conversion)\n end\n end\n end", "title": "" }, { "docid": "851fdf5e841e57bb9432f91e2ffe2f89", "score": "0.5111067", "text": "def import_occupancy_and_leasing_details(oo)\n if !read_via_numeral(1,1).nil? && date_fetch(1,\"A\") == :date\n month,year=read_via_numeral(1,1).to_date.month,read_via_numeral(1,1).to_date.year\n row,head_row,column=9,7,1\n title_and_column={}\n title=[\"unit\",\"sf\",\"tenant\",\"spacetype\",\"termstart\",\"termend\",\"base\",\"effective\",\"ti's\",\"lc's\",\"options/comments\"]\n title.push \"securitydeposit\" if @cur_parse_type == 'AMP'\n while column <=16\n if !read_via_numeral(head_row,column).nil? && !read_via_numeral(head_row,column).downcase.match(/(months)/)\n if read_via_numeral(head_row,column).downcase.gsub(' ','')==\"dateexecuted\" or read_via_numeral(head_row,column).downcase.gsub(' ','')==\"leasedate\"\n title_and_column.store(\"dateexecuted\",column)\n elsif read_via_numeral(head_row,column).downcase.gsub(' ','').include? 'base' or read_via_numeral(head_row,column).downcase.gsub(' ','').include? \"effective\"\n title_and_column.store(read_via_numeral(head_row,column).downcase.gsub(' ','').include?(\"base\") ? 'base' : 'effective',column)\n elsif title.include?(read_via_numeral(head_row,column).downcase.gsub(' ',''))\n title_and_column.store(read_via_numeral(head_row,column).downcase.gsub(' ','').gsub(\"'s\",\"s\").gsub('/',''),column)\n end\n end\n column=column+1\n end\n suites = Suite.find_all_by_real_estate_property_id(@prop_id).map(&:id)\n PropertyLease.delete_all(['month = ? and year = ? and property_suite_id IN (?) and occupancy_type != ? ', month, year, suites,'current'] ) if !suites.nil? and !suites.empty?\n PropertyOccupancySummary.delete_all(['real_estate_property_id = ? and month = ? and year = ?',@prop_id, month, year])\n while(row <=find_last_base_cell) do\n if !read_via_numeral(row,1).nil? and read_via_numeral(row,1).class == String and !([\"total expiry\",\"total new\",\"total renewal\",\"total future commencements\",\"occupancy statistics\",\"tenant occupancy\"].include?(read_via_numeral(row,1).downcase.strip))\n occupancy_type,row=read_via_numeral(row,1).downcase.strip,row+1\n while(row <=find_last_base_cell) do\n if !read_via_numeral(row,3).nil?\n #Leading zero truncation added .gsub!(/^0+/,'')\n prop_suite = Suite.find(:all, :conditions=>['real_estate_property_id = ? and suite_no = ? and space_type = ? and rentable_sqft =?', @prop_id,read_via_numeral(row,title_and_column[\"unit\"]).to_s.gsub('.0', ''),read_via_numeral(row,title_and_column[\"spacetype\"]).downcase,read_via_numeral(row,title_and_column[\"sf\"])])\n prop_suite=prop_suite[0] unless prop_suite.blank?\n # modified based on the Lease Mgmt DB structure\n if !(read_via_numeral(row,title_and_column[\"termstart\"]).nil? && read_via_numeral(row,title_and_column[\"termend\"]).nil? ) && occupancy_type != \"expirations\" #&& (read_via_numeral(row,title_and_column[\"termstart\"]) <= Date.today && read_via_numeral(row,title_and_column[\"termend\"]) >= Date.today ) #added to check whether the suite is vacant\n #Leading zero truncation added .gsub!(/^0+/,'')\n\n mtm = read_via_numeral(row,title_and_column[\"termend\"]) < Date.today ? 1 : 0\n\n #Conditions for multiple suites present#\n prop_suite_arr = []\n suite_number = read_via_numeral(row,title_and_column[\"unit\"]).to_s.gsub('.0', '')\n if suite_number.include?(',') || suite_number.include?('/')\n suite_array = suite_number.split(',') if suite_number.include?(',')\n suite_array = suite_number.split('/') if suite_number.include?('/')\n suite_array.each do |val|\n find_suite = Suite.find_by_suite_no_and_real_estate_property_id(val,@prop_id)\n if !find_suite.present?\n rentable_sqft = read_via_numeral(row,title_and_column[\"sf\"]).to_f / suite_array.size #Total Sqft divided equally based on array size. Each suite will have same sqft#\n prop_suite=Suite.new\n prop_suite.real_estate_property_id=@prop_id\n prop_suite.suite_no=val\n prop_suite.rentable_sqft=rentable_sqft\n prop_suite.space_type=read_via_numeral(row,title_and_column[\"spacetype\"]).downcase\n prop_suite.user_id=@curr_user\n prop_suite.status='Occupied'\n prop_suite.save\n prop_suite_arr << prop_suite\n else\n prop_suite=Suite.find_or_create_by_suite_no_and_real_estate_property_id(:real_estate_property_id=>@prop_id,:suite_no=>val,:rentable_sqft=>read_via_numeral(row,title_and_column[\"sf\"]),:space_type=>read_via_numeral(row,title_and_column[\"spacetype\"]).downcase,:user_id=>@curr_user,:status=>'Occupied') if prop_suite.blank?\n prop_suite_arr << prop_suite\n end\n end\n else\n prop_suite=Suite.find_or_create_by_suite_no_and_real_estate_property_id(:real_estate_property_id=>@prop_id,:suite_no=>read_via_numeral(row,title_and_column[\"unit\"]).to_s.gsub('.0', ''),:rentable_sqft=>read_via_numeral(row,title_and_column[\"sf\"]),:space_type=>read_via_numeral(row,title_and_column[\"spacetype\"]).downcase,:user_id=>@curr_user,:status=>'Occupied') if prop_suite.blank?\n prop_suite_arr << prop_suite\n end\n\n prop_suite_arr.present? && prop_suite_arr.each do |prop_suite|\n tenant = Tenant.create(:tenant_legal_name=>read_via_numeral(row,title_and_column[\"tenant\"]))\n lease = Lease.create(:commencement=> read_via_numeral(row,title_and_column[\"termstart\"]), :expiration=>read_via_numeral(row,title_and_column[\"termend\"]),:execution=>read_via_numeral(row,title_and_column[\"dateexecuted\"]),:occupancy_type=>occupancy_type,:status =>'Active',:real_estate_property_id=>@prop_id,:is_executed=>1,:user_id=>@curr_user,:effective_rate=>read_via_numeral(row,title_and_column[\"effective\"]),:mtm=>mtm)\n PropertyLeaseSuite.find_or_create_by_lease_id_and_tenant_id(:suite_ids=>[prop_suite.id],:lease_id=>lease.id,:tenant_id=>tenant.id)\n explanation =LeasesExplanation.create(:lease_id=>lease.id,:real_estate_property_id=>@prop_id,:explanation=>read_via_numeral(row,title_and_column[\"optionscomments\"]),:occupancy_type=>occupancy_type,:user_id=>@curr_user,:month=>Date.today.month,:year=>Date.today.year)\n rent = Rent.create(:lease_id=>lease.id)\n RentSchedule.find_or_create_by_suite_id(:suite_id=>prop_suite.id, :amount_per_month=>read_via_numeral(row,title_and_column[\"base\"]),:rent_id=>rent.id)\n capex = CapEx.find_or_create_by_lease_id(:lease_id=>lease.id,:security_deposit_amount=>title_and_column[\"securitydeposit\"].nil? ? nil : read_via_numeral(row,title_and_column[\"securitydeposit\"]))\n TenantImprovement.find_or_create_by_cap_ex_id(:cap_ex_id=>capex.id,:total_amount=>read_via_numeral(row,title_and_column[\"tis\"]))\n LeasingCommission.find_or_create_by_cap_ex_id(:cap_ex_id=>capex.id,:total_amount=>read_via_numeral(row,title_and_column[\"lcs\"]))\n end\n else\n # for vacant suites, expired leases\n\n #Conditions for multiple suites present#\n prop_suite_arr = []\n suite_number = read_via_numeral(row,title_and_column[\"unit\"]).to_s.gsub('.0', '')\n if suite_number.include?(',') || suite_number.include?('/')\n suite_array = suite_number.split(',') if suite_number.include?(',')\n suite_array = suite_number.split('/') if suite_number.include?('/')\n suite_array.each do |val|\n find_suite = Suite.find_by_suite_no_and_real_estate_property_id(val,@prop_id)\n if !find_suite.present?\n rentable_sqft = read_via_numeral(row,title_and_column[\"sf\"]).to_f / suite_array.size #Total Sqft divided equally based on array size. Each suite will have same sqft#\n prop_suite=Suite.new\n prop_suite.real_estate_property_id=@prop_id\n prop_suite.suite_no=val\n prop_suite.rentable_sqft=rentable_sqft\n prop_suite.space_type=read_via_numeral(row,title_and_column[\"spacetype\"]).downcase\n prop_suite.user_id=@curr_user\n prop_suite.status='Vacant'\n prop_suite.save\n prop_suite_arr << prop_suite\n else\n prop_suite=Suite.find_or_create_by_suite_no_and_real_estate_property_id(:real_estate_property_id=>@prop_id,:suite_no=>val,:rentable_sqft=>read_via_numeral(row,title_and_column[\"sf\"]),:space_type=>read_via_numeral(row,title_and_column[\"spacetype\"]).downcase,:user_id=>@curr_user,:status=>'Occupied') if prop_suite.blank?\n prop_suite_arr << prop_suite\n end\n end\n else\n prop_suite=Suite.find_or_create_by_suite_no_and_real_estate_property_id(:real_estate_property_id=>@prop_id,:suite_no=>read_via_numeral(row,title_and_column[\"unit\"]).to_s.gsub('.0', ''),:rentable_sqft=>read_via_numeral(row,title_and_column[\"sf\"]),:space_type=>read_via_numeral(row,title_and_column[\"spacetype\"]).downcase,:user_id=>@curr_user,:status=>'Occupied') if prop_suite.blank?\n prop_suite_arr << prop_suite\n end\n prop_suite_arr.present? && prop_suite_arr.each do |prop_suite|\n tenant = Tenant.create(:tenant_legal_name=>read_via_numeral(row,title_and_column[\"tenant\"]))\n lease = Lease.create(:commencement=> read_via_numeral(row,title_and_column[\"termstart\"]), :expiration=>read_via_numeral(row,title_and_column[\"termend\"]),:execution=>read_via_numeral(row,title_and_column[\"dateexecuted\"]),:occupancy_type=>occupancy_type,:status =>'Inactive',:real_estate_property_id=>@prop_id,:is_executed=>1,:user_id=>@curr_user,:effective_rate=>read_via_numeral(row,title_and_column[\"effective\"]))\n PropertyLeaseSuite.find_or_create_by_lease_id_and_tenant_id(:suite_ids=>[prop_suite.id],:lease_id=>lease.id,:tenant_id=>tenant.id)\n explanation =LeasesExplanation.create(:lease_id=>lease.id,:real_estate_property_id=>@prop_id,:explanation=>read_via_numeral(row,title_and_column[\"optionscomments\"]),:occupancy_type=>occupancy_type,:user_id=>@curr_user,:month=>Date.today.month,:year=>Date.today.year)\n rent = Rent.create(:lease_id=>lease.id)\n RentSchedule.find_or_create_by_suite_id(:suite_id=>prop_suite.id, :amount_per_month=>read_via_numeral(row,title_and_column[\"base\"]),:rent_id=>rent.id)\n capex = CapEx.find_or_create_by_lease_id(:lease_id=>lease.id,:security_deposit_amount=>title_and_column[\"securitydeposit\"].nil? ? nil : read_via_numeral(row,title_and_column[\"securitydeposit\"]))\n TenantImprovement.find_or_create_by_cap_ex_id(:cap_ex_id=>capex.id,:total_amount=>read_via_numeral(row,title_and_column[\"tis\"]))\n LeasingCommission.find_or_create_by_cap_ex_id(:cap_ex_id=>capex.id,:total_amount=>read_via_numeral(row,title_and_column[\"lcs\"]))\n end\n end\n end\n break if read_via_numeral(row,1).class == String && read_via_numeral(row,2).nil?\n row=row+1\n end\n elsif !read_via_numeral(row,1).nil? && read_via_numeral(row,1).class == String && (read_via_numeral(row,1).downcase.strip==\"occupancy statistics\" || read_via_numeral(row,1).downcase.strip.include?(\"tenant occupancy\") )\n for new_row in row..find_last_base_cell\n for col in 1..2\n if !read_via_numeral(new_row,col).nil? && read_via_numeral(new_row,col).class == String\n if read_via_numeral(new_row, col).downcase.match(/building rentable square feet/)\n up_col = find_column_for_sum_value(new_row,col+1,oo)\n prop_occup_summary=CommercialLeaseOccupancy.find_or_create_by_real_estate_property_id(:real_estate_property_id=>@prop_id)\n prop_occup_summary.update_attributes(:month=>month,:year=>year,:total_building_rentable_s=>read_via_numeral(new_row,up_col))\n elsif read_via_numeral(new_row, col).downcase.match(/sf occupied as of/)\n if read_via_numeral(new_row+1, col).nil?\n up_col = find_column_for_sum_value(new_row,col+1,oo)\n prop_occup_summary.update_attributes(:last_year_sf_occupied_actual=>read_via_numeral(new_row,up_col),:last_year_sf_occupied_budget=>read_via_numeral(new_row,up_col+1))\n elsif read_via_numeral(new_row+1, col).downcase.match(/occupancy/)\n up_col = find_column_for_sum_value(new_row,col+1,oo)\n prop_occup_summary.update_attributes(:current_year_sf_occupied_actual=>read_via_numeral(new_row,up_col),:current_year_sf_occupied_budget=>read_via_numeral(new_row,up_col+1))\n end\n elsif read_via_numeral(new_row, col).downcase.match(/sf occupied/)\n if read_via_numeral(new_row+1, col).downcase.match(/occupancy/)\n up_col = find_column_for_sum_value(new_row,col+1,oo)\n prop_occup_summary.update_attributes(:current_year_sf_occupied_actual=>read_via_numeral(new_row,up_col),:current_year_sf_occupied_budget=>read_via_numeral(new_row,up_col+1))\n end\n elsif read_via_numeral(new_row, col).downcase.match(/sf vacant/)\n up_col = find_column_for_sum_value(new_row,col+1,oo)\n prop_occup_summary.update_attributes(:current_year_sf_vacant_actual=>read_via_numeral(new_row,up_col),:current_year_sf_vacant_budget=>read_via_numeral(new_row,up_col+1))\n elsif read_via_numeral(new_row,col).downcase.match(/new leases/)\n up_col = find_column_for_sum_value(new_row,col+1,oo)\n prop_occup_summary.update_attributes(:new_leases_actual=>read_via_numeral(new_row,up_col),:new_leases_budget=>read_via_numeral(new_row,up_col+1))\n elsif read_via_numeral(new_row,col).downcase.match(/renewals/)\n up_col = find_column_for_sum_value(new_row,col+1,oo)\n prop_occup_summary.update_attributes(:renewals_actual=>read_via_numeral(new_row,up_col),:renewals_budget=>read_via_numeral(new_row,up_col+1))\n elsif read_via_numeral(new_row,col).downcase.match(/expirations/)\n up_col = find_column_for_sum_value(new_row,col+1,oo)\n prop_occup_summary.update_attributes(:expirations_actual=>read_via_numeral(new_row,up_col),:expirations_budget=>read_via_numeral(new_row,up_col+1))\n end\n end\n end\n row=new_row\n end\n end\n row=row+1\n end\n #~ update_expiration_new_renewal(month,year)\n end\n end", "title": "" }, { "docid": "b4c68b60994613c0edf196da2d8d6bfc", "score": "0.5099669", "text": "def set_future_enrollment_new_housing\n # subdistrict_pairs are e.g. \"(<district>, <subdistrict>)\" and defined in private methods\n future_enrollment_new_housing_by_subdistrict = CeqrData::ScaHousingPipelineBySd.version(\n data_package.table_for(\"sca_housing_pipeline_by_sd\")\n ).ps_is_students_from_new_housing_by_subdistrict(subdistrict_pairs)\n\n self.future_enrollment_new_housing = future_enrollment_new_housing_by_subdistrict.map do |e|\n {\n level: e[:level],\n district: e[:district],\n subdistrict: e[:subdistrict],\n students: e[:students]\n }\n end\nend", "title": "" }, { "docid": "0ade8e4821d9b63c1cd4edafcc2faabb", "score": "0.5095849", "text": "def archived_students_consolidated_report\n @batch = Batch.shod(params[:id])\n @exam_groups ||= @batch.result_published\n @general_setting = GeneralSetting.first\n render 'archived_students_consolidated_report', layout: false\n end", "title": "" }, { "docid": "6f3893d340409ca355eb019461f9fe2e", "score": "0.50887096", "text": "def export_edt\n store_location\n month_letter = 'ABCDEFGHIJKL'[Time.now.month-1]\n ttl_claims = docs_processed = 0; errmsg = []\n\n# Which doctors worked on that day?\n docs = Visit.where(\"status=?\", READY).reorder('').group(:doc_id).pluck(:doc_id)\n docs.each do |doc_id|\n doc = Doctor.find(doc_id)\n last_seq_no = 0; last_ttl_amt = 0.0;\n\n# Construct output file name \n basename = \"H#{month_letter}#{doc.provider_no}\"\n# But first find latest file's seq_no for this doctor \n last_seq_no = EdtFile.where('filename like ?', \"#{basename}.%\").order(seq_no: :desc).limit(1).pluck(:seq_no).first || 0\n seq_no = last_seq_no + 1\n ext = seq_no.to_s.rjust(3,'0')\n filename = \"#{basename}.#{ext}\"\n visits = Visit.where(\"status=? AND doc_id=?\", READY, doc_id)\n next unless visits.any?\n\n# Create empty edt_file object to get the id of a new record\n edt_file = EdtFile.new\n if !edt_file.save(validate: false)\n\terrmsg[docs_processed] = \"could not save edt object for doctor #{doc.lname}\"\n\tnext\n end\n\n# Call method from EDT module to genarate claims; use edt_file.id as unique batch_seq number \n (body, claims, svcs, ttl_amt) = generate_claim_for_doc(edt_file.id,filename,visits) # My::EDT\n ttl_claims += claims\n if edt_file.update(ftype: EDT_CLAIM, filename: filename, upload_date: Time.now, provider_no: doc.provider_no,\n group_no: GROUP_NO, body: body, lines: body.lines.count, claims: claims, services: svcs, total_amount: ttl_amt, seq_no: seq_no )\n# Write claim to file\n edt_file.write\n docs_processed += 1\n else\n errmsg[docs_processed] = \"Couldn't save \"+ edt_file.errors.full_messages.to_sentence\n edt_file.destroy\n end\n end # docs\n \n if errmsg.any?\n flash[:danger] = \"Error: \" + flashmsg.join(';')\n else \n flash[:success] = \"#{ttl_claims} claims for #{docs_processed} doctors exported\"\n end \n redirect_back_or( billings_path )\n end", "title": "" }, { "docid": "287fd64b8dfcc87b6bb332c3910e20dc", "score": "0.5079383", "text": "def import(semester)\n return false if !semester\n\n self.district_surcharge = semester.district_surcharge\n\n\t imported_objs = {\n \tclassrooms: Hash.new,\n \tcourses: Hash.new,\n \tinstructors: Hash.new,\n \tstudents: Hash.new\n }\n\n begin\n\t ActiveRecord::Base.transaction do\n\t semester.courses.each do |course|\n\t \timport_course(course, imported_objs)\n\t end\n\t semester.instructors.each do |instructor|\n\t \timport_instructor(instructor, imported_objs)\n\t end\n\t semester.classrooms.each do |classroom|\n\t \timport_classroom(classroom, imported_objs)\n\t end\n\t semester.students.each do |student|\n\t \timport_student(student, imported_objs)\n\t end\n\t end\n\t rescue Exception => ex\n\t \tlogger.error(\"Failed importing session #{semester.name}: #{ex.message}\")\n\t \terrors.add(:base, \"Failed to import session #{semester.name}\")\n \treturn false\n\t end\n\n\t return true\n end", "title": "" }, { "docid": "b8f19fc10bf55d85a993c91423ed3b42", "score": "0.5063571", "text": "def run(districts) \nputs \"What district number do you want to look at?\"\nuser_num = gets.chomp #takes the users' input and sets it into a variable\nuser_district = \"DISTRICT #{user_num}\" #sets another variable to the DISTRICT and the users' input \nuser_district = user_num.to_i < 10 ? \"DISTRICT 0#{user_num}\" : user_district #if the number is less than 10, then it will add a 0 in tens place and sets it back to the variable \ndistrict_info = district_to_info(districts,user_district) #sets the new method name equal to the iterated method above\n puts district_info[:dis] + \":\" #district num\n puts \"The percentage of attendance in this district is #{district_info[:percentage]}%\" #puts out the percentage\n puts \"The total population is #{district_info[:population]}\" #puts population num\n \n#asks user if they want to know more information about the last three districts\nputs \"Do you want to learn about the Special ED District 75?\"\nuser_ans = gets.chomp.upcase #turns user's input all uppercase\nif user_ans == \"YES\" \n puts \"The percentage of attendance for Special ED District 75 is 83.21%\"\n puts \"The total population is 21435\"\nelse\n puts \"Do you want to learn about Alternative High Schools?\"\nuser_ans2 = gets.chomp.upcase #turns user's input all uppercase\nif user_ans2 == \"YES\"\n puts \"The percentage of attendance for Alternative High Schools is 63.81%\"\n puts \"The total population is 7288\"\nelse\n puts \"Do you want to learn about the Citywide?\"\nuser_ans3 = gets.chomp.upcase #turns user's input all uppercase\nif user_ans3 == \"YES\"\n puts \"The overall percentage of attendance Citywide is 89.99%\"\n puts \"The total population is 1002463\"\nelse \n puts \"OK bye.\" \n\nend\nend\nend\nend", "title": "" }, { "docid": "634cbbef8ffa28452db730c8729bcbb3", "score": "0.5052922", "text": "def merge_nested_instructing(campus_classes)\n campus_classes.values.each do |semester|\n semester.each do |course|\n if course[:role] == 'Instructor'\n primaries = course[:sections].select { |s| s[:is_primary_section] }\n if primaries.present? && Berkeley::CourseOptions::MAPPING[course[:course_option]]\n secondaries = CampusOracle::UserCourses::SecondarySections.new({user_id: @uid}).get_all_secondary_sections(course)\n if secondaries.present?\n # Remember any explicit assignments to avoid duplicates and maintain ordering.\n explicit_secondaries = course[:sections].select { |s| !s[:is_primary_section] }.collect { |s| s[:ccn] }\n # Use a hash to avoid duplicates when an instructor is assigned more than one primary.\n nested_secondaries = {}\n primaries.each do |prim|\n secondaries.each do |sec|\n if explicit_secondaries.include?(sec['course_cntl_num']) ||\n Berkeley::CourseOptions.nested?(course[:course_option], prim[:section_number], sec['section_num'], sec['instruction_format'])\n nested_secondaries[sec['course_cntl_num']] = row_to_section_data(sec)\n end\n end\n end\n course[:sections] = primaries.concat(nested_secondaries.values) unless nested_secondaries.empty?\n end\n end\n end\n end\n end\n end", "title": "" }, { "docid": "536a414e02ff9ccbccc3a8e6644242e9", "score": "0.5041336", "text": "def dump_pdfs\n assessment_type = params[:type]\n\n # Abort if PDF export is not enabled.\n unless @course.pdf_export_enabled?(assessment_type)\n redirect_to access_denied_path, alert: \"PDF export for #{assessment_type.pluralize} has not been enabled.\"\n return\n end\n\n # Configure PDF generation options.\n load_settings_for_printing\n\n # Create temporary directory to store PDFs.\n Dir.mktmpdir do |dir|\n\n # For each assessment that has been completed, generate PDF and save to temporary directory. \n assessments = @course.assessments.send(assessment_type)\n submissions = @course.submissions.where(std_course_id: curr_user_course.id)\n submissions_by_assessment_id = {}\n submissions.each do |s|\n submissions_by_assessment_id[s.assessment_id] = s\n end\n assessments.each do |a|\n @assessment = a\n if submissions_by_assessment_id.has_key?(a.id) \n @submission = submissions_by_assessment_id[a.id]\n if !@submission.attempting?\n @grading = @submission.get_final_grading\n filename = \"#{assessment_type.titleize} #{a.id} - #{a.title}.pdf\".gsub(/[^0-9A-Za-z.\\-]/, '_')\n case assessment_type\n when 'mission'\n build_gradings_summary true\n pdf_string = render_to_string :pdf => filename, \n :template => \"assessment/gradings/show\",\n :formats => [:pdf]\n when 'training'\n @training = @assessment.specific\n pdf_string = render_to_string :pdf => filename, \n :template => \"assessment/training_submissions/show\",\n :formats => [:pdf]\n else\n raise \"Unknown assessment type - #{assessment_type}\"\n end\n File.open(File.join(dir, filename), \"wb\") do |file|\n file.write pdf_string\n end\n end\n end\n end\n\n # Zip up PDFs and send zip file to client.\n filename = \"PDFs - #{@course.title} - #{assessment_type}.zip\".gsub(/[^0-9A-Za-z.\\-]/, '_')\n temp_file = Tempfile.new(filename)\n begin\n Zip::ZipOutputStream.open(temp_file) { |zos| } # Needed to create an empty zip structure.\n Zip::ZipFile.open(temp_file.path, Zip::ZipFile::CREATE) do |zip|\n Dir.foreach(dir) do |file|\n zip.add(file, File.join(dir, file))\n end\n end\n zip_data = File.read(temp_file.path)\n send_data(zip_data, :type => 'application/zip', :filename => filename)\n ensure\n temp_file.close\n temp_file.unlink\n end\n\n end\n end", "title": "" }, { "docid": "4df44519a77e890baa303ce2244fe4c0", "score": "0.5013833", "text": "def test_can_load_districts_when_variable_order_changes\n new_file = File.expand_path('fixtures/Pupil enrollment modified.csv', __dir__)\n districts = parser.load_districts(new_file)\n assert_equal [\"COLORADO\", \"ACADEMY 20\", \"ADAMS COUNTY 14\"], districts\n end", "title": "" }, { "docid": "3dd18f94144dd671eaf41fa17b9ca5a1", "score": "0.501318", "text": "def does_students_export_include_rows_for_inactive_students?\n if @district_key == SOMERVILLE\n true\n elsif @district_key == BEDFORD\n false\n elsif @district_key == NEW_BEDFORD\n false\n else\n raise_not_handled!\n end\n end", "title": "" }, { "docid": "3dd18f94144dd671eaf41fa17b9ca5a1", "score": "0.501318", "text": "def does_students_export_include_rows_for_inactive_students?\n if @district_key == SOMERVILLE\n true\n elsif @district_key == BEDFORD\n false\n elsif @district_key == NEW_BEDFORD\n false\n else\n raise_not_handled!\n end\n end", "title": "" }, { "docid": "4f9385887aee8ce481385b97c9b1b5f9", "score": "0.50026435", "text": "def analysis\n @student = Student.find(params[:id])\n if params[:analysis_report]\n redirect_to analysis2_student_path( @student)\n elsif params[:analyze_csv]\n redirect_to analysis3_student_path( @student)\n elsif params[:analyze_charts]\n redirect_to analysis4_student_path( @student)\n end\n end", "title": "" }, { "docid": "48128431ced7d232065cef420c456567", "score": "0.49947953", "text": "def create_assessment\n hash = ActiveSupport::JSON.decode(self.assessment_json)\n seq = 0\n hash.each do |key,area|\n seq += 1\n assessment_name = \"Job.#{self.job_id}\"\n assessment_cat = \"application.#{key}\"\n assessment = Assessment.where(:name => assessment_name, :category => assessment_cat).first\n if !assessment.nil?\n next\n end\n assmnt = Assessment.new\n assmnt[:name] = \"Job.#{self.job_id}\"\n assmnt[:description] = self.project_name\n assmnt[:status] = \"Imported\"\n assmnt[:category] = \"application.#{key}\"\n assmnt[:xml_key] = key == \"experience\" ? \"wh\" : key[0..1]\n assmnt.save\n self.create_assessor(assmnt.id,seq)\n p assmnt[:xml_key]\n area.each do |qkey,question|\n ques = Question.new\n ques.assessment_id = assmnt.id\n ques.sequence = qkey.gsub(/[^0-9]/,\"\").to_i\n ques.shortname = question[\"name\"][0..19]\n ques.question = question[\"text\"]\n ques.answer_type = question[\"type\"].downcase.include?(\"radio\") ? \"Radio\" : question[\"type\"]\n ques.display_type = question[\"display\"].downcase.include?(\"line\") ? \"Inline\" : \"List\"\n ques.weight = question[\"weight\"]\n ques.critical = question[\"critical\"]\n ques.minimum_value = question[\"min\"]\n case question[\"score\"].downcase\n when \"sum\"\n scorem = %w{checkbox select-multiple}.include?(ques.answer_type.downcase ) ? \"Sum\" : \"Value\"\n\n when \"max\"\n scorem = \"Max\"\n when \"none\"\n scorem = \"None\"\n else\n scorem = \"Value\"\n end\n ques.score_method = scorem\n ques.xml_key = qkey\n ques.save\n question[\"answers\"].each do |akey,answer|\n ans = Answer.new\n ans.question_id = ques.id\n ans.sequence = answer[\"id\"].to_i\n ans.shortname = answer[\"name\"][0..19]\n ans.answer = answer[\"text\"]\n ans.value = answer[\"value\"].to_i\n ans.requires_other = !answer[\"other\"].blank?\n ans.other_question = answer[\"other\"]\n ans.xml_key = ques.xml_key + \"_#{answer[\"id\"]}\"\n ans.save\n end\n end\n end\n\n end", "title": "" }, { "docid": "20f83c5e2e780f22391ec6bbeec3fe5e", "score": "0.49884865", "text": "def generate_exam_report\n if params[:exam_group_select][:id].present?\n @exam_group = ExamGroup.shod(params[:exam_group_select][:id])\n generate_exam_report2\n else\n generate_exam_report3\n end\n authorize! :read, @exam_group\n end", "title": "" }, { "docid": "e503819c198f7a5b355e8620dad1ed08", "score": "0.4981833", "text": "def process_location_data\n regions = get_location_data\n \n regions.each do |region|\n area = save_area_data region\n \n prefectures = region[\"Prefecture\"].is_a?(Array) ? region[\"Prefecture\"] : [region[\"Prefecture\"]] \n prefectures.each do |prefecture|\n pref = save_prefecture_data area.id, prefecture\n \n large_areas = prefecture[\"LargeArea\"].is_a?(Array) ? prefecture[\"LargeArea\"] : [prefecture[\"LargeArea\"]] \n large_areas.each do |large_area|\n l_area = save_large_area_data pref.id, large_area\n \n places = large_area[\"SmallArea\"].is_a?(Array) ? large_area[\"SmallArea\"] : [large_area[\"SmallArea\"]]\n places.each do |place|\n save_place_data area.id, l_area.id, place\n end\n end\n end \n end\nend", "title": "" }, { "docid": "f0a6aac7887ada0a6c71b74504c4525a", "score": "0.49528447", "text": "def prepare_data\n Components.batch = Batch.find(@batch_id, :include => [:course, :subjects, :assessment_group_batches,:attendance_weekday_sets])\n Components.subjects = batch.subjects.ordered.all(\n :conditions=>{:no_exams => false,:is_deleted => false},\n :include => [:batch_subject_group, { :subject_skill_set => {:subject_skills => :sub_skills} }]\n )\n Components.students = batch.effective_students_for_reports\n Components.assessment_groups = reportable.report_groups\n Components.holiday_event_dates = batch.holiday_event_dates\n Components.all_assessment_groups = reportable.get_assessment_groups\n Components.activity_groups = reportable.activity_groups\n Components.settings = AssessmentReportSetting.get_multiple_settings_as_hash(\n AssessmentReportSetting::SETTINGS + AssessmentReportSetting::SCORE_SETTINGS+\n AssessmentReportSetting::ATTENDANCE_SETTINGS + AssessmentReportSetting::MAIN_REMARK_SETTINGS+\n AssessmentReportSetting::SUB_REMARK_SETTINGS + AssessmentReportSetting::REMARK_INHERIT_SETTINGS+\n AssessmentReportSetting::STUDENT_RECORD_SETTINGS + AssessmentReportSetting::SCORE_ROUNDING_SETTINGS, assessment_plan.id\n )\n Components.attendance_entries = GradebookAttendance.all(:conditions=>[\"batch_id= ? and report_type = ?\",batch.id,reportable.reportable_type_for_attendance])\n Components.assessment_date = AssessmentDate.all(:conditions=>{:batch_id=>batch.id})\n Components.gradebook_remarks = GradebookRemark.find_all_by_batch_id(batch.id,:include => [:reportable,:remarkable]) if remarks_enabled?\n Components.overall_grade_set =GradeSet.find_by_id(settings[:grade_set_id], :include => :grades)\n Components.grade_sets = GradeSet.find_all_by_id [settings[:scholastic_grade_scale], settings[:co_scholastic_grade_scale]]\n Components.gradebook_record_groups = assessment_plan.gradebook_record_groups.all(\n :include=>{:gradebook_records=>{:record_group=>{:records=>:student_records}}},\n :joins=>:gradebook_records,:group=>'id', :order=>:priority\n )\n Components.attendances = Attendance.all(:conditions=>{:batch_id=>batch.id})\n Components.scores_hash = Hash.new { |h, k| h[k] = Hash.new(&h.default_proc) }\n Components.exam_totals_hash = Hash.new{ |h,k| h[k] = Hash.new }\n end", "title": "" }, { "docid": "4e0165358976c26587d1f0713dfe272c", "score": "0.4948895", "text": "def process_export\n ids = params[:study_ids]\n summaries = []\n #Find appropriate summaries\n ids.each do |id|\n summaries += Experiment.find(id).summaries\n end\n \n threads = {}\n summaries.each do |summary|\n if threads.has_key? summary.email_thread\n threads[summary.email_thread] << summary\n else\n threads[summary.email_thread] = [summary]\n end\n end\n @threads = threads.values\n \n render :layout => false\n end", "title": "" }, { "docid": "5d083a63590c504309257069b567127d", "score": "0.493871", "text": "def perform(druid)\n druid = druid.delete_prefix('druid:')\n LyberCore::Log.debug \"export-opengeometadata working on #{druid}\"\n\n stagedir = GisRobotSuite.locate_druid_path druid, type: :stage\n exportdir = Settings.geohydra.opengeometadata.dir\n FileUtils.mkdir_p(exportdir) unless File.directory?(exportdir)\n\n # determine export folder\n if druid =~ /^(\\w{2})(\\d{3})(\\w{2})(\\d{4})$/\n druidtree = File.join(Regexp.last_match(1), Regexp.last_match(2), Regexp.last_match(3), Regexp.last_match(4))\n else\n fail \"export-opengeometadata: Malformed druid? #{druid}\"\n end\n stacksdir = File.join(Settings.geohydra.stacks || '/stacks', druidtree)\n\n # Read object in DOR\n item = Dor::Item.find(\"druid:#{druid}\")\n\n # Update layers.json\n lockfn = File.join('/tmp', 'layers.json.LOCK') # lock must be on local filesystem\n lockf = File.open(lockfn, 'w')\n lockf.flock(File::LOCK_EX)\n begin\n fn = File.join(exportdir, 'layers.json')\n if File.size?(fn)\n layers = JSON.parse(File.open(fn).read)\n else\n layers = {}\n end\n LyberCore::Log.debug \"export-opengeometadata: #{druid} updating layers.json\"\n layers[\"druid:#{druid}\"] = druidtree\n json = JSON.pretty_generate(Hash[layers.keys.sort.map { |k| [k, layers[k]] }]) # sort by key\n File.open(fn, 'w') do |f|\n f << json\n end\n ensure\n lockf.flock(File::LOCK_UN)\n lockf.close\n begin\n File.unlink(lockfn) if File.size?(lockfn)\n rescue => e\n # someone might delete before we can after our unlock\n end\n end\n\n # Export files\n exportdir = File.join(exportdir, druidtree)\n FileUtils.mkdir_p(exportdir) unless File.directory?(exportdir)\n\n # Export ISO 19139/19110\n xml = item.geoMetadata.ng_xml\n if xml.nil? || xml.root.nil?\n fail ArgumentError, \"export-opengeometadata: #{druid} cannot parse ISO 19139 in #{ifn}\"\n end\n\n xml.xpath('//gmd:MD_Metadata', 'xmlns:gmd' => 'http://www.isotc211.org/2005/gmd').each do |node|\n LyberCore::Log.debug \"export-opengeometadata: #{druid} extracting ISO 19139\"\n File.open(File.join(exportdir, 'iso19139.xml'), 'w') do |f|\n f << node.to_xml(indent: 2)\n end\n end\n xml.xpath('//gfc:FC_FeatureCatalogue', 'xmlns:gfc' => 'http://www.isotc211.org/2005/gfc').each do |node|\n LyberCore::Log.debug \"export-opengeometadata: #{druid} extracting ISO 19110\"\n File.open(File.join(exportdir, 'iso19110.xml'), 'w') do |f|\n f << node.to_xml(indent: 2)\n end\n end\n\n # Export MODS\n LyberCore::Log.debug \"export-opengeometadata: #{druid} extracting MODS\"\n xml = item.descMetadata.ng_xml.to_xml\n ofn = File.join(exportdir, 'mods.xml')\n File.write(ofn, xml)\n\n # Export preview\n LyberCore::Log.debug \"export-opengeometadata: #{druid} extracting preview.jpg\"\n ifn = File.join(stacksdir, 'preview.jpg')\n fail \"export-opengeometadata: #{druid} cannot find preview in #{ifn}\" unless File.size?(ifn)\n\n ofn = File.join(exportdir, 'preview.jpg')\n FileUtils.cp(ifn, ofn)\n\n # Export GeoBlacklight as JSON\n LyberCore::Log.debug \"export-opengeometadata: #{druid} extracting GeoBlacklight\"\n ifn = File.join(stagedir, 'metadata', 'geoblacklight.json')\n fail \"export-opengeometadata: #{druid} cannot find GeoBlacklight in #{ifn}\" unless File.size?(ifn)\n\n ofn = File.join(exportdir, 'geoblacklight.json')\n FileUtils.cp(ifn, ofn)\n end", "title": "" }, { "docid": "af4dd741da11816d610b6a44930ee496", "score": "0.49343377", "text": "def export\n @export = Export.new({'yaml_file' => params['yaml_file'],\n 'export_format' => params['export_format'],\n 'genome_id' => params['genome_id'],\n 'destination' => params['destination']}\n )\n\n params.delete_if { |key, value| key !~ /^experiment/ } #=> {\"a\"=>100}\n @export.experiment_ids = params.values\n\n @features = get_features(@export.genome_id, @export.experiment_ids)\n if @export.export_format == 'gff'\n dump_tab(@export.genome_id, @export.destination)\n end\n\n #respond_to do |format|\n # format.html { render :html => @export }\n #end \n\n\n end", "title": "" }, { "docid": "868395431a5910df70b77bb89091be59", "score": "0.49266675", "text": "def save_assessment\n @upload_type = params[:upload_type]\n if params[:upload_type] == \"excelsheet\" and params[:import][:excel] == \"\"\n redirect_to(\"/assessments/assessment_creation/#{current_user.id}?pattern=#{params[:pattern]}\")\n else\n @assessment = Assessment.new()\n @assessment.name = params[:question_bank][:name]\n @assessment.assessment_type = params[:assessment_type]\n @assessment.tenant_id = current_user.tenant_id\n @assessment.save\n # create_calculated_data_for_assessment(@assessment.id,current_user.tenant_id)\n if params.include? \"assessment\" and params[:assessment].include? \"test_pattern_id\"\n @assessment.update_attribute(:test_pattern_id, params[:assessment][:test_pattern_id].to_i)\n @assessment.update_attribute(:correct_ans_points, @assessment.test_pattern.correct_mark)\n @assessment.update_attribute(:wrong_ans_points, @assessment.test_pattern.wrong_mark)\n @assessment.update_attribute(:skip_question, @assessment.test_pattern.skip_question)\n unless @assessment.test_pattern.total_duration == 0\n @assessment.update_attribute(:time_bound, \"time_bound\")\n duration = @assessment.test_pattern.total_duration.to_i\n if duration >= 60\n hour = duration/60\n min = duration%60\n else\n hour = 0\n min = duration\n end\n @assessment.update_attribute(:duration_hour, hour)\n @assessment.update_attribute(:duration_min, min)\n end\n else\n @assessment.update_attribute(:test_pattern_id, 1)\n end\n if(params[:upload_type] != \"previous_questions\") then\n @obj_question_bank = QuestionBank.new()\n if params[:assessment_type] == \"single\"\n @obj_question_bank.name = params[:question_bank][:name]\n else\n @obj_question_bank.name = params[:topic_name]\n end\n @obj_question_bank.user_id = current_user.id\n @obj_question_bank.tenant_id = current_user.tenant_id\n @obj_question_bank.save\n # below method is to create object of AssessmentsQuestionBank table to store question bank id,\n # number of questions from that question bank and assessment id\n assessment_question_bank = create_and_save_assessment_question_bank(@assessment.id,@obj_question_bank.id,@obj_question_bank.no_of_questions)\n else\n if params[:assessment_type] == \"single\"\n @obj_question_bank = QuestionBank.find_by_id(params[:radio_check])\n\n @assessment.update_attribute(:no_of_questions, @obj_question_bank.no_of_questions)\n # below method is to create object of AssessmentsQuestionBank table to store question bank id,\n # number of questions from that question bank and assessment id\n assessment_question_bank = create_and_save_assessment_question_bank(@assessment.id,@obj_question_bank.id,@obj_question_bank.no_of_questions)\n else\n selected_prev_qbs = params[:total_prev_qb_checked].split(\",\")\n if @assessment.no_of_questions.nil? then\n no_of_questions = 0\n else\n no_of_questions = @assessment.no_of_questions\n end\n selected_prev_qbs.each { |qb|\n if !qb.nil? and !qb.blank? then\n ques_bank = QuestionBank.find_by_id(qb.to_i)\n no_of_questions = no_of_questions + ques_bank.no_of_questions\n # below method is to create object of AssessmentsQuestionBank table to store question bank id,\n # number of questions from that question bank and assessment id\n assessment_question_bank = create_and_save_assessment_question_bank(@assessment.id,ques_bank.id,ques_bank.no_of_questions)\n end\n }\n @assessment.update_attribute(:no_of_questions, no_of_questions)\n # if params.include? \"assessment\" and params[:assessment].include? \"test_pattern_id\"\n # @assessment.update_attribute(:test_pattern_id, params[:assessment][:test_pattern_id].to_i)\n # end\n end\n end\n\n @assessment.update_attribute(:user_id, current_user.id)\n # TODO : to be optimized with associations\n if params.include? \"import\"\n if params[:import][:excel] != \"\" then\n mime = MIME::Types.type_for(params[:import][:excel].original_filename)[0]\n mime_obj_extention = mime.extensions[0]\n if (!mime_obj_extention.nil? and !mime_obj_extention.blank? and !mime_obj_extention.downcase.eql? \"doc\") and (mime_obj_extention.include? \"docx\" ) then\n # If uploaded file is docx then control comes here\n save_docx_file(@obj_question_bank.id,params[:import][:excel].tempfile,params[:import][:excel].original_filename)\n @upload_type = \"docx\"\n else\n # If uploaded file is excel or excelx then control comes here\n parser_controller_obj = ParserController.new\n parser_controller_obj.parse_excel_file(\"\",\"\",@obj_question_bank.id,params[:import],current_user.tenant_id)\n end\n end\n no_of_questions = @obj_question_bank.questions\n @obj_question_bank.update_attribute(:no_of_questions,no_of_questions.length)\n @obj_question_bank.assessments_question_banks.each do |ass_qb|\n ass_qb.update_attribute(:question_limit, no_of_questions.length)\n end\n if @assessment.no_of_questions.nil? then\n @assessment.update_attribute(:no_of_questions,no_of_questions.length)\n else\n no_of_questions = no_of_questions.length + @assessment.no_of_questions\n @assessment.update_attribute(:no_of_questions,no_of_questions)\n end\n end\n case(@upload_type)\n when \"manual\" then\n redirect_to(\"/assessments/add_questions_to_assessment/#{@assessment.id}?question_bank_id=#{@obj_question_bank.id}\")\n when \"excelsheet\"\n redirect_to(\"/question_banks/#{@obj_question_bank.id}?wrong_entries=#{@wrong_entries.to_s}&assessment_id=#{@assessment.id}&assessment_type=#{params[:assessment_type]}\")\n when \"docx\"\n redirect_to(\"/assessments/extract_content_from_docx/#{@obj_question_bank.id}?assessment=#{@assessment.id}\")\n# when \"previous_questions\"\n# if params[:assessment_type] == \"single\"\n# redirect_to(\"/assessments/assessment_details/#{@assessment.id}\")\n# else\n# redirect_to(\"/assessments/add_more_topics_to_assessment/#{@assessment.id}\")\n# end\n when \"previous_question_banks\"\n # redirecting to component based test\n # creating reports for admin (for report_templates with admin) on creating assessment\n report_templates = ReportTemplate.where(:for_whom => \"admin\")\n report_templates.each do |report_template|\n @report = Report.new\n @report.assessment_id = @assessment.id\n @report.tenant_id = @assessment.tenant_id\n @report.structure_component_id = 0\n @report.report_template_id = report_template.id\n @report.for_whom = \"admin\"\n @report.save\n end\n @assessment.update_attribute(:using_rules,true)\n redirect_to(\"/structure_components/create_assessment/#{@assessment.id}\")\n else\n redirect_to(\"/assessments/add_more_topics_to_assessment/#{@assessment.id}\")\n end\n end\n end", "title": "" }, { "docid": "bff69b69355aa1e3904202b817c8299a", "score": "0.4925916", "text": "def consolidated_report\n @exam_group = ExamGroup.shod(params[:id])\n @batch = @exam_group.batch\n authorize! :read, @exam_group\n end", "title": "" }, { "docid": "8223c3e2d2bdc6fa953ee1c58b875725", "score": "0.49250084", "text": "def archived_report\n @student = ArchivedStudent.shod(params[:format])\n @batch = @student.batch\n @exam_groups ||= @batch.exam_groups\n authorize! :read, @student\n end", "title": "" }, { "docid": "9dd3aae0264047f2cc8a43781b007f2c", "score": "0.49099195", "text": "def process_assignments\n \n design_id = params[:design_id].blank? ? params[:design][:id] : params[:design_id]\n category_id = params[:category_id].blank? ? params[:category][:id] : params[:category_id]\n section_id = params[:section_id].blank? ? params[:instruction][:oi_category_section_id] :\n params[:section_id]\n allegro_board_symbol = params[:instruction].blank? ? \"\" :\n params[:instruction][:allegro_board_symbol]\n @assignment = params[:assignment].blank? ?\n OiAssignment.new(:due_date => Time.now+1.day,\n :complexity_id => OiAssignment.complexity_id(\"Low\")) :\n OiAssignment.new(params[:assignment])\n \n @team_members_selected = params[:team_members]\n \n # Verify that a section was selected before proceeding.\n if section_id.blank?\n \n flash['notice'] = 'Please select the step'\n\n redirect_to(:action => 'section_selection',\n :id => params[:category][:id],\n :design_id => params[:design][:id])\n \n return\n \n end\n\n # If processing makes it this far then there are no errors.\n @design = Design.find(design_id)\n @category = OiCategory.find(category_id)\n @team_members = Role.lcr_designers\n @selected_step = @category.oi_category_sections.detect { |s| s.id == section_id.to_i }\n\n @instruction = OiInstruction.new(:oi_category_section_id => @selected_step.id,\n :design_id => @design.id,\n :allegro_board_symbol => allegro_board_symbol )\n\n\n @comment = OiAssignmentComment.new(params[:comment])\n \n if @selected_step.outline_drawing_link?\n outline_drawing_document_type = DocumentType.find_by_name(\"Outline Drawing\")\n @outline_drawing = DesignReviewDocument.find(\n :first,\n :conditions => \"design_id=#{@design.id} AND \" +\n \"document_type_id=#{outline_drawing_document_type.id}\",\n :order => \"id DESC\")\n end\n\n hw_engineers = @design.get_role_reviewers('HWENG').map { |u| u.name }\n\n if hw_engineers.size == 0\n @hw_engineers = \"\"\n elsif hw_engineers.size == 1\n @hw_engineers = hw_engineers.last\n else\n count = hw_engineers.size\n @hw_engineers = hw_engineers[0..(count-2)].join(', ') + ' and ' +\n hw_engineers.last\n end\n\n end", "title": "" }, { "docid": "b7d211069cbce551a8a7dbf2898b183f", "score": "0.49016973", "text": "def export(i)\n aFile = File.open(\"results_2.csv\", \"a\")\n bFile = File.open(\"results_5.csv\", \"a\")\n cFile = File.open(\"results_bonus.csv\", \"a\")\n \n if aFile\n aFile.syswrite(i.to_s + \",\")\n aFile.syswrite($strict_faults.to_s + \",\")\n aFile.syswrite(\"#{round($strict_avg_set_size)}\" + \",\")\n aFile.syswrite(\"#{round(1/$strict_fault_rate)}\" + \"\\n\")\n else\n puts \"Unable to open file!\"\n end\n \n if bFile\n bFile.syswrite(i.to_s + \",\")\n bFile.syswrite(\"#{round($strict_fault_rate)}\" + \",\")\n bFile.syswrite(\"#{round($practical_fault_rate)}\" + \"\\n\")\n else\n puts \"Unable to open file!\"\n end\n \n if cFile\n cFile.syswrite(i.to_s + \",\")\n cFile.syswrite(\"#{round($n1_fault_rate)}\" + \",\")\n cFile.syswrite(\"#{round($n2_fault_rate)}\" + \"\\n\")\n else\n puts \"Unable to open file!\"\n end\nend", "title": "" }, { "docid": "7431b0f58d4d188935a45e9e3b297c7c", "score": "0.4889855", "text": "def test_scenario4\n data = [[File.dirname(__FILE__)+'/data/grades.csv', {\"000005\" => {\"horizon\" => 5, \"ets_models\" => {\"names\" => [\"naive\"]}}}, {\"000005\" => [{\"point_forecast\" => [61.39, 61.39, 61.39, 61.39, 61.39], \"model\" => \"naive\"}]}, {\"objective_fields\" => [\"000001\", \"000005\"], \"period\" => 1}],\n [File.dirname(__FILE__)+'/data/grades.csv', {\"000005\" => {\"horizon\" => 5, \"ets_models\" => {\"names\" => [\"naive\"]}}}, {\"000005\" => [{\"point_forecast\" => [78.89, 61.39, 78.89, 61.39, 78.89], \"model\" => \"naive\"}]}, {\"objective_fields\" => [\"000001\", \"000005\"], \"period\" => 2}],\n [File.dirname(__FILE__)+'/data/grades.csv', {\"000005\" => {\"horizon\" => 5, \"ets_models\" => {\"names\" => [\"mean\"], }}}, {\"000005\" => [{\"point_forecast\" => [68.45974, 68.45974, 68.45974, 68.45974, 68.45974], \"model\" => \"mean\"}]}, {\"objective_fields\" => [\"000001\", \"000005\"], \"period\" => 1}],\n [File.dirname(__FILE__)+'/data/grades.csv', {\"000005\" => {\"horizon\" => 5, \"ets_models\" => {\"names\" => [\"mean\"], }}}, {\"000005\" => [{\"point_forecast\" => [69.79553, 67.15821, 69.79553, 67.15821, 69.79553], \"model\" => \"mean\"}]}, {\"objective_fields\" => [\"000001\", \"000005\"], \"period\" => 2}],\n [File.dirname(__FILE__)+'/data/grades.csv', {\"000005\" => {\"horizon\" => 5, \"ets_models\" => {\"names\" => [\"drift\"], }}}, {\"000005\" => [{\"point_forecast\" => [61.50545, 61.6209, 61.73635, 61.8518, 61.96725], \"model\" => \"drift\"}]}, {\"objective_fields\" => [\"000001\", \"000005\"], \"period\" => 1}],\n [File.dirname(__FILE__)+'/data/grades.csv', {\"000005\" => {\"horizon\" => 5, \"ets_models\" => {\"names\" => [\"drift\"], }}}, {\"000005\" => [{\"point_forecast\" => [61.50545, 61.6209, 61.73635, 61.8518, 61.96725], \"model\" => \"drift\"}]}, {\"objective_fields\" => [\"000001\", \"000005\"], \"period\" => 2}]\n ]\n puts\n puts \"Scenario: Successfully comparing forecasts from time series with trivial models\"\n\n data.each do |filename, input_data, forecast_points, params|\n puts\n puts \"Given I create a data source uploading a <%s> file\" % filename\n source = @api.create_source(filename, {'name'=> 'source_test', 'project'=> @project[\"resource\"]})\n\n puts \"And I wait until the source is ready\"\n assert_equal(BigML::HTTP_CREATED, source[\"code\"])\n assert_equal(1, source[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(source), true)\n \n puts \"And I create a dataset\"\n dataset=@api.create_dataset(source)\n\n puts \"And I wait until the dataset is ready\"\n assert_equal(BigML::HTTP_CREATED, dataset[\"code\"])\n assert_equal(1, dataset[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(dataset), true)\n \n puts \"And I create time-series from a dataset\"\n time_series = @api.create_time_series(dataset, params)\n \n puts \"And I wait until the time series is ready\"\n assert_equal(BigML::HTTP_CREATED, time_series[\"code\"])\n assert_equal(@api.ok(time_series), true)\n\n puts \"And I create a local time series\"\n local_time_series = BigML::TimeSeries.new(time_series[\"resource\"], @api)\n \n puts \"When I create a forecast for <%s>\" % JSON.generate(input_data)\n \n forecast = @api.create_forecast(time_series, input_data)\n \n puts \"And I wait until the forecast is ready\"\n assert_equal(BigML::HTTP_CREATED, forecast[\"code\"])\n assert_equal(@api.ok(forecast), true)\n \n puts \"Then the forecast is <%s>\" % JSON.generate(forecast_points) \n \n attrs = [\"point_forecast\", \"model\"]\n \n forecast_points.each do |field_id, value|\n f = forecast['object']['forecast']['result'][field_id]\n p = value\n \n assert_equal(f.size, p.size)\n \n (0..(f.size-1)).each do |index|\n attrs.each do |attr|\n if f[index][attr].is_a?(Array)\n f[index][attr].each_with_index do |item, pos|\n assert_equal(p[index][attr][pos].to_f.round(3), item.to_f.round(3))\n end \n else\n assert_equal(f[index][attr].to_f.round(3), p[index][attr].to_f.round(3))\n end \n end \n end \n \n end \n \n puts \"And I create a local forecast for <%s>\" % JSON.generate(input_data)\n local_forecast = local_time_series.forecast(input_data)\n \n puts \"Then the local forecast is <%s>\" % JSON.generate(forecast_points) \n \n forecast_points.each do |field_id, value|\n f = local_forecast[field_id]\n p = value\n \n assert_equal(f.size, p.size)\n (0..(f.size-1)).each do |index|\n attrs.each do |attr|\n if f[index][attr].is_a?(Array)\n f[index][attr].each_with_index do |item, pos|\n assert_equal(p[index][attr][pos].to_f.round(3), item.to_f.round(3))\n end \n else\n assert_equal(f[index][attr].to_f.round(3), p[index][attr].to_f.round(3))\n end \n end \n end \n \n end\n \n end\n end", "title": "" }, { "docid": "2cdfebab9255ebc8255acadf366beed2", "score": "0.4888687", "text": "def import_data\n return false unless @dataset\n\n save_data_columns\n import_categories\n add_acknowledged_people\n import_sheetcells\n end", "title": "" }, { "docid": "e07149bc00f41fa9d36464d37139b1f0", "score": "0.48847657", "text": "def import_edf\n #edffile = filename\n \n # si pas de fichiers entres en parametre, en mettre un par defaut\n \n # test si c bien une fichier .edf\n\n #folder=args[:folder]\n \n # DatasetsController.import_edf(folder, 'testGuy.edf') \n \n # emplacement des fichiers edf\n @folder='/home/commun/ecole/REC/PRISM/EUGene/a_importer/'\n require 'find'\n \n # liste les fichiers .edf\n @edffiles = Array.new\n Find.find(@folder) do |path|\n # fichiers se terminant par \".edf\"\n if File.basename(path) =~ /\\.edf$/ \n @edffiles = @edffiles << File.basename(path, \".edf\")\n end\n end\n\n @edffiles.each do |edffile|\n if edffile == \"testGuy\"\n ################################################################\n \n #@edf_data=edf_to_yaml(@folder, edffile)\n \n ################################################################\n \n require('yaml')\n f1=File.open(@folder+edffile+\".edf\",\"r\")\n f2=File.open(@folder+edffile+\".yml\",\"w\")\n first_variable=false\n \n f1.each do |line|\n if first_variable == false\n if line =~ /variable = \"/ \n f2.write(\"variables:\\n\")\n first_variable = true\n end\n end\n line=line.gsub(\"[\", '# ').gsub(\"]\",'').gsub(' =',':')\n line=line.gsub(/variable: \"(.*),(.*),(.*),(.*),(.*)\"/, ' - [\\1, \\2, \\3, \\4, \\5]')\n line=line.gsub(/\"/,\"\") unless line =~ /data\\_set\\_citation/\n f2.write(line)\n end\n f1.close\n f2.close\n f2=File.open(@folder+edffile+\".yml\",\"r\")\n @edf_data=YAML.load(f2)\n \n ################################################################\n \n @variables=@edf_data.delete(\"variables\") \n \n @dataset = Dataset.create({\"configuration_file\" => edffile}.merge(@edf_data))\n \n # nom de la table \"dataset_#\" contenant les donnees\n @dataset_table=\"dataset_\" + @dataset.id.to_s\n var_n = 1\n ActiveRecord::Base.connection.create_table(@dataset_table, :force => true) do |t|\n @variables.each do |var|\n case (var[1]) #en fonction du type, cree la colonne 'var1' ou 'var2'... dans la table 'dataset_1'\n when \"string\" then t.column(\"var\" + var_n.to_s, :string)\n when \"integer\" then t.column(\"var\" + var_n.to_s, :integer)\n when \"real\" then t.column(\"var\" + var_n.to_s, :decimal)\n end\n \n Variable.create({\"var_id\"=> var_n, \"dataset_id\" => @dataset.id, \"name\" => var[0], \"format\" => var[1],\"kind\" => var[2], \"reverse\" => var[3],\"missing\" => var[4]}) #insère une ligne dans la table 'variables'\n \n case var[2] # enregistre le numéro de colonne de ces 3 variables spéciales\n when \"identifierccode1\" then @dataset.identifierccode1_var = var_n\n when \"identifierccode2\" then @dataset.identifierccode1_var = var_n\n when \"identifieryear\" then @dataset.identifieryear_var = var_n\n end\n var_n += 1\n end\n @dataset.save # enregistre dans la table 'datasets' le numéro de colonne des 1, 2 ou 3 variables spéciales\n end\n \n \n @tableau_donnees=Array.new\n require 'csv'\n ligne_n = 0\n \n # lecture des données ligne par ligne\n CSV::Reader.parse(File.open(@folder + @dataset.data_file_name)) do |row|\n if ligne_n == 0\n if @dataset.label_line_in_data_file\n ligne_n = 1\n next\n end\n ligne_n = 1\n end\n \n # une ligne d'un fichier de donnees .csv\n @ligne=Array.new\n var_n = 0\n \n # écriture des données case par case\n @variables.each do |var| \n if row[var_n].to_i == var[4].to_i or row[var_n].to_s.gsub(/\\.| /,\"\") == \"\" # la valeur est identique à celle qui code les valeurs manquantes ('missing'), OU il n'y a rien entre les deux virgules dans le fichier csv, OU il y a une combinaison de point(s) et d'espace(s) (EUGene: 1.Within the input data set, a period (“.”) is treated as a missing value code, a blank field is considered missing, and whatever value per variable specified by the user is also considered missing.\") \n @ligne[var_n] = \"NULL\"\n else\n if var[1] == \"string\"\n @ligne[var_n] = \"'\" + row[var_n].to_s + \"'\" \n else\n @ligne[var_n] = row[var_n].to_s\n end\n end\n var_n += 1\n end\n \n ActiveRecord::Base.connection.execute(\"INSERT INTO \" + @dataset_table + \" VALUES ('\" + ligne_n.to_s + \"',\" + @ligne.join(\",\") + \") \")\n ligne_n += 1\n end \n \n end\n end\n \n render(:inline => \"ok\")\n \n\n end", "title": "" }, { "docid": "e58740f24bc66bd582c9abc56ee270d3", "score": "0.488082", "text": "def consolidated_archived_report\n @batch = Batch.shod(params[:id])\n @exam_groups ||= @batch.exam_groups\n authorize! :read, @exam_groups.first\n end", "title": "" }, { "docid": "fd473c9ca35df7e59699a55152b40ae0", "score": "0.48784387", "text": "def normalized_subject_from_mcas_export(row)\n if @district_key == SOMERVILLE\n if 'English Language Arts'.in?(row[:assessment_name])\n 'ELA'\n else\n row[:assessment_subject]\n end\n elsif @district_key == BEDFORD\n if row[:assessment_subject] == 'Math'\n 'Mathematics'\n else\n row[:assessment_subject]\n end\n elsif @district_key == NEW_BEDFORD\n row[:assessment_subject] # no changes\n else\n raise_not_handled!\n end\n end", "title": "" }, { "docid": "fd473c9ca35df7e59699a55152b40ae0", "score": "0.48784387", "text": "def normalized_subject_from_mcas_export(row)\n if @district_key == SOMERVILLE\n if 'English Language Arts'.in?(row[:assessment_name])\n 'ELA'\n else\n row[:assessment_subject]\n end\n elsif @district_key == BEDFORD\n if row[:assessment_subject] == 'Math'\n 'Mathematics'\n else\n row[:assessment_subject]\n end\n elsif @district_key == NEW_BEDFORD\n row[:assessment_subject] # no changes\n else\n raise_not_handled!\n end\n end", "title": "" }, { "docid": "2c07c40e010ebc97768a55b955dd39b4", "score": "0.48743856", "text": "def import_from(school_year)\n self.semesters.each do |semester|\n semester.import_from school_year.semesters.find_by_name!(semester.name)\n end\n self.save!\n end", "title": "" }, { "docid": "efcda02e3d56280919835b7bc486dc00", "score": "0.48705027", "text": "def process_and_insert_reports\n reduced_subject_ranks = process_subject_level_rankings\n reduced_exam_set_ranks = process_exam_set_level_rankings\n \n reports.each do |report|\n report.exam_sets.each do |set|\n set.set_subject_rank_details(reduced_subject_ranks[report.student.obj_id][set.obj_id])\n set.set_exam_set_rank_details(reduced_exam_set_ranks[report.student.obj_id][set.obj_id])\n end\n ind_report = IndividualReport.new(\n :reportable => reportable,\n :student_id => report.student.obj_id,\n :report_component => report,\n :generated_report_batch_id => report_batch_id\n )\n log_error!(ind_report.errors.full_messages) unless ind_report.save\n end\n end", "title": "" }, { "docid": "9d7c0c7de2f5adc68bbd5784a4ad7608", "score": "0.486635", "text": "def import_all\n Bookings::Data::SchoolMassImporter.new(data, email_override).import\n end", "title": "" }, { "docid": "07bab0011ed0af4fc1282afee834964d", "score": "0.48649305", "text": "def index\n compile_preservation_data\n\n respond_to do |format|\n format.html\n format.pdf do\n case params[:section]\n when 'preservation'\n compile_preservation_data\n pdf = pdf_preservation_assessment_report(\n nil, @institution, current_user)\n when 'storage'\n compile_storage_data\n pdf = pdf_storage_assessment_report(\n nil, @institution, current_user, @location_assessment_sections)\n when 'resources'\n compile_resources_data\n pdf = pdf_resources_assessment_report(\n nil, @institution, current_user, @institution_formats,\n @resource_chart_data)\n when 'collections'\n compile_collections_data\n pdf = pdf_collections_assessment_report(\n nil, @institution, current_user, @collections,\n @collection_chart_datas)\n else\n compile_preservation_data\n compile_resources_data\n compile_storage_data\n compile_collections_data\n pdf = pdf_assessment_report(@institution,\n current_user,\n @resource_chart_data,\n @collection_chart_datas,\n @location_assessment_sections,\n @institution_formats,\n @collections)\n end\n send_data pdf.render, filename: 'assessment_report.pdf',\n type: 'application/pdf', disposition: 'inline'\n end\n end\n end", "title": "" }, { "docid": "b8ae73127bb40bd06ce99fef6c381619", "score": "0.48561585", "text": "def assign_exams(academics_data, final_exam_conversion)\n academics_data.each do |semester|\n semester[:courses].each do |course|\n unless semester[:cs_data_available]\n if (exam_key = determine_exam_key(semester, course, final_exam_conversion))\n if (exam = final_exam_conversion[exam_key])\n course[:exam_location] = '' # not assigned a location yet\n course[:exam_time] = exam[:exam_time]\n course[:exam_slot] = exam[:exam_slot].to_i\n course[:exam_date] = determine_exam_date(semester, exam[:exam_day])\n end\n end\n end\n end\n sort_exams semester\n end\n end", "title": "" }, { "docid": "9e3a2e5ede3499c7f5daca43e17d742c", "score": "0.4852939", "text": "def export_data_file\n if @target_dataset_geo_id.start_with?('PV', 'RES')\n mandatory_headers = %w[name geo_id country]\n mandatory_values = [@target_area_name, @target_dataset_geo_id, @target_country_name]\n else\n mandatory_headers = %w[geo_id]\n mandatory_values = [@target_dataset_geo_id]\n end\n\n migration_data_directory.join(DATA_FILENAME).write(\n <<~CSV_CONTENTS\n #{(mandatory_headers + @combined_item_values.keys).join(',')}\n #{(mandatory_values + @combined_item_values.values).join(',')}\n CSV_CONTENTS\n )\n end", "title": "" }, { "docid": "8a5c50a868a7639e47e08bb9aa53d317", "score": "0.48478058", "text": "def xds_export\n end", "title": "" }, { "docid": "693549139f30d269dc3f255ce8918f27", "score": "0.4843961", "text": "def one_student_one_semester_all_exams_including_assignments\n #this will have all the rows except the heading row. Each of the rows will be hash keyed by the values in column_keys.\n \ttable_values = [] \n exam_ids = SecExamMap.search(:section_id_eq => @section.id, :semester_id_eq => @semester.id, :exam_exam_type_eq => EXAM_TYPE_TEST).result.select('exam_id').map { |x| x.exam_id }\n subject_maps = SecSubMap.search(:section_id_eq => @section.id, :semester_id_eq => @semester.id).result.all\n\n #This will have the index for the column headings hash and the table_values array\n column_keys = ['subject_name'] + exam_ids.map{ |x| x.to_s}\n column_headings = {}\n\n #Populate the column_headings hash. These will be the headings of the table.\n column_headings['subject_name'] = {'value' => \"Subject\", :colspan => 1 } \n exam_ids.each do |exam_id|\n column_headings[exam_id.to_s] = {'value' => Exam.find(exam_id).name, :colspan => 1}\n end\n \n #Get the data row wise. One row corresponds to one subject for all the exams. Take a subject\n #get the marks for all the exams. This method is not effective, but as long as it works, it is ok\n #now. Need to see if we can improve this.\n subject_maps.each do |ssmap|\n #to hold all the data of one row without the subject name.\n marks_hash = {}\n mark_col = ssmap.mark_column\n #loop through each of the exams and get the mark for this particular subject - mark_col\n exam_ids.each do |exam_id|\n \tmark_rows = []\n temp_row = Mark.search(:student_id_eq => @student.id, :semester_id_eq => @semester.id, :section_id_eq => @section.id, :exam_id_eq => exam_id).result.first\n if temp_row\n mark_rows << temp_row\n mark_rows += temp_row.assignments if !temp_row.assignments.empty?\n end\n #At times, we would have associated the exams, but NOT have entered the marks. So, process the row only if \n #a corresponding row is available. \n tot_marks = tot_pass_marks = tot_max_marks = 0\n mark_rows.each do |mark_row|\n if mark_row\n \t#Careful! We should not use exam_id for the filter, but use mark_row.exam_id. We are also reading the marks of the assignments and exam_id will always have the base exam id.\n val = mark_row.send(mark_col)\n \tmc = MarkCriteria.search(:semester_id_eq => mark_row.semester_id, :section_id_eq => mark_row.section_id, :exam_id_eq => mark_row.exam_id, :subject_id_eq => ssmap.subject_id).result.first\n pass_marks = mc ? mc.pass_marks : 0\n max_marks = mc ? mc.max_marks : 0\n tot_marks += val if val && val != ABSENT_MARK_NUM && val != NA_MARK_NUM\n tot_pass_marks += pass_marks\n tot_max_marks += max_marks\n\t end\n end\n marks_hash[exam_id.to_s] = { \t\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'value' => tot_marks, 'bg' => Grade.get_color_code(tot_marks) , \n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'max_marks' => tot_max_marks, 'pass_marks' => tot_pass_marks, \n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'percentage' => \"NA\", 'percentile' => \"NA\"\n \t\t\t \t\t\t\t\t\t\t\t\t\t\t\t } \n end\n sub_type = ssmap.subject.lab ? \" (Pr) \" : \" (Th) \"\n table_values << {'subject_name' => {'value' => ssmap.subject.name + sub_type}}.merge(marks_hash)\n end\n return {'column_keys' => column_keys, 'column_headings' => column_headings, 'table_values' => table_values}\n end", "title": "" }, { "docid": "c734a73ef1cc4e3fedbcd6d036c3d727", "score": "0.48406112", "text": "def students_transcripts_report\n @batch = Batch.shod(params[:batch_id])\n @students ||= @batch.students\n @exam_groups ||= @batch.result_published\n @general_setting = GeneralSetting.first\n render 'students_transcripts_report', layout: false\n end", "title": "" }, { "docid": "21d6db93f1ae3c5b0cf79fecfefecc20", "score": "0.4839298", "text": "def import_escenario\n\t\tidMapa = params[:imported].to_i\n\t\tcreado = importRiskEscenarioFromDecisionMap(idMapa)\n\t\tif creado\n\t\t\tflash[:notice] = 'The information was imported correctly. Risk assessment scenario generated successfully.'\n\t\telse\n\t\t\tflash[:error] = 'ERROR: Importing the information needed to generate the risk assessment scenario!'\n\t\tend\n\n\t\t# ES: Redirige al menú de escenarios de riesgos:\n\t\t# EN: Redirect to the risk assessment scenarios menu:\n\t\tredirect_to action: :risks\n\tend", "title": "" }, { "docid": "dd6d314feae83365d7af2d3b7a06dab3", "score": "0.48374307", "text": "def import_shared_steps(options)\n case config.setting(:folio_import_strategy)\n when 'merge_record_ids_into_idml'\n merge_record_marks_from_folio_xml_at_into_idml_at(options)\n # validate that all kramdown elements are nested inside record_mark\n validation_run_options = %w[kramdown_syntax_at-all_elements_are_inside_record_mark]\n when 'only_use_if_idml_not_present'\n merge_use_idml_or_folio(options)\n # skip validation that all kramdown elements are nested inside record_mark\n validation_run_options = []\n else\n raise \"Invalid folio_import_strategy: #{ config.setting(:folio_import_strategy).inspect }\"\n end\n fix_adjust_merged_record_mark_positions(options)\n fix_convert_abbreviations_to_lower_case(options) # run after merge_record_marks...\n fix_normalize_subtitle_mark_before_gap_mark_positions(\n options.merge({ 'base-dir' => :staging_dir, 'file-extension' => :at_extension })\n )\n fix_normalize_trailing_newlines(options)\n move_staging_to_content(options)\n # Make sure that any newly created content AT files also have a\n # data.json file.\n # Deactivate st_sync for this new file by default\n fix_add_initial_data_json_file(\n options.merge(\n 'initial_only_data_json_settings' => { 'st_sync_active' => false }\n )\n )\n options['report_file'] ||= config.compute_glob_pattern(\n :content_dir, :validation_report_file, ''\n )\n options['append_to_validation_report'] = false\n reset_validation_report(options, 'import_shared_steps')\n validate_content(options.merge('run_options' => validation_run_options))\n end", "title": "" }, { "docid": "78b78b247d41dcc1402eff28f7bd9347", "score": "0.48361865", "text": "def import_shared_steps(options)\n case config.setting(:folio_import_strategy)\n when :merge_record_ids_into_idml\n merge_record_marks_from_folio_xml_at_into_idml_at(options)\n # validate that all kramdown elements are nested inside record_mark\n validation_run_options = %w[kramdown_syntax_at-all_elements_are_inside_record_mark]\n when :only_use_if_idml_not_present\n merge_use_idml_or_folio(options)\n # skip validation that all kramdown elements are nested inside record_mark\n validation_run_options = []\n else\n raise \"Invalid folio_import_strategy: #{ config.setting(:folio_import_strategy).inspect }\"\n end\n fix_adjust_merged_record_mark_positions(options)\n fix_convert_abbreviations_to_lower_case(options) # run after merge_record_marks...\n fix_normalize_subtitle_mark_before_gap_mark_positions(\n options.merge({ 'input' => 'staging_dir/at_files' })\n )\n fix_normalize_trailing_newlines(options)\n move_staging_to_content(options)\n options['report_file'] = config.compute_glob_pattern(\n 'content_dir/validation_report_file'\n )\n options['append_to_validation_report'] = false\n reset_validation_report(options, 'import_shared_steps')\n validate_content(options.merge('run_options' => validation_run_options))\n end", "title": "" }, { "docid": "9a36ede186a3ace02b002f1e93454d5d", "score": "0.48338994", "text": "def grade\n require './akapen_checker'\n template = read_template\n parameters = read_parameters\n dsl = Dsl.new\n dsl.instance_eval parameters\n\n test_results = get_test_results\n id = get_id\n q_results = get_q_results(dsl, test_results)\n result = get_report(dsl, q_results, template)\n File.open(get_output_filename(id), 'w') { |f|f.puts result }\n end", "title": "" }, { "docid": "4f8f43a3a5af13fd6424724b2eb32441", "score": "0.4825439", "text": "def download_result\n require 'rubygems'\n #require 'googlecharts'\n require 'spreadsheet'\n\n @sections = Section.find(:all)\n @survey = current_user.companies.first.surveys.find(params[:id])\n @industry = Industry.find(:first, :select=>\"industries.name\",\n :joins=>\"left outer join companies on companies.industry_id = industries.id\n left outer join surveys on companies.id = surveys.company_id and\n surveys.id = #{@survey.id}\")\n\n @questions=[]\n @final_score = 0\n @total_question_total = 0\n #@survey = Survey.find_by_id(params[:id])\n #for total count\n @section_questions_total = Section.section_questions_total\n\n @section_questions = Section.section_questions(params[:id])\n logger.debug \"#{@section_questions}\"\n @all_sections = get_all_sections\n @all_sections.each_with_index do |section,i|\n @final_score += @section_questions[i].question_attempted.to_i\n @total_question_total += @section_questions_total[i].question_total.to_i\n end\n\n if @survey.blank?\n flash[:notice] = \"No such survey exists\"\n redirect_to new_survey_path and return\n else\n #for sections navigation tabs\n @all_sections = get_all_sections\n\n #if the user is authorized for the survey then get details of add to plan responses\n @add_to_plan_responses = Response.get_response_for_options(@survey.id, \"add_to_plan\")\n #for must do responses\n @must_do_responses = @add_to_plan_responses.select{|response| response.answer_3 == 'must_do'}\n #for should do responses\n @should_do_responses = @add_to_plan_responses.select{|response| response.answer_3 == 'should_do'}\n #for could do responses\n @could_do_responses = @add_to_plan_responses.select{|response| response.answer_3 == 'could_do'}\n #if the user is authorized for the survey then get details of not applicable responses\n @not_applicable_responses = Response.get_response_for_options(@survey.id, \"not_applicable\")\n #if the user is authorized for the survey then get details of in plan responses\n @in_plan_responses = Response.get_response_for_options(@survey.id, \"in_our_plan\")\n\n end\n\n respond_to do |format|\n format.html{}\n format.pdf {\n html = render_to_string(:layout => false , :action => \"reports.html\")\n kit = PDFKit.new(html)\n kit.stylesheets << Rails.root.join(\"app/assets/stylesheets/jquery.dataTables.css\")\n kit.stylesheets << Rails.root.join(\"app/assets/stylesheets/application.css\")\n send_data(kit.to_pdf, :filename => \"#{current_user.companies.first.name.humanize} #{@survey.created_at.strftime('%B %Y')} Diagnostic Report.pdf\", :type => 'application/pdf')\n return # to avoid double render call\n }\n format.xls {\n result = Spreadsheet::Workbook.new\n list = result.create_worksheet :name => \"response\"\n list.row(0).concat %w{Section Subsection Practices QuestionPoints Score}\n @sections.each { |section|\n section.sub_sections.each { |subsection|\n subsection.questions.each { |question|\n list.row(question.id+1).push section.name, subsection.name, question.name, section.total_points,\n question.points, @questions_score[question.id]\n }\n }\n }\n header_format = Spreadsheet::Format.new :color =>\"green\", :weight =>\"bold\"\n list.row(0).default_format = header_format\n #output to blob object\n blob = StringIO.new(\"\")\n result.write blob\n #respond with blob object as a file\n send_data blob.string, :type =>:xls, :filename =>\"result.xls\"#; &quot;client_list.xls&quot;\n }\n end\nend", "title": "" }, { "docid": "731e7e4cb7ff12bca93023bab7780159", "score": "0.4821274", "text": "def export_data(collection, timepoint, method='od')\n if method.include? 'cal'\n filename = \"jid_#{jid}_item_#{collection.id}_#{todays_date}_#{method}\"\n else\n filename = \"jid_#{jid}_item_#{collection.id}_#{timepoint}hr_#{todays_date}_#{method}\"\n end\n \n img1 = \"Actions/Yeast_Gates/plateReaderImages/exporting_data_new.GIF\"\n img2 = \"Actions/Yeast_Gates/plateReaderImages/excel_export_button_new.png\"\n img3 = \"Actions/Yeast_Gates/plateReaderImages/saving_export_csv_new.png\"\n \n case method\n when 'od'\n dtype = 'Blank Read 1:600'\n desc = 'Optical Density'\n when 'gfp'\n dtype = 'Blank Read 2:485/20,516/20'\n desc = 'Fluorescence'\n when 'cal_od'\n dtype = 'Read 1:600'\n desc = 'Calibration Optical Density'\n when 'cal_gfp'\n dtype = 'Read 2:485/20,516/20'\n desc = 'Calibration Fluorescence'\n else\n dtype = ''\n end\n \n # Exporting single file (csv)\n show do\n title \"Export #{desc} Measurements from Plate Reader\"\n warning \"Make sure that no other Excel sheets are open before exporting!\"\n separator\n image img1\n bullet \"Select the <b>'Statistics'</b> tab\"\n bullet \"Select Data: <b>#{dtype}</b>\"\n separator\n note \"Next, click the Excel sheet export button. <b>The sheet will appear on the menu bar below</b>.\"\n image img2\n warning \"Make sure to save file as a .CSV file!\"\n note \"Go to sheet and <b>'Save as'</b> ==> <b>#{filename}</b> under the <b>#{SAVING_DIRECTORY}</b> folder.\"\n image img3\n end\n\n # show do\n # title \"Export #{desc} Measurements from Plate Reader\"\n \n # warning \"Make sure that no other Excel sheets are open before exporting!\"\n # separator\n # note \"After measurements have been taken, be sure to select the <b>'Statistics'</b> tab\"\n # note \"Select Data: <b>#{dtype}</b>\"\n # image img1\n # note \"Next, click the Excel sheet export button. The sheet will appear on the menu bar below.\"\n # image img2\n # note \"Go to sheet and 'Save as' <b>#{filename}</b> under the <b>#{SAVING_DIRECTORY}</b> folder.\"\n # warning \"Make sure to save file as a .CSV file!\"\n # image img3\n # end\n \n return filename\n end", "title": "" }, { "docid": "623f2cb40950ec2b6ee8806d639eca77", "score": "0.48175588", "text": "def available_assessments\n # define this later\n end", "title": "" }, { "docid": "623f2cb40950ec2b6ee8806d639eca77", "score": "0.48175588", "text": "def available_assessments\n # define this later\n end", "title": "" }, { "docid": "6d9127e30457ad0acc6db04f919223b8", "score": "0.4815087", "text": "def prepare_export_statements\n #node\n @export_node_tag = @db.prepare(\"select k, v from tag where id in (select tag from node_tag where id = ?)\")\n @export_node = @db.prepare(\"select id, lat, lon from node where id = ?\")\n @export_node_at =\n @db.prepare(\"select id, lat, lon from node where (lon > ? and lon < ?) and (lat > ? and lat < ?)\")\n #way\n @export_way = @db.prepare(\"select node from way where id = ? order by position\")\n @export_way_tag = @db.prepare(\"select k, v from tag where id in (select tag from way_tag where id = ?)\")\n #relation\n @export_node_relation = @db.prepare(\"select node, role from node_relation where id = ?\")\n @export_way_relation = @db.prepare(\"select way, role from way_relation where id = ?\")\n @export_relation_tag = @db.prepare(\"select k, v from tag where id in (select tag from relation_tag where id = ?)\")\n end", "title": "" }, { "docid": "2848dc63bb3393cb638138038a227e1a", "score": "0.48099357", "text": "def one_student_one_semester_all_exams_with_assignments\n #this will have all the rows except the heading row. Each of the rows will be hash keyed by the values in column_keys.\n \ttable_values = [] \n \texam_ids = []\n master_column_headings = []\n master_column_headings << {'value' => 'Subjects', 'colspan' => 1 , 'rowspan' => 2}\n column_keys = ['subject_name']\n column_headings = {}\n SecExamMap.search(:section_id_eq => @section.id, :semester_id_eq => @semester.id, :exam_exam_type_eq => EXAM_TYPE_TEST).result.select('exam_id').each do |semap|\n exam_ids << semap.exam_id\n #If there are assignments, total coulmns = 1(for the main exam) + assignments_count + 1 (for the total marks)\n #That comes to 2+assignments_count. If there are no assignments, we do not need to total columns. So, one\n #column to display the main exam marks should suffice.\n colspan = semap.exam.assignments.count > 0 ? semap.exam.assignments.count+2 : 1\n master_column_headings << {'value' => semap.exam.name, 'colspan' => colspan}\n column_keys << semap.exam_id.to_s\n column_headings[semap.exam_id.to_s] = {'value' => semap.exam.name}\n semap.exam.assignments.each do |asgn|\n column_keys << asgn.id.to_s\n column_headings[asgn.id.to_s] = {'value' => asgn.name}\n end \n if semap.exam.assignments.count > 0\n #Insert the \"Total\" column only if there are assignments. Otherwise, the exam column will suffice.\n column_keys << semap.exam_id.to_s + \"_total\"\n column_headings[semap.exam_id.to_s + \"_total\"] = {'value' => \"Total\"}\n end\n end\n subject_maps = SecSubMap.search(:section_id_eq => @section.id, :semester_id_eq => @semester.id).result.all\n \n #Get the data row wise. One row corresponds to one subject for all the exams. Take a subject\n #get the marks for all the exams. This method is not effective, but as long as it works, it is ok\n #now. Need to see if we can improve this.\n subject_maps.each do |ssmap|\n #to hold all the data of one row without the subject name.\n marks_hash = {}\n mark_col = ssmap.mark_column\n #loop through each of the exams and get the mark for this particular subject - mark_col\n exam_ids.each do |exam_id|\n \tmark_rows = []\n temp_row = Mark.search(:student_id_eq => @student.id, :semester_id_eq => @semester.id, :section_id_eq => @section.id, :exam_id_eq => exam_id).result.first\n if temp_row\n mark_rows << temp_row\n temp_row.assignments.map {|x| mark_rows << x }\n end\n tot_marks = tot_pass_marks = tot_max_marks = 0\n mark_rows.each do |mark_row|\n \t#Careful! We should not use exam_id for the filter, but use mark_row.exam_id. We are also reading the marks of the assignments and exam_id will always have the base exam id.\n val = mark_row.send(mark_col)\n \tmc = MarkCriteria.search(:semester_id_eq => mark_row.semester_id, :section_id_eq => mark_row.section_id, :exam_id_eq => mark_row.exam_id, :subject_id_eq => ssmap.subject_id).result.first\n pass_marks = mc ? mc.pass_marks : 0\n max_marks = mc ? mc.max_marks : 0\n tot_marks += val if val && val != ABSENT_MARK_NUM && val != NA_MARK_NUM\n tot_pass_marks += pass_marks\n tot_max_marks += max_marks\n percentages = mark_row.percentages_with_mark_columns\n percentiles = Mark.subject_percentiles_with_mark_ids(mark_col, mark_row.section_id, mark_row.semester_id, exam_id) \n marks_hash[mark_row.exam_id.to_s] = { \t\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'value' => absent_na_values_to_s(mark_row.send(mark_col)), \n 'bg' => Grade.get_color_code(percentages[mark_col]), \n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'max_marks' => mc.max_marks, 'pass_marks' => mc.pass_marks, \n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'percentage' => percentages[mark_col], 'percentile' => percentiles[mark_row.id]\n \t \t\t \t\t\t\t\t\t\t\t\t\t\t\t } \n\t end\n #In the column headings, the \"Total\" column is not added for the exams without assignments. Even though we populate\n #the \"Total\" column for the exams that do not have assignments, this column will not be displayed in the table. Note\n #that the list of columns displayed depend up on the column_key array, not the values in the \"table_values\" hash.\n #We can as well not populate the data for the exams without assignments. But the coding becomes messier. If, in the\n #future, the \"Total\" column should be displayed, just change the column_keys array.\n marks_hash[exam_id.to_s + \"_total\"] = { \t\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'value' => tot_marks, 'bg' => Grade.get_color_code(tot_marks) , \n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'max_marks' => tot_max_marks, 'pass_marks' => tot_pass_marks, \n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'percentage' => \"NA\", 'percentile' => \"NA\"\n \t\t\t \t\t\t\t\t\t\t\t\t\t\t\t } \n end\n sub_type = ssmap.subject.lab ? \" (Pr) \" : \" (Th) \"\n table_values << {'subject_name' => {'value' => ssmap.subject.name + sub_type}}.merge(marks_hash)\n end\n return {'master_column_headings' => master_column_headings, 'column_keys' => column_keys, 'column_headings' => column_headings, 'table_values' => table_values}\n end", "title": "" }, { "docid": "0262544ed1c914a3f29dd28fa3455fc4", "score": "0.48070237", "text": "def outcomeanalysis\n\t\t@study = Study.find(params[:study_id])\n\t\tmakeActive(@study)\n\t\t@model_name = \"outcome_analysis\" \n\t\t@project = Project.find(params[:project_id])\n\t\t@study_arms = Arm.where(:study_id => params[:study_id]).all\n\t\ttemplate_id = Study.get_template_id(@study.id)\n\t\t@outcomes = Outcome.find(:all, :conditions=>[\"study_id=?\",session[:study_id]],:select=>[\"id\",\"title\",\"description\"])\n\t \t\n\t\t@categorical_outcomes = Outcome.where(:study_id => @study.id, :outcome_type => \"Categorical\").all\n\t\t@continuous_outcomes = Outcome.where(:study_id => @study.id, :outcome_type => \"Continuous\").all\n\t\t@template_categorical_columns = OutcomeComparisonColumn.where(:template_id => template_id, :outcome_type => \"Categorical\").all\n\t\t@template_continuous_columns = OutcomeComparisonColumn.where(:template_id => template_id, :outcome_type => \"Continuous\").all\n\t\t@outcome_comparisons = OutcomeComparison.new\n\n \t\trender :layout => 'outcomeanalysis'\t \n \tend", "title": "" }, { "docid": "3236686dacb8f589ea6f510ce46cdba1", "score": "0.48064342", "text": "def export\n exporter = create_exporter\n @@dialog.setSubProgress(0, @items.size)\n $current_case.get_all_custodians.each do |c|\n break if @@dialog.abortWasRequested\n\n production_set = create_production(c)\n next if production_set.nil? || @@dialog.abortWasRequested\n\n @@dialog.setSubStatusAndLogIt(\"Exporting Production Set #{c}\")\n exporter.export_items(production_set)\n move_reports(c)\n end\n end", "title": "" }, { "docid": "b14309b19a5b399932e2d40f2dafa980", "score": "0.48052934", "text": "def final_report\n @student = Student.shod(params[:format])\n @batch = @student.batch\n @exam_groups ||= @batch.exam_groups\n @subjects ||= @batch.subjects\n authorize! :read, @student\n end", "title": "" }, { "docid": "3015b4015c4440b95d12cebd3a86b152", "score": "0.48026878", "text": "def extract_test_cases\n autograde_content = @package.test_files[Pathname.new('autograde.py')]\n test_cases_with_id = preload_question_test_cases\n assertion_types = assertion_types_regex\n\n # Regex to extract test cases\n pattern_test = /def\\s(test_(?:public|private|evaluation)_\\d+)\\(self\\):\\s*\\n(\\s+)((?:.|\\n)*?)self\\.assert(Equal|NotEqual|True|False|Is|IsNot|IsNone|IsNotNone)\\((.*)\\)/ # rubocop:disable Layout/LineLength\n pattern_meta = /\\s*self.meta\\[.*\\]\\s*=\\s*.*/\n pattern_meta_display = /\\s*self.meta\\[[\"']output[\"']\\]\\s*=\\s*(.*)/\n reg_test = Regexp.new(pattern_test)\n reg_meta = Regexp.new(pattern_meta)\n reg_meta_display = Regexp.new(pattern_meta_display)\n\n test_cases_regex = autograde_content.scan(reg_test)\n\n # Loop through each test case\n test_cases_regex.each do |test_case_match|\n test_case_object = default_codaveri_test_case_template\n test_name, indentation, test_content, assertion_type, assertion_content = test_case_match\n\n # prefix\n prefix = test_content.gsub(reg_meta, '').gsub(/^#{indentation}/, '').strip\n\n # expression\n expression = assertion_types[assertion_type.to_sym].call(assertion_content)\n\n # display\n display_list = test_content.scan(reg_meta_display)\n display = display_list[0] ? display_list[0][0] : ''\n\n # combine all extracted data\n test_case_object[:id] = test_cases_with_id[test_name]\n test_case_object[:timeout] = @question.time_limit * 1000 # in millisecond\n test_case_object[:prefix] = prefix\n test_case_object[:expression] = expression\n test_case_object[:display] = display\n\n @test_case_files.append(test_case_object)\n end\n end", "title": "" }, { "docid": "a52032d0efa5e0bafda9c88d6f5228c5", "score": "0.48013434", "text": "def automated_archive_rescue(options = {}) \n options.reverse_merge!({\n :author_email => \"shalott+importtesting@gmail.com\",\n :send_invites => false,\n :archivist => nil,\n :archive_file => \"ARCHIVE_DB.pl\",\n :attrs_to_keep => [],\n :attr_mapping => {},\n :val_mapping => {},\n :values_to_set => {},\n :base_url => \"\",\n :story_parse_method => nil,\n :comment_parse_method => nil,\n :load_comments => false,\n })\n \n base_dir = get_base_dir\n \n archivist = User.find_by_login(options[:archivist])\n unless archivist && archivist.is_archivist?\n puts \"Please create the #{options[:archivist]} account and get it set up as an archivist first!\"\n exit\n end\n \n # load db\n db = load_automated_archive_db(base_dir + options[:archive_file], options[:attrs_to_keep], options[:attr_mapping], options[:val_mapping], options[:values_to_set])\n \n # load actual stories\n db = load_automated_archive_stories(db, base_dir, options[:story_parse_method])\n \n # create works and comments\n work_ids = create_automated_archive_works(archivist, db, :base_url => options[:base_url], :base_dir => base_dir, \n :load_comments => options[:load_comments], :comment_parse_method => options[:comment_parse_method])\n \n # send invites\n if options[:send_invites]\n send_external_invites(work_ids, archivist)\n end\n end", "title": "" }, { "docid": "baaad2cd8aa02f811ef7659f9aa243b0", "score": "0.4800358", "text": "def bulk_data_export\n # Require all scopes for all possible resources being returned\n return if doorkeeper_authorize!(*PATIENT_READ_SCOPES)\n return if doorkeeper_authorize!(*OBSERVATION_READ_SCOPES)\n return if doorkeeper_authorize!(*QUESTIONNAIRE_RESPONSE_READ_SCOPES)\n return if doorkeeper_authorize!(*RELATED_PERSON_READ_SCOPES)\n return if doorkeeper_authorize!(*IMMUNIZATION_READ_SCOPES)\n return if doorkeeper_authorize!(*PROVENANCE_READ_SCOPES)\n\n unless accept_header?\n status_not_acceptable_with_custom_errors([\"'Accept' header must have a value of 'application/fhir+json',\" \\\n \" or the '_format' parameter must be one of 'json', 'application/json' or 'application/fhir+json'\"]) && return\n end\n\n unless prefer_header?\n status_unprocessable_entity_with_custom_errors([\"'Prefer' header must have value of 'respond-async'\"],\n '') && return\n end\n\n unless @m2m_workflow\n status_unauthorized_with_custom_errors(['Bulk export requires a client application registered for the Backend Services Workflow']) && return\n end\n\n if params.key?(:_type) || params.key?(:_outputFormat)\n status_unprocessable_entity_with_custom_errors(['The _type and _outputFormat parameters are unsupported'], '') && return\n end\n\n begin\n since = params.permit(:_since)[:_since]\n since = DateTime.strptime(since, '%Y-%m-%dT%H:%M:%S%z') if since.present?\n rescue Date::Error\n status_unprocessable_entity_with_custom_errors(['Invalid Date in _since parameter. Please use the FHIR instant datatype'], '') && return\n end\n\n client_app = current_client_application\n if client_app.exported_recently?\n response['Retry-After'] = client_app.retry_bulk_export_after.httpdate\n status_too_many_requests_with_custom_errors(\n [\"Client already initiated an export of this type in the last #{Rails.configuration.api['bulk_export_retry_after_minutes']} minutes. \" \\\n 'Please try again later']\n ) && return\n end\n\n # Create the download to uniquely id this request, and queue the ExportFhirJob\n download = ApiDownload.create(application_id: client_app.id, url: request.url)\n export_job = ExportFhirJob.perform_later(client_app, download, { since: since })\n # Add the job_id of the job to the download for reference in status requests\n download.update(job_id: export_job.provider_job_id)\n\n respond_to do |format|\n format.any { head(:accepted, content_location: \"#{root_url}fhir/r4/ExportStatus/#{download.id}\") }\n end\n end", "title": "" }, { "docid": "7d9724ebe6c118d814d6fe82053d9a0e", "score": "0.4788462", "text": "def export_as_ris\n export_text = \"\"\n # if format == 'book'\n format = fetch(\"format\")\n titles = fetch(\"title_t\", [])\n authors = fetch(\"author_name_t\", [])\n \n case format\n when \"book\" \n # Common\n reference_type = \"BOOK\"\n years = fetch(\"publication_year_t\", [])\n start_page = \"1\"\n end_page = fetch(\"publication_pages_t\", [\"1\"]).first\n publishers = fetch(\"publication_publisher_t\", [])\n serial_numbers = fetch(\"publication_newisbn_t\", [])\n serial_numbers.concat fetch(\"publication_isbn_t\", [])\n keywords = fetch(\"ctrlT_term_t\", [])\n abstracts = fetch(\"abstract_abstract_t\", [])\n when \"article\"\n # Common\n reference_type = \"JOUR\"\n years = fetch(\"journal_year_t\", [])\n start_page = fetch(\"journal_page_t\", [\"1\"]).first\n num_pages = fetch(\"journal_ppage_t\", [\"1\"]).first.to_i\n end_page = (start_page.to_i + num_pages - 1).to_s\n publishers = fetch(\"journal_publisher_t\", [])\n serial_numbers = fetch(\"journal_issn_t\", [])\n serial_numbers.concat fetch(\"journal_eissn_t\", [])\n keywords = fetch(\"ctrlt_text_t\", [])\n abstracts = fetch(\"abstract_text_t\", [])\n \n # Specific to Journal Articles\n journal_full_titles = fetch(\"journal_title_t\", [])\n journal_abbrev_titles = fetch(\"journal_atitle_t\", [])\n journal_volumes = fetch(\"journal_vol_t\", [])\n journal_issues = fetch(\"journal_issue_t\", [])\n when \"journal\"\n # Common\n reference_type = \"JFULL\"\n years = []\n # start_page = []\n # end_page = []\n \n publishers = fetch(\"publisher_name_facet\", [])\n serial_numbers = fetch(\"entry_issn_t\", [])\n # serial_numbers.concat fetch(\"entry_eissn_t\", [])\n keywords = fetch(\"keywords_facet\", [])\n abstracts = fetch(\"entry_description_t\", [])\n else\n years = fetch(\"journal_year_t\", []) \n end\n notes = fetch(\"note_note_t\", [])\n publication_places = fetch(\"publication_location_t\", [])\n dois = fetch(\"recordid_doi_t\", [])\n \n \n export_text << \"TY - #{reference_type}\\r\\n\"\n export_text << titles.map {|v| \"T1 - #{v}\\r\\n\" }.join\n export_text << authors.map {|v| \"AU - #{v}\\r\\n\" }.join\n export_text << years.map {|v| \"PY - #{v}\\r\\n\" }.join\n export_text << notes.map {|v| \"N1 - #{v}\\r\\n\" }.join\n export_text << keywords.map {|v| \"KW - #{v}\\r\\n\" }.join\n unless format == \"journal\"\n export_text << \"SP - #{start_page}\\r\\n\"\n export_text << \"EP - #{end_page}\\r\\n\"\n end\n if format == \"article\"\n export_text << journal_full_titles.map {|v| \"JF - #{v}\\r\\n\" }.join #JF\n export_text << journal_abbrev_titles.map {|v| \"JA - #{v}\\r\\n\" }.join #JA\n export_text << journal_volumes.map {|v| \"VL - #{v}\\r\\n\" }.join\n export_text << journal_issues.map {|v| \"IS - #{v}\\r\\n\" }.join #IS\n end\n export_text << publishers.map {|v| \"PB - #{v}\\r\\n\" }.join\n export_text << publication_places.map {|v| \"CY - #{v}\\r\\n\" }.join\n export_text << serial_numbers.map {|v| \"SN - #{v}\\r\\n\" }.join\n export_text << dois.map {|v| \"DO - #{v}\\r\\n\" }.join\n export_text << abstracts.map {|v| \"AB - #{v}\\r\\n\" }.join\n\n\n return export_text unless export_text.blank?\n end", "title": "" }, { "docid": "8c0d7c9c1f676294ca41fbf15f5ce5ce", "score": "0.47844645", "text": "def verify_user_imported(district=@districts.first)\n [\"student\",\"staff\"].each do |type|\n file_name = \"#{@district_data_root_dir}/#{district}/current/#{type}_sakai.csv\"\n missing = 0; found = 0; total = 0;\n open(file_name) do |fd|\n fd.each do |line|\n if line =~ /\\d+\\s*,\\s*(\\S+)/\n login = $1\n rites_login = ExternalUserDomain.external_login_to_login(login)\n if ExternalUserDomain.external_login_exists?(login)\n found += 1\n else\n missing += 1\n end\n total += 1\n end\n end\n end\n report \"district: #{district}, #{type} records found in #{File.basename(file_name)}: #{total}, imported to AR: #{found}, missing: #{missing}\"\n end\n end", "title": "" }, { "docid": "afdd58960c159eee5e95a84333886d25", "score": "0.47779763", "text": "def one_student_one_semester_all_exams_without_assignments\n #this will have all the rows except the heading row. Each of the rows will be hash keyed by the values in column_keys.\n \ttable_values = [] \n exam_ids = SecExamMap.search(:section_id_eq => @section.id, :semester_id_eq => @semester.id, :exam_exam_type_eq => EXAM_TYPE_TEST).result.select('exam_id').map { |x| x.exam_id }\n subject_maps = SecSubMap.search(:section_id_eq => @section.id, :semester_id_eq => @semester.id).result.all\n\n #This will have the index for the column headings hash and the table_values array\n column_keys = ['subject_name'] + exam_ids.map{ |x| x.to_s}\n column_headings = {}\n\n #Populate the column_headings hash. These will be the headings of the table.\n column_headings['subject_name'] = {'value' => \"Subject\", 'colspan' => 1 } \n exam_ids.each do |exam_id|\n column_headings[exam_id.to_s] = {'value' => Exam.find(exam_id).name, 'colspan' => 1}\n end\n \n #Get the data row wise. One row corresponds to one subject for all the exams. Take a subject\n #get the marks for all the exams. This method is not effective, but as long as it works, it is ok\n #now. Need to see if we can improve this.\n subject_maps.each do |ssmap|\n #to hold all the data of one row without the subject name.\n marks_hash = {}\n mark_col = ssmap.mark_column\n #loop through each of the exams and get the mark for this particular subject - mark_col\n exam_ids.each do |exam_id|\n mark_row = Mark.search(:student_id_eq => @student.id, :semester_id_eq => @semester.id, :section_id_eq => @section.id, :exam_id_eq => exam_id).result.first\n #At times, we would have associated the exams, but NOT have entered the marks. So, process the row only if \n #a corresponding row is available. \n if mark_row && mark_row.send(mark_col)\n #For every valid mark value there should be a mark criteria. If it is not present, let it throw an exception.\n mc = MarkCriteria.search(:semester_id_eq => mark_row.semester_id, :section_id_eq => mark_row.section_id, :exam_id_eq => exam_id, :subject_id_eq => ssmap.subject_id).result.first\n #pass_marks = mc ? mc.pass_marks : 0\n #max_marks = mc ? mc.max_marks : 0\n percentages = mark_row.percentages_with_mark_columns\n #Definition in mark.rb => self.subject_percentiles_with_mark_ids(col_name, section_id, semester_id, exam_id)\n percentiles = Mark.subject_percentiles_with_mark_ids(mark_col, mark_row.section_id, mark_row.semester_id, exam_id) \n marks_hash[exam_id.to_s] = { \t\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'value' => absent_na_values_to_s(mark_row.send(mark_col)), \n 'bg' => Grade.get_color_code(percentages[mark_col]) , \n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'max_marks' => mc.max_marks, 'pass_marks' => mc.pass_marks, \n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'percentage' => percentages[mark_col], 'percentile' => percentiles[mark_row.id]\n \t \t\t \t\t\t\t\t\t\t\t\t\t\t\t }\n\t end\n end\n sub_type = ssmap.subject.lab ? \" (Pr) \" : \" (Th) \"\n table_values << {'subject_name' => {'value' => ssmap.subject.name + sub_type}}.merge(marks_hash)\n end\n return {'column_keys' => column_keys, 'column_headings' => column_headings, 'table_values' => table_values}\n end", "title": "" }, { "docid": "a8250abb33a50371a93453ed9d95a70b", "score": "0.47763512", "text": "def assessments\n respond_with Assessment.find_all_by_user_id(params[:id],:select => [:name])\n end", "title": "" }, { "docid": "edfa786478eae742bfbfe2cbf89c7713", "score": "0.47721177", "text": "def generate_grouped_report2\n @students ||= @batch.students\n @student = @batch.students.first\n @exam_groups ||= @batch.result_published\n @subjects ||= @batch.subjects\n end", "title": "" }, { "docid": "697f6226fa880c8ab67abb2ecd2529c1", "score": "0.47713423", "text": "def process_students(json_file, student_file, stime_file, text_files,\n code_dir)\n data = JSON.load(File.read(json_file))\n \n data[data.keys.first].each do |full_email, json|\n email = full_email.split('@').first\n answers = {}\n json ||= {}\n (json['parts'] || {}).each do |qid, answer|\n question = @objects[qid]\n case question['type']\n when 'multiplechoice'\n answers[@titles[qid]] = @multiple_answers[qid][answer] || 0\n when 'latext_question'\n if output_file = text_files[@titles[qid]]\n output_file = output_file.gsub '@', email\n File.open(output_file, 'w') { |f| f.write answer }\n else\n answers[@titles[qid]] = answer\n end\n when 'code_question'\n dir = code_dir.gsub('@', email)\n FileUtils.mkpath dir\n get_file_group answer, dir\n end\n end\n \n if student_file\n File.open(student_file.gsub('@', email), 'w') do |f|\n f.write answers.to_yaml\n end\n else\n raise \"Got answers but no yml output file\" unless answers.empty?\n end\n \n if stime_file\n stime = json['submitted_at']\n File.open(stime_file.gsub('@', email), 'w') do |f|\n f.write({'time' => stime}.to_yaml)\n end\n end\n end\n end", "title": "" }, { "docid": "062bd977e4951dd43c6026e822d61a0a", "score": "0.4767849", "text": "def analyse \n conn = Site.connection\n \n # build up data structure for the API request\n data = api_tenements.find_all{|tnm| tnm.valid_geom?}.map{|x| {:id => x.id, :the_geom => x.x_wkt}}\n \n # call API\n url = \"http://protectedplanet.net/api2/geo_searches\"\n \n res = JSON.parse Net::HTTP.post_form(URI.parse(url),:data => data.to_json).body\n \n if res[\"results\"].present?\n # populate DB with results\n res[\"results\"].each do |res|\n t = Tenement.find res[\"id\"]\n t.query_area_km2 = res[\"query_area_km2\"]\n t.query_area_carbon_kg = res[\"query_area_carbon_kg\"]\n t.save\n \n res[\"protected_areas\"].each do |s|\n if !s[\"is_point\"]\n \n site = Site.create :tenement_id => t.id,\n :name => s['name'],\n :wdpaid => s['wdpaid'],\n :image => s['image'],\n # this data_standard could be removed, except for the export and a single use of its [\"NAME\"] property.\n :data_standard => s['data_standard'],\n :protected_carbon_kg => s['protected_carbon_kg'],\n :protected_area_km2 => s['protected_area_km2'],\n :query_area_protected_km2 => s['query_area_protected_km2'],\n :query_area_protected_carbon_kg => s['query_area_protected_carbon_kg'], \n :encoded_polyline_cache => s['epl']\n sql = \"UPDATE sites SET the_geom=ST_GeomFromText('#{s['simple_geom']}') where id=#{site.id}\" \n Site.connection.execute sql\n end \n end\n end \n end \n end", "title": "" }, { "docid": "6f5d2e0fb2198aea04bd282f8ccded68", "score": "0.47572064", "text": "def verify_users\n report \"Imported ActiveRecord entities by district:\"\n @districts.each do |district|\n begin\n verify_user_imported(district)\n rescue Exception => e\n log_message(\"missing district data for: #{district}\",{:log_level => 'error'})\n log_message(\"#{e.message}\",{:log_level => 'error'})\n end\n end\n end", "title": "" }, { "docid": "b4a7ab35f2a4ffaea597f80f9c82b31a", "score": "0.47569016", "text": "def generate_grouped_report\n if params[:batch_option][:id].present?\n @batch = Batch.shod(params[:batch_option][:id])\n generate_grouped_report2\n else\n generate_grouped_report3\n end\n authorize! :read, ExamGroup\n end", "title": "" }, { "docid": "cc0bea8b2b0fa416b0beff6515693d48", "score": "0.47517747", "text": "def perform\n site = Site.find(site_id)\n # A. LOGIN AND ALL THAT\n # 1. Create a client and login using the stored information \n site = Site.find(site_id)\n client = GData::Client::GBase.new\n client.authsub_token = site.user.gtoken\n profile_id = site.gid\n \n # 2. Create a new emission\n \n if site.emissions.find(:first, :conditions => { :year => date_start.year(), :month => date_start.month() })\n emission = site.emissions.find(:first, :conditions => { :year => date_start.year(), :month => date_start.month() })\n puts \"Overwrote emission\"\n else\n emission = site.emissions.new\n puts \"Created a new emission\"\n end\n \n emission.year = date_start.year()\n emission.month = date_start.month()\n day_start = date_start.strftime(\"%Y-%m-%d\")\n day_end = date_end.strftime(\"%Y-%m-%d\")\n \n # B. CALCULATE TOTAL TRAFFIC\n # 1. Get the pageview of all apges\n allpages = client.get('https://www.google.com/analytics/feeds/data?ids='+profile_id+'&dimensions=ga:pagePath&metrics=ga:pageviews&sort=-ga:pageviews&start-date='+day_start+'&end-date='+day_end).to_xml\n\n # 2. Initialiate variables\n total_size = 0\n totalvisits = 0\n page_text = \"\"\n if site.address then\n address = site.address\n else\n # Create a client and login using session \n client = GData::Client::GBase.new\n client.authsub_token = site.user.gtoken\n site = Site.find(site_id)\n today= DateTime.now-1.days\n amonthago = today-30.days\n today = today.strftime(\"%Y-%m-%d\")\n amonthago = amonthago.strftime(\"%Y-%m-%d\")\n # Get address (Not as easy as it should be!)\n address = client.get('https://www.google.com/analytics/feeds/data?ids='+site.gid+'&dimensions=ga:hostname&metrics=ga:pageviews&start-date='+amonthago+'&end-date='+today+'&sort=-ga:pageviews&aggregates=ga:hostname').to_xml\n address = address.to_s.split(\"dxp:dimension name='ga:hostname' value='\")[1]\n address = address.to_s.split(\"'\")[0]\n address = \"http://\"+address.to_s \n # Save the address in the db\n site.address = address\n end\n \n # 3. Iterate through the different pages\n pagecounter = 0\n averagesize = 0\n allpages.elements.each('entry') do |point|\n # 3.1 Get the URL\n url = point.elements[\"dxp:dimension name='ga:pagePath'\"].attribute(\"value\").value\n # 2. Get the number of visitors\n visits = point.elements[\"dxp:metric name='ga:pageviews'\"].attribute(\"value\").value\n # 3. Aggregate text\n if visits.to_i > 1 then\n if pagecounter < 20\n pagesize = pageSize(address+url)/1024\n # Calculate average size of the pages\n averagesize += pagesize\n pagecounter += 1\n else\n # After 20 times use the average size to not overload \n pagesize = averagesize/20\n end\n if pagesize == 0 and site.avgsize != nil then\n pagesize = site.avgsize\n end\n total_size += pagesize*visits.to_i\n end\n totalvisits += visits.to_i\n end\n emission.traffic = total_size\n\n # C. CALCULATE SERVER\n # 1. Get the country where the server is located\n address = site.address.to_s.split(\"//\")[1]\n country = \"\"\n # 1.1 Grab the info from API\n uri = \"http://api.ipinfodb.com/v2/ip_query_country.php?key=f03ff18218a050bb05f6b501ce49c10a4f6f063eef9151109de17e299b3b0835&ip=#{address}\"\n # 1.2 Get the name using Hpricot\n doc = Hpricot(open(uri))\n (doc/'response').each do |el|\n country = (el/'countryname').inner_html.to_s\n end\n # 2. Get the emission factor for that country\n if Country.find(:first,:conditions => [ \"name = ?\", country ]) then\n serverfactor=Country.find(:first,:conditions => [ \"name = ?\", country ]).factor\n serverfactorgr = serverfactor/1000\n else\n serverfactorgr=0.501\n end\n emission.server_location = country\n # 3. Calculate the CO2\n # 3.1 Set the factor kWh per GB\n emission.factor = 3.5\n # 3.2 Calculate CO2\n co2_server = 0\n co2_server = total_size * emission.factor * serverfactorgr # kB * (kWh/Gb) * kg \n co2_server = co2_server / 1025 #Adjusting for kB to Gb and Kg to grams\n # 3.3 Save in the db\n emission.co2_server = co2_server\n \n # D. CALCULATE VISITORS IMPACT\n # Get the visitor information from Google Analytics\n visitors = client.get('https://www.google.com/analytics/feeds/data?ids='+profile_id+'&dimensions=ga:country&metrics=ga:timeOnSite&start-date='+day_start+'&end-date='+day_end+'&aggregates=ga:country').to_xml\n # Parse the time on site by country \n visitors_text = \" \"\n time = 0 \n co2_visitors = 0\n totalvisitors = 0\n visitors.elements.each('entry') do |land|\n # Parse country\n name = land.elements[\"dxp:dimension name='ga:country'\"].attribute(\"value\").value\n # Get carbon factor\n factor = \"\"\n # See if it exists in our database\n if Country.find(:first,:conditions => [ \"name = ?\", name ]) then\n factor=Country.find(:first,:conditions => [ \"name = ?\", name ]).factor\n else\n # If do not exist then we create it in database and retrieve info from CARMA\n if name then\n h_name = name.gsub(\" \", \"%20\")\n begin\n carma = Net::HTTP.get(URI.parse(\"http://carma.org/api/1.1/searchLocations?region_type=2&name=\"+h_name+\"&format=json\"))\n # Parse the factor from Json string\n factor = carma.to_s.split(\"intensity\")[1]\n factor = factor.to_s.split('present\" : \"')[1] \n factor = factor.to_s.split('\",')[0]\n rescue Exception => exc\n factor = \"501\"\n end\n end\n #Save in our database\n c = Country.new()\n c.name = name\n c.factor = factor\n c.save\n end\n \n if factor == \"\" then\n factor = \"501\"\n end\n # Parse time \n time2 = land.elements[\"dxp:metric name=ga:'timeOnSite'\"].attribute(\"value\").value\n time2 = (time2.to_f/60).round(2)\n # Calculate the impact\n carbonimpact = factor.to_f * time2 * 35.55 / 60000\n # Aggregate\n co2_visitors += carbonimpact\n time += time2\n grams = carbonimpact.round(2)\n if grams != 0\n text = \"<b>\" + name.to_s + \"</b> \" + time2.to_s + \" min \"+ grams.to_s + \" grams CO2. With a factor of \"+factor.to_f.round(2).to_s+\"<br/>\"\n visitors_text += text\n end \n end\n #Save in database\n emission.co2_users = co2_visitors\n emission.text_users = visitors_text \n emission.visitors = totalvisits.to_i\n emission.time = time.to_d\n \n # AND SAVE\n emission.save\n end", "title": "" }, { "docid": "1e5204d96ef652cc9953e0dbdb4b14dc", "score": "0.4750801", "text": "def student_exam_report\n @exam_group = ExamGroup.shod(params[:exam_group_id])\n @student = Student.shod(params[:student_id])\n @batch = @exam_group.batch\n @general_setting = GeneralSetting.first\n render 'student_exam_report', layout: false\n end", "title": "" }, { "docid": "d462594eb4cc9d004f04baf73952453d", "score": "0.47504634", "text": "def find_animal_assessments(cohort:, date:)\n if cohort and date and TaggedAnimalAssessment.exists?(shl_case_number: cohort, measurement_date: date)\n TaggedAnimalAssessment.where(shl_case_number: cohort, measurement_date: date)\n elsif cohort and TaggedAnimalAssessment.exists?(shl_case_number: cohort)\n TaggedAnimalAssessment.where(shl_case_number: cohort)\n elsif date and TaggedAnimalAssessment.exists?(measurement_date: date)\n TaggedAnimalAssessment.where(measurement_date: date)\n end\n end", "title": "" }, { "docid": "0f0aa616d2c4d2cdd261dde0d2f83abf", "score": "0.47502285", "text": "def exam_wise_consolidated_report\n @exam_group = ExamGroup.shod(params[:exam_group_id])\n @batch = @exam_group.batch\n @general_setting = GeneralSetting.first\n render 'exam_wise_consolidated_report', layout: false\n end", "title": "" }, { "docid": "1deb0a495d593f625c5fba9638d6c290", "score": "0.4750131", "text": "def test_scripts4\n Assessment.UserExam\n end", "title": "" }, { "docid": "b9d0dcf2fd5d0049604bf8c5388cf3db", "score": "0.47477564", "text": "def generate_all(debug = false)\n\t[2012,2013].each do |year|\n\t\t[\"SPRING\", \"FALL\"].each do|term|\n\t\t\tterm = term #Setting semesters\n\t\t\ttermYear = year #Searches for current year as default!\n\t\t\tfile = File.open(\"departments.txt\",\"rb\") \n\t\t\tlines = file.read.split(\"\\n\")\n\t\t\tfile.close\n\t\t\tfailed = 0\n\t\t\tsucceeded = 0\n\t\t\tlines.each do |line|\n\t\t\t\tputs(line)\n\t\t\t\tif not line.include?(\":\")\n\t\t\t\t\tbreak\n\t\t\t\tend\n\t\t\t\tdepartment = line.to_s.split(\":\")[1].strip\n\t\t\t\turl = \"https://apis-qa.berkeley.edu/cxf/asws/classoffering?departmentCode=\" << department.strip << \"&term=\" << term << \n\t\t\t\t \"&termYear=\" << termYear.to_s << \"&_type=json&app_id=8865dfb5&app_key=125b30796efb2602f0ce00aaa0f6de5e\"\n\t\t\t\n\t\t\t\tresponse = HTTParty.get(url)\n\t\t\t\t#puts(\"Response: \" + response.body)\n\t\t\t\n\t\t\t\tparsed = JSON.parse(response.body)\n\t\t\t\tcourses = parsed[\"ClassOffering\"]\n\t\t\t\t#puts(course.to_s)\n\t\t\t\tcourses.each do |course|\n\t\t\t\t\tbegin\n\t\t\t\t\t\tname = course[\"courseTitle\"]\n\t\t\t\t\t\tdepartment = course[\"departmentCode\"]\n\t\t\t\t\t\tcourse_number = course[\"courseNumber\"].to_s\n\t\t\t\t\t\tunits = course[\"lowerUnits\"]\n\t\t\t\t\t\t#building = course[\"sections\"][0][\"sectionMeetings\"][\"building\"]\n\t\t\t\t\t\t#room = course[\"sections\"][0][\"sectionMeetings\"][\"room\"].to_s\n\t\t\t\t\t\tprofessor = course[\"sections\"][0][\"sectionMeetings\"][\"instructorNames\"]\n\n\t\t\t\t\t\tcoursem_info = \"Units: \" + units.to_s\n\t\t\t\t\t\tif debug\n\t\t\t\t\t\t\tputs(\"name: \" + name)\n\t\t\t\t\t\t\tputs(\"department: \" + department)\n\t\t\t\t\t\t\tputs(\"course_number: \" + course_number)\n\t\t\t\t\t\t\tputs(\"units: \" + units.to_s)\n\t\t\t\t\t\t\t#puts(\"building: \" + building)\n\t\t\t\t\t\t\t#puts(\"room: \" + room)\n\t\t\t\t\t\t\tputs(\"professor: \" + professor)\n\t\t\t\t\t\t\tputs(\"coursem_info: \" + coursem_info)\n\t\t\t\t\t\tend\n\t\t\t\t\t\tCourse.new.createAll(name,coursem_info,department,course_number,term,termYear,professor)\n\t\t\t\t\t\tsucceeded += 1\n\t\t\t\t\trescue\n\t\t\t\t\t\tfailed += 1\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\n\t\t\tend\n\t\tend\n\tend\t\n\t\nend", "title": "" }, { "docid": "fe0a83d7d8d6bb4975406f84aee12eca", "score": "0.47470337", "text": "def dummy_data_for_demo(_params)\n #Dummy_ED\n coverage_year = FinancialAssistanceRegistry[:application_year].item.call.value!\n @model.update_attributes!(aasm_state: \"determined\", assistance_year: coverage_year, determination_http_status_code: 200)\n\n @model.eligibility_determinations.each do |ed|\n ed.update_attributes(max_aptc: 200.00,\n csr_percent_as_integer: 73,\n is_eligibility_determined: true,\n effective_starting_on: Date.new(coverage_year, 0o1, 0o1),\n determined_at: TimeKeeper.datetime_of_record - 30.days,\n source: \"Faa\")\n ed.applicants.first.update_attributes!(is_medicaid_chip_eligible: false, is_ia_eligible: false, is_without_assistance: true) if ed.applicants.count > 0\n ed.applicants.second.update_attributes!(is_medicaid_chip_eligible: false, is_ia_eligible: true, is_without_assistance: false) if ed.applicants.count > 1\n ed.applicants.third.update_attributes!(is_medicaid_chip_eligible: true, is_ia_eligible: false, is_without_assistance: false) if ed.applicants.count > 2\n\n #Update the Income and MEC verifications to Outstanding\n @model.applicants.each do |applicant|\n applicant.update_attributes!(:assisted_income_validation => \"outstanding\", :assisted_mec_validation => \"outstanding\", aasm_state: \"verification_outstanding\")\n applicant.verification_types.each { |verification| verification.update_attributes!(validation_status: \"outstanding\") }\n end\n end\n end", "title": "" }, { "docid": "c2a6c659fce24187c9b020bcadb76363", "score": "0.474316", "text": "def generate_view_transcripts2\n @students ||= @batch.students\n @exam_groups ||= @batch.result_published\n @student = @batch.students.first\n end", "title": "" }, { "docid": "8480aa93ff629534fdb57351dbb0d479", "score": "0.47429264", "text": "def moving_data(assessment_package_id)\n assessment_package = AssessmentPackage.find(assessment_package_id)\n\n package = Package.new\n package.name = assessment_package.name\n package.tenant_id = assessment_package.tenant_id\n package.user_id = assessment_package.user_id\n package.save\n\n if !(assessment_package.assessment_order.nil?) and !(assessment_package.assessment_order.blank?)\n assessment_package.assessment_order.split(',').each { |ass|\n assessment_course = AssessmentCourse.new\n assessment_course.assessment_id = ass.to_i\n assessment_course.package_id = package.id\n assessment_course.user_id = assessment_package.user_id\n assessment_course.tenant_id = assessment_package.tenant_id\n assessment_course.save\n\n assessment = Assessment.find(ass.to_i)\n assessment.learners.each { |learner|\n learner.update_attribute(:package_id,package.id)\n }\n }\n else\n single_assessment = Assessment.find_by_assessment_package_id(assessment_package.id)\n unless single_assessment.id.nil?\n assessment_course = AssessmentCourse.new\n assessment_course.assessment_id = single_assessment.id\n assessment_course.package_id = package.id\n assessment_course.user_id = assessment_package.user_id\n assessment_course.tenant_id = assessment_package.tenant_id\n assessment_course.save\n\n single_assessment.learners.each { |learner|\n learner.update_attribute(:package_id,package.id)\n }\n end\n end\n assessment_package.coupons.each{|coupon|\n coupon.update_attribute(:package_id,package.id)\n }\n \n end", "title": "" }, { "docid": "ce7bad8f29bf317ca911454b55f50e1e", "score": "0.47387728", "text": "def write(apartments)\n CSV.open(@path, 'w') do |f|\n apartments.each { |apartment| apartment.description.to_a.each { |element| f << element } }\n end\n end", "title": "" }, { "docid": "6f7241543e054a8bfb13d5ba556b785a", "score": "0.4735249", "text": "def test_dh\n event = SingleDayEvent.create(:discipline => 'Downhill')\n results_file = ResultsFile.new(File.new(\"#{File.dirname(__FILE__)}/../fixtures/results/dh.xls\"), event)\n results_file.import\n end", "title": "" }, { "docid": "3b7d9256bf69811c09730000eec6ecf0", "score": "0.47350228", "text": "def exam_wise_students_report\n @exam_group = ExamGroup.shod(params[:exam_group_id])\n @batch = @exam_group.batch\n @students ||= @batch.students\n @general_setting = GeneralSetting.first\n render 'exam_wise_students_report', layout: false\n end", "title": "" }, { "docid": "f77d1a647af9f7ab8b0ae3855c5e7f07", "score": "0.47150487", "text": "def student_report\n @batch = Batch.shod(params[:id])\n @exam_groups ||= @batch.result_published\n @student = Student.shod(params[:student_id])\n @subjects ||= @batch.subjects\n authorize! :read, @exam_groups.first\n end", "title": "" }, { "docid": "b7e97aa6d1022b231f4021bacd8cf5b0", "score": "0.471403", "text": "def populate_db data\n\n assay = nil\n assay_json = data[\"assay\"]\n\n if assay_json\n if assay_json[\"creator last name\"] && assay_json[\"creator first name\"] #&& assay_json[\"creator email\"]\n set_creator data[\"assay\"]\n else\n @creator = Person.find(User.current_user.person_id)\n end\n if assay_json[\"investigation title\"] &&\n assay_json[\"assay type title\"] &&\n assay_json[\"study title\"]\n assay = populate_assay data[\"assay\"], @file.content_blob.original_filename\n end\n else\n @creator = Person.find(User.current_user.person_id)\n end\n\n data[\"rows\"].each do |data_row|\n\n specimen_json = data_row[\"specimen\"]\n sample_json = data_row[\"sample\"]\n treatment_json = data_row[\"treatment\"]\n\n sample = nil\n specimen = nil\n\n if specimen_json\n specimen = populate_specimen specimen_json\n end\n\n if sample_json && specimen\n sample = populate_sample sample_json, specimen, assay\n end\n\n if treatment_json && (specimen || sample)\n populate_treatment treatment_json, specimen, sample\n end\n\n\n end\n\n\n end", "title": "" }, { "docid": "62b5b811ccdd2b6d66fb84eb058fd6f6", "score": "0.47096518", "text": "def process_grades_incremental (dbh)\n # Delete the old output file if it exists\n File.delete(\"grades_incremental.csv\") if File::exists?(\"grades_incremental.csv\")\n CSV.open(\"grades_incremental.csv\", \"a\", {:force_quotes=>false}) do |csv|\n csv << [\"State Testing Identifier\", \"Student Number\", \"Student Grade Level\", \"School Year\", \"Term\", \"Subject\", \"Course\", \"Score\", \"Date\", \"IsFinalGrade\", \"LetterGrade\"]\n end\n \n # Query to return the last 3 months of grades\n query = \"select s.state_studentnumber c1, s.student_number c2, \" +\n \"s.grade_level c3, to_char(to_number(substr(sec.termid, 0,2)) + 1990) c4, \" +\n \"g.finalgradename c5, \" +\n\t\" case ps_customfields.getcf('courses', c.id, 'va_sced_subject_area') \" +\n\t\t\"when '01' then 'Reading' \" +\n\t\t\"when '02' then 'Math' \" +\n\t\t\"when '03' then 'Science' \" +\n\t\t\"when '04' then 'Social Science' \" +\n\t\t\"when '05' then 'Art' \" +\n\t\t\"when '06' then 'Foreign Language' \" +\n\t\t\"when '07' then 'Religion' \" +\n\t\t\"when '08' then 'Health' \" +\n\t\t\"when '09' then 'Military' \" +\n\t\t\"when '10' then 'Technology' \" +\n\t\t\"when '11' then 'Commnunication' \" +\n\t\t\"when '12' then 'Business' \" +\n\t\t\"when '13' then 'Manufacturing' \" +\n\t\t\"when '14' then 'Health Care' \" +\n\t\t\"when '15' then 'Public Service' \" +\n\t\t\"when '16' then 'Hospitality' \" +\n\t\t\"when '17' then 'Construction' \" +\n\t\t\"when '18' then 'Agriculture' \" +\n\t\t\"when '19' then 'Human Services' \" +\n\t\t\"when '20' then 'Transportation' \" +\n\t\t\"when '21' then 'Engineering' \" +\n\t\t\"when '22' then 'Miscellaneous' \" +\n\t\t\"when '51' then 'Reading' \" +\n\t\t\"when '52' then 'Math' \" +\n\t\t\"when '53' then 'Science' \" +\n\t\t\"when '54' then 'Social Science' \" +\n\t\t\"when '55' then 'Art' \" +\n\t\t\"when '56' then 'Foreign Language' \" +\n\t\t\"when '57' then 'Religion' \" +\n\t\t\"when '58' then 'Health' \" +\n\t\t\"when '60' then 'Technology' \" +\n\t\t\"when '61' then 'Commnunication' \" +\n\t\t\"when '62' then 'Business' \" +\n\t\t\"when '63' then 'Manufacturing' \" +\n\t\t\"when '64' then 'Health Care' \" +\n\t\t\"when '65' then 'Public Service' \" +\n\t\t\"when '66' then 'Hospitality' \" +\n\t\t\"when '67' then 'Construction' \" +\n\t\t\"when '68' then 'Agriculture' \" +\n\t\t\"when '69' then 'Human Services' \" +\n\t\t\"when '70' then 'Transportation' \" +\n\t\t\"when '71' then 'Engineering' \" +\n\t\t\"when '72' then 'Miscellaneous' \" +\n\t\t\" else 'Unknown' \" +\n\t\"end c6, \" +\n\t\"c.Course_Name c7, g.percent c8, \" +\n\t\"to_char(g.enddate, 'MM/DD/YYYY') c9, \" +\n\t\"case g.finalgradename \" +\n\t\"when 'F1' then 1 \" +\n\t\"when 'Y1' then 1 \" +\n\t\"else 0 \" +\n\t\"end c10, \" +\n\t\"substr(g.grade, 1, 1) c11 \" +\n \"from students s \" +\n\t\"join pgfinalgrades g on s.id = g.studentid \" +\n\t\"join sections sec on g.sectionid = sec.id \" +\n\t\"join courses c on c.course_number = sec.course_number \" +\n \"where g.grade is not null and g.grade <> '--' \" +\n\t\"and g.percent is not null and g.percent <> 0 \" +\n\t\"and g.finalgradename in ('Q1', 'Q2', 'Q3', 'Q4', 'Y1', 'F1', 'S1', 'S2') \" +\n\t\"and g.enddate > add_months(sysdate, -3) \" +\n \"order by s.state_studentnumber, g.enddate\"\n\t\n # Run the query\t\n sth = dbh.exec(query)\n # Loop through the rows and write out the CSV file\n while row = sth.fetch_hash\n # Write out the output csv in the format that IA wants\n CSV.open(\"grades_incremental.csv\", \"a\", {:force_quotes=>false}) do |csv|\n csv << [row[\"C1\"],row[\"C2\"].to_i,row[\"C3\"],row[\"C4\"],row[\"C5\"],row[\"C6\"],row[\"C7\"],row[\"C8\"],row[\"C9\"],row[\"C10\"].to_i,row[\"C11\"]]\n end\n end\nend", "title": "" }, { "docid": "934f9bb79c03d3d5af6f86e800579754", "score": "0.4706996", "text": "def student_meeting_importer_enabled?\n @district_key == SOMERVILLE\n end", "title": "" } ]
84535ce0dbd3ed96f08dccfa545ff4d6
Sign Out (Clear Token)
[ { "docid": "7e9aa56a9905dd2fb5c6de548afbf82e", "score": "0.0", "text": "def destroy\n @user.update_attributes(:api_authtoken => nil, :authtoken_expiry => nil)\n render_success_message(200, \"Token cleared\")\n end", "title": "" } ]
[ { "docid": "8da00f87c7bf8b7983c3887016a10c17", "score": "0.8765521", "text": "def logout\n clear_token\n end", "title": "" }, { "docid": "e72b4c15768d8a31c2bfb55d6a03346c", "score": "0.8651306", "text": "def sign_out\n @current_user = nil\n cookies.delete(:auth_token)\n end", "title": "" }, { "docid": "e72b4c15768d8a31c2bfb55d6a03346c", "score": "0.8651306", "text": "def sign_out\n @current_user = nil\n cookies.delete(:auth_token)\n end", "title": "" }, { "docid": "e72b4c15768d8a31c2bfb55d6a03346c", "score": "0.8651306", "text": "def sign_out\n @current_user = nil\n cookies.delete(:auth_token)\n end", "title": "" }, { "docid": "e555a82d1e166edd231e500893154de0", "score": "0.8649014", "text": "def sign_out\n @username = nil\n @current_user = nil\n\n @token = nil\n end", "title": "" }, { "docid": "ab8b02042079ff11d915fdddf1f3470c", "score": "0.8585489", "text": "def sign_out\n\t\tself.current_user = nil\n\t\tcookies.delete(:user_token)\n\tend", "title": "" }, { "docid": "32a142595d87bd011917582154c072b8", "score": "0.85486853", "text": "def sign_out\n session[:session_token] = @current_user = nil\n end", "title": "" }, { "docid": "f9f2754db8ab161f69ddd18fb8994462", "score": "0.84689885", "text": "def sign_out\n logout\n end", "title": "" }, { "docid": "2fb34b53379f12973d9181e029cf4c2c", "score": "0.8440964", "text": "def logout!\n AuthenticationToken.destroy(self.auth_token.id)\n end", "title": "" }, { "docid": "88363a78c47d8b0da9235aa9c0787fb0", "score": "0.8411009", "text": "def logout\n @settings.remove('token')\n end", "title": "" }, { "docid": "472471b41215d2e330635c2ffb5373f9", "score": "0.84105223", "text": "def sign_out\n @current_member = nil\n cookies[:access_token] = nil\n end", "title": "" }, { "docid": "8c810de7b3a8fc829e8d22dcad4009e4", "score": "0.84045005", "text": "def logout\n @base.token = nil\n end", "title": "" }, { "docid": "8b33149d923f6d8ea28ffadbe8917137", "score": "0.8392684", "text": "def logout\n self.auth_token = nil\n @current_user = nil\n end", "title": "" }, { "docid": "6916d7c09fcf3c00b161a0f6f661970f", "score": "0.838388", "text": "def sign_out\n self.identity = nil\n end", "title": "" }, { "docid": "12148e4dbef3d39d968ed808e7d5b0c4", "score": "0.8362171", "text": "def sign_out\n\t return unless current_user\n\t current_user.update!(session_token: nil)\n\t session.delete(:session_token)\n end", "title": "" }, { "docid": "5ac6a13fb602eb25b949417f15e25206", "score": "0.8343278", "text": "def sign_out\n reset_session\n @current_user = nil\n end", "title": "" }, { "docid": "1ab6735032588ffe96e5f4e6e767a58b", "score": "0.8341153", "text": "def sign_out\n\t\n\t# clear current variable\n self.current_user = nil\n\t\n\t# clear value from cookie\n cookies.delete(:remember_token)\n end", "title": "" }, { "docid": "408468acef196bc9132a1e04f4e033ff", "score": "0.8327087", "text": "def sign_out\n token = cookies[:remember_token] || token\n logger.info('Inside sign_out')\n logger.info('Token: ' + token)\n current_user.delete_refresh_token\n $redis_user.del(token)\n cookies.delete(token)\n\n self.current_user = nil\n end", "title": "" }, { "docid": "6a1bebf6f3a8e9bc0f8c3906b2c2270d", "score": "0.8319132", "text": "def sign_out\n reset_session\n cookies.delete(AUTH_KEY)\n @current_user = nil\n end", "title": "" }, { "docid": "1c5b8e8fd392616401858ef40c9d3f79", "score": "0.8309908", "text": "def signout\n Session.destroy\n end", "title": "" }, { "docid": "1cba79c3422a0465a884502eef1e4c2c", "score": "0.83068115", "text": "def log_out\n session.delete(:token)\n @current_user = nil\n end", "title": "" }, { "docid": "1cba79c3422a0465a884502eef1e4c2c", "score": "0.83068115", "text": "def log_out\n session.delete(:token)\n @current_user = nil\n end", "title": "" }, { "docid": "990cb7c509336d2f88ebfe501ec93fd8", "score": "0.8302037", "text": "def sign_out!\n current_user_manager.sign_out!\n end", "title": "" }, { "docid": "42de0291fd89a396848a9176b3f48b4d", "score": "0.83008873", "text": "def log_out\n session[:user_token] = nil\n end", "title": "" }, { "docid": "d7d114293097324ad05f023ebef12118", "score": "0.8283219", "text": "def logout\n self.user.logout()\n @client.token = nil\n end", "title": "" }, { "docid": "df2c58f44015f34eecd77afadeae3cce", "score": "0.8278746", "text": "def logout!\n session[:auth_token] = nil\n cookies[:auth_token] = nil\n end", "title": "" }, { "docid": "d79f859c9d04a96176f742d1a48a5eec", "score": "0.8252415", "text": "def signout\n if current_user\n current_user.update_column(:authentication_token, nil)\n cookies[:a_t] = nil\n head :ok\n else\n head :bad_request\n end\n end", "title": "" }, { "docid": "1a76f1ef62ee9e2a05b089215baffcd8", "score": "0.8241978", "text": "def sign_out\n\t\tif session[:access_token]\n\t\t\tsession[:access_token] = nil\n\t\t\tcookies.delete(:access_token)\n\t\tend\n\t\tif session[:remember_token]\n\t cookies.delete(:remember_token)\n\t\tend\n\t\tself.current_user = nil\n end", "title": "" }, { "docid": "17a738724ebe32eb3dcf6231ef67e2f3", "score": "0.8240344", "text": "def logout_user\n cookies.delete(:auth_token)\n end", "title": "" }, { "docid": "17a738724ebe32eb3dcf6231ef67e2f3", "score": "0.8240344", "text": "def logout_user\n cookies.delete(:auth_token)\n end", "title": "" }, { "docid": "264e2ab259fd94a39458dfc93e9d3223", "score": "0.8234171", "text": "def sign_out\n @request.env[:clearance].sign_out\n end", "title": "" }, { "docid": "a84152e2a04cc2164267112948d9171f", "score": "0.82324505", "text": "def sign_out!\n @user = nil\n end", "title": "" }, { "docid": "3bcab274f33cfd8ea5b28002a2193654", "score": "0.81995785", "text": "def sign_out\n cookies.delete(:user_id)\n cookies.delete(:user_token)\n session.delete(:user_id)\n end", "title": "" }, { "docid": "2834148076639d78a4c027592bc51c02", "score": "0.81734204", "text": "def logout\n self.current_user.forget_me if logged_in?\n cookies.delete :auth_token\n reset_session\n redirect_to root_path\n end", "title": "" }, { "docid": "676cfc844f2542408bfda3f582a29113", "score": "0.8144748", "text": "def sign_out\n\t \tself.current_user = nil\n\t \tcookies.delete(:remember_token)\n\t \t#segons la web\n\t\t #forget(current_user)\n\t\t #session.delete(:user_id)\n\t\t #@current_user = nil\n\t end", "title": "" }, { "docid": "06cf1ed92550b4e968297f9b0ee82e6c", "score": "0.81285703", "text": "def sign_out\n @controller.sign_out\n end", "title": "" }, { "docid": "14f9a355b4aeafac9bca50ce9a5d0a88", "score": "0.81256837", "text": "def sign_out\n cookies.delete(IDENTITY_PROVIDER_CONFIG['cookie_name'])\n self.current_identity = nil\n end", "title": "" }, { "docid": "a3778c693706ebd2a7a674a95ac9cede", "score": "0.8119464", "text": "def sign_out\n session[:user_id] = nil\n @current_user = nil\n end", "title": "" }, { "docid": "371ecb96b6d28f04e201364d1298d3cf", "score": "0.811028", "text": "def logout!\n current_user.reset_session_token!\n \n session[:session_token] = nil\n @current_user = nil\n end", "title": "" }, { "docid": "50986c0d4b9cfd0a4010c1b1e84e3fb1", "score": "0.81076664", "text": "def sign_out\n @current_user = nil\n session[:user_id] = nil\n end", "title": "" }, { "docid": "a717698de2eb1d3dd6c10145cfee94e6", "score": "0.8107002", "text": "def sign_out\n session.delete(:user_id)\n @current_user = nil\n end", "title": "" }, { "docid": "eb376969ad01dc1c03771afb1dab56ab", "score": "0.80996144", "text": "def destroy\n self.current_user.forget_me if logged_in?\n cookies.delete :auth_token\n reset_session\n flash[:notice] = 'You have been logged out.'\n redirect_back_or_default('/')\n end", "title": "" }, { "docid": "725c5d7a2f67ff4c17ef84859fad9d08", "score": "0.8096339", "text": "def sign_out\n cookies.delete(:remember_token)\n self.current_user = nil\n end", "title": "" }, { "docid": "725c5d7a2f67ff4c17ef84859fad9d08", "score": "0.8096339", "text": "def sign_out\n cookies.delete(:remember_token)\n self.current_user = nil\n end", "title": "" }, { "docid": "fbaa4cf1fef0c4970604bf010ad06816", "score": "0.80922186", "text": "def destroy\n self.current_user.forget_me if logged_in?\n cookies.delete :auth_token\n reset_session\n flash[:notice] = \"You have been logged out.\"\n redirect_back_or_default('/')\n end", "title": "" }, { "docid": "0cc79ea449b554dfed7878860565f1a8", "score": "0.80849046", "text": "def log_out\n if (user = current_user)\n user.update_attribute(:auth_token, nil)\n end\n cookies[TOKEN_COOKIE] = nil\n end", "title": "" }, { "docid": "b31549af2d3ba6d28dd86776c67b1c86", "score": "0.80778515", "text": "def logout()\n @token = nil\n self\n end", "title": "" }, { "docid": "b5b9848ed4cd4b3fe584f3fd26d7ef35", "score": "0.80716056", "text": "def logout!\n current_user.reset_session_token!\n session[:session_token] = nil\n end", "title": "" }, { "docid": "26688c493664525712239bd50b241797", "score": "0.80711085", "text": "def sign_out\n self.current_user = nil\n cookies.delete(:remember_token)\n end", "title": "" }, { "docid": "26688c493664525712239bd50b241797", "score": "0.80711085", "text": "def sign_out\n self.current_user = nil\n cookies.delete(:remember_token)\n end", "title": "" }, { "docid": "26688c493664525712239bd50b241797", "score": "0.80711085", "text": "def sign_out\n self.current_user = nil\n cookies.delete(:remember_token)\n end", "title": "" }, { "docid": "26688c493664525712239bd50b241797", "score": "0.80711085", "text": "def sign_out\n self.current_user = nil\n cookies.delete(:remember_token)\n end", "title": "" }, { "docid": "26688c493664525712239bd50b241797", "score": "0.80711085", "text": "def sign_out\n self.current_user = nil\n cookies.delete(:remember_token)\n end", "title": "" }, { "docid": "26688c493664525712239bd50b241797", "score": "0.80711085", "text": "def sign_out\n self.current_user = nil\n cookies.delete(:remember_token)\n end", "title": "" }, { "docid": "26688c493664525712239bd50b241797", "score": "0.80711085", "text": "def sign_out\n self.current_user = nil\n cookies.delete(:remember_token)\n end", "title": "" }, { "docid": "26688c493664525712239bd50b241797", "score": "0.80711085", "text": "def sign_out\n self.current_user = nil\n cookies.delete(:remember_token)\n end", "title": "" }, { "docid": "26688c493664525712239bd50b241797", "score": "0.80711085", "text": "def sign_out\n self.current_user = nil\n cookies.delete(:remember_token)\n end", "title": "" }, { "docid": "26688c493664525712239bd50b241797", "score": "0.80711085", "text": "def sign_out\n self.current_user = nil\n cookies.delete(:remember_token)\n end", "title": "" }, { "docid": "26688c493664525712239bd50b241797", "score": "0.80711085", "text": "def sign_out\n self.current_user = nil\n cookies.delete(:remember_token)\n end", "title": "" }, { "docid": "26688c493664525712239bd50b241797", "score": "0.80711085", "text": "def sign_out\n self.current_user = nil\n cookies.delete(:remember_token)\n end", "title": "" }, { "docid": "26688c493664525712239bd50b241797", "score": "0.80711085", "text": "def sign_out\n self.current_user = nil\n cookies.delete(:remember_token)\n end", "title": "" }, { "docid": "fc54290a24d699a0c5dcd631f4ec7083", "score": "0.80649287", "text": "def log_out\n session.delete(:user_id)\n session.delete(:token)\n @current_user = nil\n reset_session\n end", "title": "" }, { "docid": "808727a733513041d355f5618340fd70", "score": "0.8063476", "text": "def sign_out\n self.current_user = nil \n cookies.delete(:remember_token)\n end", "title": "" }, { "docid": "4fe3c2050b55cb3124b5764143c053f9", "score": "0.80611885", "text": "def sign_out\n @current_user = nil\n session.delete(:user_id)\n end", "title": "" }, { "docid": "4fe3c2050b55cb3124b5764143c053f9", "score": "0.80611885", "text": "def sign_out\n @current_user = nil\n session.delete(:user_id)\n end", "title": "" }, { "docid": "efff7b9b3060bb246a48559e0dbae79d", "score": "0.80609345", "text": "def sign_out\n self.current_user = nil\n cookies.delete(:remember_token)\n# cookies.delete(:network_id)\n end", "title": "" }, { "docid": "4fe162ca070f3393aa7cd09fac2976ae", "score": "0.8058508", "text": "def logout!\n current_user.reset_session_token!\n session[:session_token] = nil\n @current_user = nil\n end", "title": "" }, { "docid": "5461477a27271f273de3d9929dce93ec", "score": "0.80575943", "text": "def sign_out\n cookies.delete(:remember_token)\n current_user = nil\n end", "title": "" }, { "docid": "44ebb87fa80863ff3ca13ebdabb66bc1", "score": "0.80558145", "text": "def sign_out\n #cookies.delete(:remember_token)\n session[:user_id] = nil\n self.current_user = nil\n end", "title": "" }, { "docid": "6c0d02d0f265220efd937a5d9e598133", "score": "0.8052896", "text": "def sign_out\n\t\tsession[:user_id] = nil\n\tend", "title": "" }, { "docid": "af0080de6658bb928bc2307a82a02ef4", "score": "0.8050478", "text": "def sign_out\n cookies.delete(:remember_token)\n current_user = nil\n end", "title": "" }, { "docid": "96ce5617fb3414b2dcefdb3c209d29bd", "score": "0.8040502", "text": "def sign_out\n\t\tself.current_user = nil\n\t\tcookies.delete(:remember_token)\n\tend", "title": "" }, { "docid": "96ce5617fb3414b2dcefdb3c209d29bd", "score": "0.8040502", "text": "def sign_out\n\t\tself.current_user = nil\n\t\tcookies.delete(:remember_token)\n\tend", "title": "" }, { "docid": "96ce5617fb3414b2dcefdb3c209d29bd", "score": "0.8040502", "text": "def sign_out\n\t\tself.current_user = nil\n\t\tcookies.delete(:remember_token)\n\tend", "title": "" }, { "docid": "96ce5617fb3414b2dcefdb3c209d29bd", "score": "0.8040502", "text": "def sign_out\n\t\tself.current_user = nil\n\t\tcookies.delete(:remember_token)\n\tend", "title": "" }, { "docid": "96ce5617fb3414b2dcefdb3c209d29bd", "score": "0.8040256", "text": "def sign_out\n\t\tself.current_user = nil\n\t\tcookies.delete(:remember_token)\n\tend", "title": "" }, { "docid": "fa0b9ece21a432f2893d274b64d7c9d0", "score": "0.8035621", "text": "def logout\n current_user.reset_session_token!\n session[:session_token] = nil\n end", "title": "" }, { "docid": "9089b5f449bad8881d6e7a3f11ca1a30", "score": "0.8035346", "text": "def logout()\n current_user.reset_session_token!\n session[:session_token] = nil\n end", "title": "" }, { "docid": "e939bf221505ed5db92acf6afbd4dcc9", "score": "0.8031767", "text": "def sign_out\n \tsession[:user_id] = nil\n end", "title": "" }, { "docid": "e939bf221505ed5db92acf6afbd4dcc9", "score": "0.8031767", "text": "def sign_out\n \tsession[:user_id] = nil\n end", "title": "" }, { "docid": "ff323de7d19d5a096b1948fff5282523", "score": "0.8029721", "text": "def sign_out\n\tcookies.delete(:remember_token)\n\tself.current_user = nil\nend", "title": "" }, { "docid": "1199a659947b6b8b90f115ce7d9da94b", "score": "0.80296683", "text": "def sign_out\n session.sign_out\n end", "title": "" }, { "docid": "f19ef4ff2a965de9fb0ce4a0e939a4c9", "score": "0.80150324", "text": "def sign_out\n self.current_user = nil\n cookies.delete :remember_token\n end", "title": "" }, { "docid": "e0e2ab4b2398cb3e70e14e13e79ecad6", "score": "0.8009554", "text": "def sign_out\n session[:user_id] = nil\n end", "title": "" }, { "docid": "e0e2ab4b2398cb3e70e14e13e79ecad6", "score": "0.8009554", "text": "def sign_out\n session[:user_id] = nil\n end", "title": "" }, { "docid": "b14d3fb06ad2683b0cd4f8a765f0b2b0", "score": "0.8007377", "text": "def sign_out(user)\n reset_session\n @current_user = nil\n end", "title": "" }, { "docid": "2d997c9c6292d813cca9d30f9ca986af", "score": "0.8007105", "text": "def sign_out\n cookies.delete(:user_id)\n @current_user = nil\n end", "title": "" }, { "docid": "6a76763133199bcb7695aaf38bbc232a", "score": "0.798826", "text": "def sign_out\n cookies.delete(:remember_token)\n current_user=nil\n end", "title": "" }, { "docid": "8b526911f502f17e57d666cbbee44282", "score": "0.7984857", "text": "def logout\n current_user.reset_session_token!\n session[:session_token] = nil\n @current_user = nil\n end", "title": "" }, { "docid": "6c2f83af3da1fc7858e2bff427e71407", "score": "0.79801023", "text": "def sign_out\n cookies.delete(:remember_token)\n session.clear\n self.current_user = nil\n end", "title": "" }, { "docid": "d9e298ac62fd63ffd7f6a44f3c291b25", "score": "0.7971325", "text": "def sign_out\n\t\t# Here we are changing the token in the database to a new one so that\n\t\t# you can't use the old token to sign a user in\n\t\tcurrent_user.update_attribute(:remember_token, \n\t\t\tUser.digest(User.new_remember_token))\n\t\t# Remove the cookie from the browser\n\t\tcookies.delete(:remember_token)\n\t\tself.current_user = nil\n\tend", "title": "" }, { "docid": "3a5ec068750bf7ad46df57c1884d4425", "score": "0.79684645", "text": "def log_out\n session[:user_id] = nil\n session[:token] = nil\n end", "title": "" }, { "docid": "51e6f8b7a026ed3191842298710c33ec", "score": "0.7966655", "text": "def sign_out\n\t\tself.current_user = nil\n\t\tcookies.delete(:aregos_user_id)\n\tend", "title": "" }, { "docid": "a159a59e0c30d1beadc64c41f9497608", "score": "0.7962538", "text": "def sign_out\n\t\t#delete user id from hash table\n\t\tsession.delete(:user_id)\n\t\t#set current user to nil\n\t\t@current_user=nil\n\tend", "title": "" }, { "docid": "9833c48203d598e47ee0b2f556f876af", "score": "0.7962291", "text": "def sign_out\n current_user.update_attribute(:remember_token,\n User.digest(User.new_token))\n cookies.delete(:remember_token)\n self.current_user = nil\n end", "title": "" }, { "docid": "2aa063a2a715effc0477d1f5677df812", "score": "0.7959877", "text": "def logout\n cookies.delete(:auth_token)\n session.delete(:user_id) if current_user\n end", "title": "" }, { "docid": "b31b017e72e401feed6a1e32488edd15", "score": "0.79523885", "text": "def log_out! \n current_user.reset_session_token! if current_user\n session[:session_token]= nil\n # @current_user = nil\n end", "title": "" }, { "docid": "56dc96e1bf2cd3cb51c76e6d9a573ba2", "score": "0.7951897", "text": "def sign_out\n # session.delete(:user_id)\n session[:user_id] = nil\n @current_user = nil\n end", "title": "" }, { "docid": "5f1b34d6375cfc187506e6054ac9664f", "score": "0.79496765", "text": "def logout! \n # invalidate the old session token\n current_user.try(:reset_session_token) \n session[:session_token] = nil \n end", "title": "" }, { "docid": "fc76cdf586abf02b6303670cc36edca9", "score": "0.7942937", "text": "def logout! \n # change (reset) the current_user's session token \n current_user.reset_session_token! \n # set :session_token cookie to nil\n session[:session_token] = nil \n # set @current_user instance variable to nil\n @current_user = nil \n end", "title": "" }, { "docid": "a344db8662afe4bc20a9042119853258", "score": "0.794091", "text": "def sign_out\n $signed_in = false\n @current_user = nil\n end", "title": "" } ]
fa5917fcd4d8c9c39d712649480df6cf
Instantiation === Parameters: :admin from :candidates to
[ { "docid": "0bb6c99a2cc61dcf8f3731c988676eef", "score": "0.7841136", "text": "def initialize(admin, candidates)\n @admin = admin\n @candidates = candidates\n @email_index = -1\n end", "title": "" } ]
[ { "docid": "24fc19b9f5a23b5603d93b20179957ff", "score": "0.588829", "text": "def initialize(uid, options={})\n @uid = uid\n @admin_acting_as = options[:admin_acting_as]\n @admin_by_ccns = options[:admin_by_ccns]\n @admin_term_slug = options[:admin_term_slug]\n @canvas_course_id = options[:canvas_course_id]\n end", "title": "" }, { "docid": "7f6e9abea24b65c85349308c98da6b95", "score": "0.5804388", "text": "def initialize(admin_registration)\n @admin_registration = admin_registration\n end", "title": "" }, { "docid": "2feb9e46ca075d572ac1e4376aec2b93", "score": "0.57779175", "text": "def initialize candidate, options = {}\n raise \"Candidate must be something!\" if !candidate\n @candidate, @options = candidate, options\n execute\n end", "title": "" }, { "docid": "d09d2d7cb337142b77d928247068bc2a", "score": "0.57422113", "text": "def initialize(params)\n @anime = Anime.find_by(id: params[:candidate][:source_id])\n @award = Award.find_by(id: params[:candidate][:award_id])\n end", "title": "" }, { "docid": "e50620f0d7473420ae129ac92d50c24a", "score": "0.57101303", "text": "def initialize(user)\n\n # guest user (not logged in) \n user ||= User.new \n\n # Alias to give proper abilities to the owner of his own course and profile\n alias_action :create, :update, :destroy, :mycourses, :myprofil, :to => :cud\n\n # Everyone can read all courses but only the owner can alter it\n can :read, Course\n can :cud, Course, :owner => user.id\n\n # Everyone can read all profiles but only the owner can alter it\n can :read, Profil\n can :cud, Profil, :user_id => user.id\n\n end", "title": "" }, { "docid": "1156e4187489b5e37b5336da027a4e31", "score": "0.5693005", "text": "def initialize(user)\n\n ############################## Household ##############################\n can :administrate, Household do |household|\n user.administrates?(household)\n end\n\n can :add_admin, Household do |household|\n user == household.head_admin\n end\n\n ############################## Completable ##############################\n can :accept, Completable do |todo|\n household = todo.household\n can?(:edit, todo) &&\n todo.completed? &&\n !todo.accepted? &&\n can?(:administrate, household)\n end\n\n can :complete, Completable do |todo|\n household = todo.household\n user.household == household &&\n !todo.completed? &&\n !todo.accepted?\n end\n\n can :destroy, Completable do |todo|\n household = todo.household\n user.household == household &&\n ( can?(:administrate, household) ||\n todo.creator_id == user.id && !todo.accepted?\n )\n end\n\n can :edit, Completable do |todo|\n household = todo.household\n todo.creator_id == user.id || \n can?(:administrate, household)\n end\n\n can :reorder, Completable do |todo|\n can?(:complete, todo) || can?(:uncomplete, todo)\n end\n\n can :uncomplete, Completable do |todo|\n household = todo.household\n user.household == household &&\n !todo.accepted? && \n todo.completed? &&\n (todo.completor_id == user.id || can?(:edit, todo))\n end\n\n end", "title": "" }, { "docid": "7b4ba14590afd09eec3711a1f4ebff86", "score": "0.5670575", "text": "def initialize\r\n super\r\n self.members = Hash.new\r\n self.admins = Hash.new\r\n @member_limits = Hash.new #the remaining limit of each user\r\n self.limit = nil #with limit=nil everybody can spend as much as they want\r\n self.organisation = true\r\n\r\n System.instance.search.register(SearchItemOrganisation.create(self, \"organisation\", [:name, :description]))\r\n end", "title": "" }, { "docid": "5cde301c938ae8e1ecb42e838b8d34a3", "score": "0.56259924", "text": "def initialize(admin = false)\n if (admin)\n @role_array = [ ADMIN ]\n else\n @role_array = [ NORMAL ]\n end\n end", "title": "" }, { "docid": "7650d305cdf8922125b63d2c4015feb9", "score": "0.56093395", "text": "def initialize(*args, **kwargs, &block)\n # @require_admin = (kwargs[:arguments] || {})[:require_admin]\n @require_admin = kwargs.delete(:require_admin)\n super(*args, **kwargs, &block)\n end", "title": "" }, { "docid": "d9f5f64425dbc25c3b576d7dcee8e8d1", "score": "0.556194", "text": "def initialize\n super()\n self.people = self.build_person_list\n end", "title": "" }, { "docid": "128ce25c06a2270caa85cd21141c6a1c", "score": "0.55469424", "text": "def initialize(user)\n\n # Anyone\n allow :sessions, [:new, :create, :destroy]\n allow :circles, :index\n allow :decisions, [:all, :review]\n allow :circle_decisions, :index\n allow :password_resets, [:index, :create, :new, :edit, :update, :show, :destroy]\n\n # If They're logged in\n if user\n allow :users, :show do |user_record|\n user_record == user\n end\n\n # If they're logged in as a super\n if super?(user)\n allow :users, [:index]\n allow [:users, :decisions], [:new, :create, :edit, :update, :destroy]\n allow :circles, [:new, :create, :edit, :update]\n allow :circles, :destroy do |circle|\n circle_has_no_decisions?(circle)\n end\n\n # If they're logged in as a leader\n else\n allow :decisions, :new\n allow :decisions, :create # TODO: Find way to prevent users unassociated with the decisions circles to create decisions. For now, the view only allows them to select associated circles\n allow :decisions, [:edit, :update, :destroy] do |decision|\n circles_user_involved_in = []\n Circle.all.each do |circle|\n role = Role.find_by(circle: circle, user: user)\n unless role.role_type == \"none\"\n circles_user_involved_in.push(circle)\n end\n end\n decision.circle.in?(circles_user_involved_in)\n end\n allow :users, [:edit, :update] do |user_record|\n user_record == user\n end\n allow :users, :destroy do |user_record|\n user_record == user\n end\n end\n end\n end", "title": "" }, { "docid": "d3e747053e62b9779bae502f9bdcaf38", "score": "0.55037737", "text": "def set_city_admin_and_subscription \n @admin = current_admin\n @institute = @admin.institute\n end", "title": "" }, { "docid": "2c7f10f154b29228ad8e84db2bc60fa8", "score": "0.5472215", "text": "def initialize(holder, id)\n super\n # calls the super initialize method of customer account\n @type = :Business\n # sets type to business, this will be used by the accounts controller\n @daily_limit = LIMIT\n # sets the daily limit to LIMIT constant. this will be used to restrict withdrawals\n end", "title": "" }, { "docid": "3600ded7ed4d007c238490b46c8bdc81", "score": "0.5470025", "text": "def initialize(user)\n if user&.admin?\n admin\n elsif user&.viewer?\n viewer\n else\n # If a user was not provided or has no defined role,\n # then the user should not be able to access anything.\n cannot :manage, :all\n end\n end", "title": "" }, { "docid": "3eaf89e5751ed64ba7b409013dfe8a89", "score": "0.5467536", "text": "def initialize(user)\n return unless user\n\n case user.role\n when 'researcher'\n can_acces_rails_admin\n can_do_collection_scoped_actions\n can_do_member_scoped_actions\n when 'super'\n can_acces_rails_admin\n can_do_collection_scoped_actions\n can_do_member_scoped_actions\n end\n end", "title": "" }, { "docid": "1474999a5a44f06a17a5bf2d172d399c", "score": "0.54407054", "text": "def set_candidate\n @candidate = Candidate.find_by id: params[:id]\n authorize @candidate\n end", "title": "" }, { "docid": "c7bfc6bfe6f3c0055588fe4a188836f7", "score": "0.54397607", "text": "def initialize(remote_siblings, owners, model, plan)\n\t super(remote_siblings, owners)\n\t @model, @plan = model, plan\n\tend", "title": "" }, { "docid": "92fb1006988a3298e0d5099f3a15994e", "score": "0.5415484", "text": "def set_candidate\n @candidate = params[:id] ? Candidate.find(params[:id]) : Candidate.new(candidate_params)\n end", "title": "" }, { "docid": "a904c7e86de2fe769caebfd5c7cd0edd", "score": "0.5413356", "text": "def initialize(user)\n user ||= User.new \n if user.user_type == \"Admin\"\n can :manage, :all\n elsif user.user_type == \"Module Lead\"\n can [:read, :edit, :update, :create], [StationResult, CriteriaResult]\n can [:ready_screen, :show, :completed_students, :add_student, :search_new_student, :new_student, :new, :create,:search_students], [StationResult]\n can [:index, :show], [Exam]\n can [:read, :results, :exam_results, :student_result], [StationResult, CriteriaResult, Exam, Station, Criterium, Answer]\n elsif user.user_type == \"Moderator\"\n can [:read,:exam_results,:results, :student_result], [StationResult, CriteriaResult, Exam, Station, Criterium, Answer] \n end\n end", "title": "" }, { "docid": "6f7585ba31f64a1eee6ba16ee812b0ee", "score": "0.5408316", "text": "def create_new_admin\n @provider = Provider.new\n end", "title": "" }, { "docid": "e18d78c4a1cada9718e74f0dc0082e14", "score": "0.5407797", "text": "def initialize(admin)\n raise FphsException, 'Initialization with admin blank is not valid' unless admin\n raise FphsException, 'a valid admin is required' unless admin.is_a?(Admin) && admin.enabled?\n\n self.current_admin = admin\n end", "title": "" }, { "docid": "fdbc58c70b49de0d24ad78d72ff668e2", "score": "0.5404714", "text": "def set_candidate\n \t@election = Candidate.find(params[:id])\n end", "title": "" }, { "docid": "5313d2b4a36707ca503dfbdc2ff1e2f4", "score": "0.53993154", "text": "def initialize(destinations)\n if destinations.is_a?(String)\n @destinations = [destinations]\n else\n @destinations = destinations\n end\n\n @mode = :client\n setup\n end", "title": "" }, { "docid": "22ae247e685cf4bdbb46aa5daa59f7e4", "score": "0.5395966", "text": "def initialize(user)\n authorize_guest(user)\n return if user.nil?\n\n authorize_admin(user)\n end", "title": "" }, { "docid": "5552ac5e47f6f43792268d72f0d70996", "score": "0.5395634", "text": "def initialize(user)\n \n user ||= User.new # guest user will not be allowed in the admin section\n alias_actions\n \n if user.super_admin?\n can :manage, :all\n elsif user.admin? || user.contractor?\n #can :manage, :all\n #can :read, :all\n #can :view_users, User do\n # user.admin?\n #end\n #authorize! :view_users, @user\n #can :create_users, User do\n # user.super_admin?\n #end\n #authorize! :create_users, @user\n #can :create_orders, User\n\n if user.trial || user.unsubscribed\n unless user.unsubscribed \n can [:make], Product if user.products.count < 1\n end\n can [:read, :change], Product, contractor_id: user.id \n else\n can :manage, Product, contractor_id: user.id\n end\n can :manage, Order, contractor_id: user.id\n can :manage, Shipment, order: {contractor_id: user.id}\n can :manage, ImageGroup, product: {contractor_id: user.id}\n can :manage, Property\n can :manage, Invoice\n\n if user.has_balance?\n can :manage, Requests::Balance, user_id: user.id\n can [:read, :make, :cancel], Requests::Transaction, balance_id: user.balance.id\n can :read, Requests::Credit\n can [:read, :make, :cancel], Requests::Withdraw\n can [:read], Requests::Refund, transaksi: {balance_id: user.balance.id} \n end\n\n can :manage, :overview\n end\n end", "title": "" }, { "docid": "819296b268f98653762cbbbf93a1aecc", "score": "0.53817993", "text": "def initialize(args)\n args.symbolize_keys!\n\n @user = args.fetch(:user)\n @admin = args.fetch(:admin)\n end", "title": "" }, { "docid": "25ca2823aaf9c693cf4e47feb99c11bc", "score": "0.5371795", "text": "def initialize(user)\n if not user # or (user.is_gym? and user.subscription.blank?) or (user.is_gym? and user.subscription.stripe_customer_token.blank?)\n# if provisional_user_id\n# can :manage, DoneDealRequest do |action, request|\n# provisional_user_id && request.provisional_user_id.to_s == provisional_user_id\n# end\n# can :manage, CustomDealRequest do |action, request|\n# provisional_user_id && request.provisional_user_id.to_s == provisional_user_id\n# end\n# can :manage, NewDealRequest do |action, request|\n# provisional_user_id && request.provisional_user_id.to_s == provisional_user_id\n# end\n# end\n# can :create, [CustomDealRequest, DoneDealRequest, NewDealRequest]\n# can :read, PressClipping\n# elsif user.is_admin?\n# can :manage, :all\n\n elsif (user.is_trainer?) and (user.subscription.blank? or user.subscription.stripe_customer_token.blank?) and user.trainer.gym.blank?\n # Plans\n ################\n can :index, Plan\n\n # Subscriptions\n ################\n can :create, Subscription\n\n elsif (user.is_gym?) and (user.subscription.blank? or user.subscription.stripe_customer_token.blank?)\n # Plans\n ################\n can :index, Plan\n\n # Subscriptions\n ################\n can :create, Subscription\n\n elsif user # user, non-admin\n# can :manage, :all\n\n # Subscriptions\n ################\n can :manage, Subscription do |action, subscription|\n subscription && (subscription.user == user)\n end\n can :create, Subscription\n# can :index, Subscription\n\n # Plans\n ################\n# can :manage, Plan do |action, plan|\n# plan && (plan.trainer == user.trainer)\n# end\n# can :create, Plan\n unless user.is_trainer? and user.trainer.gym.blank?\n can :index, Plan\n end\n\n # Documents\n ################\n can :manage, Document do |action, document|\n document && (document.trainer == user.trainer)\n end\n can :create, Document\n# can :index, Document\n\n # Trainers\n ################\n can :manage, Trainer do |action, trainer|\n trainer && (trainer.user == user or trainer.gym == user.gym)\n end\n can :create, Trainer\n can :index, Trainer\n\n # Gyms\n ################\n can :manage, Gym do |action, gym|\n gym && (gym.user == user)\n end\n can :create, Gym\n# can :index, Gym\n\n # Users\n ################\n can :manage, User do |action, u|\n u && (u == user)\n end\n can :create, User\n #can :index, User\n\n # Bodycomps\n ################\n can :manage, Bodycomp do |action, bodycomp|\n bodycomp && (bodycomp.client.trainer == user.trainer or bodycomp.client == user.client)\n end\n can :create, Bodycomp\n can :index, Bodycomp\n\n # Clients\n ################\n can :manage, Client do |action, client|\n client && (client.user == user or client.id == user.client_training_id or client.trainer == user.trainer or client.trainer.gym == user.gym)\n end\n can :create, Client\n can :index, Client\n\n # Workout_sessions\n ################\n can :manage, WorkoutSession do |action, workout_session|\n workout_session && (workout_session.user == user or user.client == workout_session.client or workout_session.client.trainer.gym == user.gym or workout_session.client.trainer == user.trainer or user.client_training_id == workout_session.client_id)\n end\n can :create, WorkoutSession\n can :index, WorkoutSession\n\n # Workouts\n ################\n can :manage, Workout do |action, workout|\n workout && (workout.user == user)\n end\n can :create, Workout\n can :index, Workout\n\n # Exercise_sessions\n ################\n can :manage, ExerciseSession do |action, exercise_session|\n exercise_session && (exercise_session.workout_session.user == user)\n end\n can :create, ExerciseSession\n can :index, ExerciseSession\n\n # Exercises\n ################\n can :manage, Exercise do |action, exercise|\n exercise && (exercise.user == user)\n end\n can :create, Exercise\n can :index, Exercise\n can :read, Exercise\n\n # Foodlogs\n ################\n can :manage, Foodlog do |action, foodlog|\n foodlog && (foodlog.client_id == user.client_training_id)\n end\n can :create, Foodlog\n can :index, Foodlog\n\n #SUPERUSER\n ################\n if user.username == \"jeremysenn\"\n can :manage, :all\n end\n end\n end", "title": "" }, { "docid": "dffaec8f314381f4ef92b665e1300d31", "score": "0.5367314", "text": "def initialize(owner)\n @owner = owner\n end", "title": "" }, { "docid": "cfb0a74c1592d85384c55197c332bb42", "score": "0.53409094", "text": "def initialize(user)\r\n alias_action :new, :edit, :create, :update, :destroy, to: :modify\r\n alias_action :new, :create, to: :touch\r\n alias_action :index, :show, to: :read\r\n user ||= User.new # Если не авторизован, то будет новый пользователь с пустыми полями\r\n\r\n #Admin\r\n if user.has_role? :admin\r\n # can :access, :rails_admin # grant access to rails_admin\r\n # can :dashboard # grant access to the dashboard\r\n can :modify, Article\r\n can :read, Article\r\n can :validate, Article\r\n can :read, Menu\r\n can :modify, Menu\r\n can :read, Gallery\r\n can :modify, Gallery\r\n can :del_image, Gallery\r\n can :read, Letter\r\n can :modify, Letter\r\n can :add_director, Letter\r\n # can :read, :all\r\n\r\n # Editor\r\n elsif user.has_role? :manager\r\n can :read, :all\r\n can :touch, Article\r\n can :manage, Article do |g|\r\n g.try(:user_id) == user.id\r\n end\r\n can :touch, Gallery\r\n can :manage, Gallery do |g|\r\n g.try(:user_id) == user.id\r\n end\r\n can :del_image, Gallery do |g|\r\n g.try(:user_id) == user.id\r\n end\r\n\r\n # Guest\r\n else\r\n can :read, Article\r\n can :read, Gallery\r\n end \r\n\r\n end", "title": "" }, { "docid": "64f996885a14f2d41fdc3ab38086bfb2", "score": "0.5338114", "text": "def set_candidates(pv)\n @candidates = pv\n @value = @initial_value\n end", "title": "" }, { "docid": "df0451a1beec7145266454c2010b350f", "score": "0.5332937", "text": "def initialize(user)\n can :create, Project\n can :manage, Project do |project|\n project.users.include?(user)\n end\n\n can :manage, Suggestion do |suggestion|\n suggestion.project.users.include?(user)\n end\n\n can :manage, FieldDefinition do |field|\n field.project.users.include?(user)\n end\n end", "title": "" }, { "docid": "b76c758d282c96d5555e2e194f54ac90", "score": "0.5329154", "text": "def initialize(user)\n # default abilities for anonymous, non-logged-in visitors\n can [:read, :index], [Term, Organization, Course, CourseOffering]\n\n if user\n # This ability allows admins impersonating other users to revert\n # back to their original user.\n can :unimpersonate, User\n\n # Creating an alias for CRUD operations\n alias_action :create, :read, :update, :destroy, to: :crud\n\n # Global admin permissions, placed last override everything\n if user.global_role.id == GlobalRole::ADMINISTRATOR_ID\n can :manage, :all\n else\n\n # A user should only be able to update himself or herself (assuming no\n # other permissions granted below by the global role).\n can [:read, :index], User, User.visible_to_user(user) do |u|\n u == user || u.course_enrollments\n .where('course_role_id != ?', CourseRole::STUDENT_ID).any?\n end\n can [:edit, :update], User, id: user.id\n\n process_global_role user\n process_instructor user\n process_researcher user\n process_courses user\n end\n end\n end", "title": "" }, { "docid": "cfbdc53f6f24a603335a9b641c869a08", "score": "0.5322382", "text": "def initialize(user)\n #anyone can read anything, it's an encyclopedia, right?\n can :read, :all\n\n #if user isn't signed in, there are no more permissions for them\n return if user.nil?\n\n if user.dictator?\n can :manage, :all # they can do anything they want\n can :access, :rails_admin # grant access to rails_admin\n can :dashboard # ditto\n else\n #if they're not a dictator, they're a \"contributor\" and they can only\n #modify the following db objects\n can [:create, :update], [Page, Prerequisite, ConceptBundle, Question, Answer]\n end\n \n end", "title": "" }, { "docid": "255ddbed6213e2f6a7cff99ab2c7c820", "score": "0.53220636", "text": "def initialize(user)\n # Define abilities for the passed in user here. For example:\n #\n user ||= User.new # guest user (not logged in)\n # if user.admin?\n # can :manage, :all\n # else\n # can :read, :all\n # end\n #\n # The first argument to `can` is the action you are giving the user\n # permission to do.\n # If you pass :manage it will apply to every action. Other common actions\n # here are :read, :create, :update and :destroy.\n #\n # The second argument is the resource the user can perform the action on.\n # If you pass :all it will apply to every resource. Otherwise pass a Ruby\n # class of the resource.\n #\n # The third argument is an optional hash of conditions to further filter the\n # objects.\n # For example, here the user can only update published articles.\n #\n # can :update, Article, :published => true\n #\n # See the wiki for details:\n # https://github.com/CanCanCommunity/cancancan/wiki/Defining-Abilities\n\n\n # To define a permission for a user, use the 'can' method inside\n # of this classes, initialize method. It takes the following args\n # (in order):\n # - The name of the action you are testing for as a symbol\n # - The class of an object we are testing against.\n # - A block that is used to determine whether or not a user can perform said action\n \n # If the block returns true, the user can perform the action, otherwise they can't\n\n if user.is_admin?\n can :manage, :all \n # manage means they can do everything (not just CRUD)\n end\n\n alias_action :create, :read, :edit, :update, :destroy, to: :crud\n\n can :crud, Question do |question|\n question.user == user\n end\n\n # We can also write abilities like:\n # can :crud, Question, use_id: user.id\n\n can :crud, Answer do |answer|\n answer.user == user\n end\n\n can :crud, JobPost do |job_post|\n job_post.user == user\n # check that if it matched\n end\n\n can :like, Question do |question|\n user.persisted? && user != question.user\n end\n\n can :destroy, Like do |like|\n like.user == user\n end\n end", "title": "" }, { "docid": "ab74dc66fde558285e6a9cf69d2fabd5", "score": "0.5315021", "text": "def set_candidate\n @candidate = Candidate.find(params[:id])\n end", "title": "" }, { "docid": "31bd3abfcb00972783e4e76f32ad7949", "score": "0.5301344", "text": "def set_admin_institute\n @admin = Admin.friendly.find(params[:admin_id])\n @institute = Institute.friendly.find(params[:institute_id])\n end", "title": "" }, { "docid": "89110e1b62c4c365f764eb4156bbc9c9", "score": "0.53005517", "text": "def initialize(owner_id)\n @owner=owner_id\n end", "title": "" }, { "docid": "8e7f401755206018fce05a61976a0fe2", "score": "0.52948517", "text": "def initialize(user)\n unless user\n can [:new, :create, :sign_in, :sign_up, :check_username, :check_email, :check_run, :log], [Producer, User]\n cannot [:new, :destroy, :update], Event \n can [:show, :index, :search, :siete_dias_app, :patrocinados_app, :buscar_app, :lista_app, :view_app], Event \n\t cannot [:account, :edit, :destroy, :update], [Producer, User]\n can [:geo], City\n can [:view_app, :check_app], Ticket\n #can :manage, :all#comentar esto si se quiere quitar permiso admin \n else\n if user.has_role? :normal\n can :manage, User\n can [:new, :create, :sign_in, :sign_up, :check_username, :check_email, :check_run, :log], [Producer]\n cannot [:account, :edit, :destroy, :update], Producer\n cannot [:new, :destroy, :update], Event \n can [:show, :index, :search, :detail], Event \n can [:ticket_free, :result_free, :result], Transaction\n can [:view_app, :check_app, :index, :pdf, :render_pdf], Ticket\n #can :manage, :all# esto si se quiere quitar permiso admin \n end\n end\n end", "title": "" }, { "docid": "3faec0894659154998109b5ec660cbc4", "score": "0.5288438", "text": "def initialize(*)\n super\n @relation = relation.public_send(restriction) if options.fetch(:initial)\n end", "title": "" }, { "docid": "267fb69c8cf37c359c1ed3d886d34a8a", "score": "0.5284387", "text": "def initialize(client, user1, user2, publicvisible: nil)\n super(client)\n @user1 = if user1.is_a?(CoachClient::User)\n user1\n else\n CoachClient::User.new(client, user1)\n end\n @user2 = if user2.is_a?(CoachClient::User)\n user2\n else\n CoachClient::User.new(client, user2)\n end\n @publicvisible = publicvisible\n end", "title": "" }, { "docid": "0e1358ffc1c5e9b81dc2e467994caa04", "score": "0.52780473", "text": "def partners\n end", "title": "" }, { "docid": "3506dd2ae7665f888927710a2beb318c", "score": "0.52728814", "text": "def with_candidates &b\n # Multiple assignment reduces (s)teps while debugging\n outermost, @candidates, @on_admission = @candidates.nil?, (@candidates || []), (@on_admission || [])\n begin\n b.call\n rescue Exception\n # Do not accept any of these candidates, there was a problem:\n @candidates = [] if outermost\n raise\n ensure\n if outermost\n while @candidates\n # Index the accepted instances in the constellation:\n candidates = @candidates\n on_admission = @on_admission\n @candidates = nil\n @on_admission = nil\n candidates.each do |instance|\n instance.class.index_instance(self, instance)\n loggers.each{|l| l.call(:assert, instance.class, instance.identifying_role_values)}\n end\n on_admission.each do |b|\n b.call\n end\n end\n end\n end\n end", "title": "" }, { "docid": "71a885fc853dd1d0924512a449f36804", "score": "0.52722037", "text": "def set_candidate\n @candidate = Candidate.find(params[:id])\n end", "title": "" }, { "docid": "71a885fc853dd1d0924512a449f36804", "score": "0.52722037", "text": "def set_candidate\n @candidate = Candidate.find(params[:id])\n end", "title": "" }, { "docid": "71a885fc853dd1d0924512a449f36804", "score": "0.52722037", "text": "def set_candidate\n @candidate = Candidate.find(params[:id])\n end", "title": "" }, { "docid": "71a885fc853dd1d0924512a449f36804", "score": "0.52722037", "text": "def set_candidate\n @candidate = Candidate.find(params[:id])\n end", "title": "" }, { "docid": "71a885fc853dd1d0924512a449f36804", "score": "0.52722037", "text": "def set_candidate\n @candidate = Candidate.find(params[:id])\n end", "title": "" }, { "docid": "71a885fc853dd1d0924512a449f36804", "score": "0.52722037", "text": "def set_candidate\n @candidate = Candidate.find(params[:id])\n end", "title": "" }, { "docid": "71a885fc853dd1d0924512a449f36804", "score": "0.52722037", "text": "def set_candidate\n @candidate = Candidate.find(params[:id])\n end", "title": "" }, { "docid": "71a885fc853dd1d0924512a449f36804", "score": "0.52722037", "text": "def set_candidate\n @candidate = Candidate.find(params[:id])\n end", "title": "" }, { "docid": "71a885fc853dd1d0924512a449f36804", "score": "0.52722037", "text": "def set_candidate\n @candidate = Candidate.find(params[:id])\n end", "title": "" }, { "docid": "71a885fc853dd1d0924512a449f36804", "score": "0.52722037", "text": "def set_candidate\n @candidate = Candidate.find(params[:id])\n end", "title": "" }, { "docid": "71a885fc853dd1d0924512a449f36804", "score": "0.52722037", "text": "def set_candidate\n @candidate = Candidate.find(params[:id])\n end", "title": "" }, { "docid": "71a885fc853dd1d0924512a449f36804", "score": "0.52722037", "text": "def set_candidate\n @candidate = Candidate.find(params[:id])\n end", "title": "" }, { "docid": "a9eebc487e8c56eeddecb99f2b177ae2", "score": "0.52712053", "text": "def create_personalization(candidate, sg_mail, admin, *subs)\n personalization = SendGrid::Personalization.new\n if admin.nil? # unless test email\n sheet = candidate.candidate_sheet\n used = ['stmm.confirmation@kristoffs.com']\n converted_emails = convert_emails([sheet.to_email, sheet.cc_email, sheet.cc_email_2], used)\n personalization.add_to(SendGrid::Email.new(email: converted_emails[0], name: \"#{sheet.first_name} #{sheet.last_name}\"))\n personalization.add_cc(SendGrid::Email.new(email: converted_emails[1])) unless converted_emails[1].nil?\n personalization.add_cc(SendGrid::Email.new(email: converted_emails[2])) unless converted_emails[2].nil?\n bcc_sg = SendGrid::Email.new(email: @admin.email, name: \"#{Visitor.home_parish} Confirmation\")\n personalization.add_bcc(bcc_sg) unless duplicate?(personalization, bcc_sg)\n else\n personalization.add_to(SendGrid::Email.new(email: admin.email, name: \"#{Visitor.home_parish} Confirmation\"))\n end\n subs.each { |sub| personalization.add_substitution(sub) }\n sg_mail.add_personalization(personalization)\n personalization\n end", "title": "" }, { "docid": "0d779461609fc4cedfe275880e588e54", "score": "0.5267135", "text": "def initialize(user)\n\n if user.present?\n\n # Cache repeated queries\n user_id = user.id\n admin = user.admin?\n supervisor = user.supervisor?\n reviewer = user.reviewer?\n\n can(:manage, :all) if admin\n\n # Address\n can [:create, :show], Address\n\n # Contact\n can :create, Contact\n\n # Delivery\n can [:create, :show, :update], Delivery\n\n # Item\n can [:index, :show, :create, :update], Item, offer: { created_by_id: user_id }\n can [:index, :show, :create, :update], Item if reviewer or supervisor\n can :destroy, Item, offer: { created_by_id: user_id }, state: 'draft'\n can :destroy, Item, state: 'draft' if reviewer\n can :destroy, Item if supervisor\n\n # Image (same as item permissions)\n can [:index, :show, :create, :update], Image, parent: { offer: { created_by_id: user_id } }\n can [:index, :show, :create, :update], Image if reviewer or supervisor\n can :destroy, Image, parent: { offer: { created_by_id: user_id }, state: 'draft' }\n can :destroy, Image, parent: { state: 'draft' } if reviewer\n can :destroy, Image if supervisor\n\n # Message (recipient and sender and admins, not user if private is true)\n can [:index, :show, :create, :update, :destroy], Message if supervisor\n can [:index, :show, :create], Message if reviewer\n can [:index, :show, :create], Message, sender_id: user_id, is_private: false\n can [:index, :show, :create], Message, recipient_id: user_id, is_private: false\n can [:mark_read], Message, id: user.subscriptions.pluck(:message_id)\n\n # Offer\n can :create, Offer\n can [:index, :show, :update], Offer, created_by_id: user_id\n can [:index, :show, :update], Offer if reviewer or supervisor\n can :destroy, Offer, created_by_id: user_id, state: ['draft', 'submitted']\n can :destroy, Offer, state: 'draft' if reviewer\n can :destroy, Offer if supervisor\n can :review, Offer if reviewer or supervisor\n\n # Package (same as item permissions)\n can [:index, :show, :create, :update], Package, item: { offer: { created_by_id: user_id } }\n can [:index, :show, :create, :update], Package if reviewer or supervisor\n can :destroy, Package, item: { offer: { created_by_id: user_id }, state: 'draft' }\n can :destroy, Package, item: { state: 'draft' } if reviewer\n can :destroy, Package if supervisor\n\n # Schedule\n can :create, Schedule\n\n # User\n can [:show, :update], User, id: user_id\n can [:index, :show, :update], User if reviewer or supervisor\n\n # Taxonomies\n can [:index, :show], DonorCondition\n can [:index, :show], ItemType\n can [:index, :show], RejectionReason\n\n end\n\n # Anonymous and all users\n can [:index, :show], District\n can [:index, :show], Territory\n can [:index, :show, :availableTimeSlots], Schedule\n end", "title": "" }, { "docid": "45cda3769d3b4aa8b4f2abb3da4a93d2", "score": "0.5265301", "text": "def set_candidate\n @candidate = Candidate.find(params[:id])\n end", "title": "" }, { "docid": "45cda3769d3b4aa8b4f2abb3da4a93d2", "score": "0.5265301", "text": "def set_candidate\n @candidate = Candidate.find(params[:id])\n end", "title": "" }, { "docid": "24233f60afca1bfb184809f56c4f5d7f", "score": "0.52599394", "text": "def initialize(*args) # * is a splat operator\n #instance variable for email set to argument 0\n @email = args[0]\n @name = args[1]\n @permissions = User.permissions_from_template\n end", "title": "" }, { "docid": "ad49bac7eb3bc71b3fa42e6696ef8777", "score": "0.5259883", "text": "def initialize(user)\n if user.admin?\n can :manage, :all\n else\n can :read, :all\n can :sync_with_zendesk, :all\n can :sync_with_app, :all\n end\n end", "title": "" }, { "docid": "e081869ef06f762dcfee27fcd9aa5c56", "score": "0.5258496", "text": "def set_admins_election_result\n @admins_election_result = Admins::ElectionResult.find(params[:id])\n end", "title": "" }, { "docid": "ce814222674a4c73a5f8b14bc7255087", "score": "0.5251174", "text": "def initialize(user)\n\t\tuser ||= User.new # guest user\n\t\t\n\t\tif user.role? \"Super Administrator\"\n\t\t\tcan :manage, :all\n\t\t\tcannot :manage, Role, :name => \"Super Administrator\"\n\t\t\tcannot :view, User do |other_user|\n\t\t\t\tother_user.role? \"Super Administrator\" and other_user!=user\n\t\t\tend\n\t\t\tcannot :disable_users, User do |other_user|\n\t\t\t\tother_user==user\n\t\t\tend\n\t\tend\n\n\t\tif user.role? \"User Administrator\"\n\t\t\tcan :manage, User \n\t\t\tcannot :disable_users, User\n\t\t\tcan :manage, Role\n\t\t\tcannot :manage, Role, :name => \"Super Administrator\"\n\t\t\tcannot [:view], User do |other_user|\n\t\t\t\tother_user.role? \"Super Administrator\"\n\t\t\tend\n\t\tend\t\n\t\t\n\t\tif user.role? \"Province Manager\"\n\t\t\tcan :view_compliance_reports, District\n\t\t\tcan :view_indicators_reports, :all\n\t\tend\t\n\t\t\n\t\tif user.role? \"District Manager\"\n\t\t\tcan :view_compliance_reports, District, :id => user.district_ids\n\t\t\tcan :view_indicators_reports, District, :id => user.district_ids\n\t\tend\t\n\t\t\n\tend", "title": "" }, { "docid": "68b0125092dfbad04cc09c571a9aa114", "score": "0.52488637", "text": "def initialize(user)\n\n # The first argument to `can` is the action you are giving the user\n # permission to do.\n # If you pass :manage it will apply to every action. Other common actions\n # here are :read, :create, :update and :destroy.\n #\n # The second argument is the resource the user can perform the action on.\n # If you pass :all it will apply to every resource. Otherwise pass a Ruby\n # class of the resource.\n #\n # The third argument is an optional hash of conditions to further filter the\n # objects.\n # For example, here the user can only update published articles.\n #\n # can :update, Article, :published => true\n #\n # See the wiki for details:\n # https://github.com/CanCanCommunity/cancancan/wiki/Defining-Abilities\n\n user ||= User.new\n\n # we don't do role inheritance b/c I have a sneaking feeling we\n # will want more fine-grained control for our roles as the system\n # grows.\n\n\n if ['contributor', 'editor', 'super_editor', 'admin'].member? user.role\n can [:edit, :update, :show], :all, :created_by_id => user.id\n can :create, DericciLink\n\n can :destroy, [Comment, Reply], :created_by_id => user.id\n cannot :manage, Page\n\n can :link, :all\n can :unlink, :all, :created_by_id => user.id\n can :history, :all\n\n can [:index, :new], DericciGame\n can :index, [Entry, Source, Manuscript, Comment]\n\n can :manage, PrivateMessage, :created_by_id => user.id\n can :manage, PrivateMessage do |pm|\n pm.users.include? user\n end\n can :manage, Rating\n cannot [:import, :upload], Entry\n end\n\n if ['editor', 'super_editor', 'admin'].member? user.role\n can :unlink, :all\n can :edit, Manuscript\n can :manage, DericciRecord\n\n cannot :deprecate, :all\n can :manage, Name\n cannot :review, Name\n # this needs to be RE-Established, since it has been overriden by line 51\n can :edit, :all, :created_by_id => user.id\n cannot :manage, Page\n end\n\n if ['super_editor'].member? user.role\n # allow super-editors to edit legacy records\n can [:edit, :update, :verify, :deprecate], Entry, :unverified_legacy_record => true\n can [:edit, :update], Source, :legacy => true\n can :manage, Place\n can :manage, Language\n end\n\n if ['admin'].member? user.role\n can :manage, :all\n can :update_type, Source\n end\n\n can [:edit, :update], Entry, contributors: { :id => user.id }\n cannot :manage, [Group]\n can [:edit, :update, :destroy], Group, admin: { :id => user.id }\n can [:destroy], Entry, {created_by_id: user.id, draft: true}\n\n can :show, Entry\n cannot :show, Entry do |entry|\n (entry.created_by != user && !entry.contributors.include?(user)) && entry.draft\n end\n end", "title": "" }, { "docid": "396443be364ee22b8894ef55f90525f5", "score": "0.52486205", "text": "def initialize(user)\n user ||= User.new # guest user (not logged in)\n\n can :manage, Comment, :user_id => user.id\n\n if user.admin?\n can :manage, Post\n can :manage, Poll\n can :manage, Comment\n elsif user.writer?\n can :manage, Post\n else\n can :read, Post\n can :read, Comment\n end\n\n \n \n end", "title": "" }, { "docid": "c30eabb16b6f0c77359ff5a6f01e5f25", "score": "0.52471656", "text": "def initialize(owner_class, *args, &block); end", "title": "" }, { "docid": "cfe4b7da6c8eb37dbfcfa516ee315203", "score": "0.5245424", "text": "def initialize(user)\n user ||= User.new\n alias_action :claim, :fill, :unclaim, :insert_coins, :return_coins, :start, :remove_clothes, :to => :use\n if user.admin?\n can :manage, :all\n elsif user.new_record?\n can :read, :all\n else\n can :use, [Washer, Dryer], user: user\n can :use, [Washer, Dryer], state: \"available\"\n can :use, MachineDecorator, state: \"available\"\n can :use, MachineDecorator, user: user\n can :manage, Load, user: user\n can :manage, LoadDecorator, user: user\n can :read, :all\n end\n end", "title": "" }, { "docid": "0b9e2c149cdb233c1bc5cebb1d30ef1b", "score": "0.52435917", "text": "def initialize( *args )\n\t\t@dir = Treequel.directory\n\t\t@people = @dir.ou( :people )\n\n\t\tsuper\n\tend", "title": "" }, { "docid": "458b1c94d07707977b73ced0f7008a73", "score": "0.5241954", "text": "def create\n @candidate = Candidate.new(params[:candidate])\n\n if @candidate.save\n redirect_to admin_candidates_path, notice: 'Candidate was successfully created.'\n else\n render action: \"new\"\n end\n end", "title": "" }, { "docid": "6adeb7e5c4da5f1ad38af8b8f546c394", "score": "0.5238985", "text": "def initialize(bot:, user:)\n super\n @settings = user.student_settings\n end", "title": "" }, { "docid": "f0b4c9901387bd16a1c4bb82e788c178", "score": "0.5229776", "text": "def initialize(candidate, promotions)\n @for_sku = {}\n @candidate = candidate\n super(promotions.map {|p| Promotions::Decorator.new(p)})\n end", "title": "" }, { "docid": "bc959441b22a63f8f0d09f08dc8e995a", "score": "0.52235913", "text": "def initialize(params = {})\n @user_collection = ::Spree::User.all\n @options = params\n end", "title": "" }, { "docid": "e44db5c9e66dab900fe8872969f60c38", "score": "0.5216997", "text": "def initialize(user)\n return unless user.persisted?\n\n if user.class == AdminUser\n return unless user.role&.board_accessible?\n can :read, ActiveAdmin::Page, name: 'Dashboard', namespace_name: 'admin'\n can :read, CodeSchool\n can :read, Location\n can :read, Service\n can :read, TeamMember\n can :read, User\n can [:read, :update], AdminUser, id: user.id\n\n return unless user.role&.admin_accessible?\n can :read, :all\n can :manage, CodeSchool\n can :manage, Location\n can :manage, Service\n can :manage, TeamMember\n\n return unless user.role&.super_admin?\n can :manage, :all\n else\n return unless user.mentor?\n can :read, Request\n end\n end", "title": "" }, { "docid": "de2ec36ab6d796565f6b7f2e15757448", "score": "0.520684", "text": "def initialize(user)\n user ||= User.new # guest user (not logged in)\n if user.admin?\n \t# The can method is used to define permissions. The first one is the action you're setting the permission for and the second one is the class of object you're setting it on.\n can:manage, :all\n else\n\t # action to the argument can. :manage matches any action on the User controller, meaning any user can manage (perform any action) with a User object. \n\t can :manage, User, id: user.id\n end\n end", "title": "" }, { "docid": "f9dcbefdc5c38363ba5900d9f56abfc7", "score": "0.52018315", "text": "def create\n create_admin if params[:admin]\n raise(\"unknown params resourse: #{params}\") unless params[:admin]\n end", "title": "" }, { "docid": "b7543b1a7abedfeea79ea0112ca871bf", "score": "0.5199126", "text": "def new\n \t@admin = Admin.new\n end", "title": "" }, { "docid": "d934bd2fb794dc01710b974059170cb1", "score": "0.51985157", "text": "def initialize(edition, actor)\n self.edition = edition\n self.actor = actor\n end", "title": "" }, { "docid": "94926aaa61bf4c2ddbcc5e30b9839e9c", "score": "0.5190391", "text": "def setup\n @admin = users(:admin)\n @user = users(:user)\n @user2 = users(:user2)\n @user3 = users(:user3)\n @user4 = users(:user4)\n @user5 = users(:user5) #資料不完整的使用者\n @instance = instances(:instance_teaming)\n end", "title": "" }, { "docid": "8a43fee97d0c59d464222d3d2e22a8b9", "score": "0.5184531", "text": "def initialize(options={})\n super\n @to_account = options[:to_account] || @from_account\n @accounts = set_accounts\n end", "title": "" }, { "docid": "f9ce9ddbcb058c33b3ee90cb1c9a0ee6", "score": "0.5184169", "text": "def set_admin_neighbour\n @admin_neighbour = Admin::Neighbour.find(params[:id])\n end", "title": "" }, { "docid": "1dd226aac3ee8b66d83f7efa270a566b", "score": "0.5183256", "text": "def initialize(pick_up, drop_off, distance, cost, driver, passenger)\n @pick_up = pick_up\n @drop_off = drop_off\n @distance = distance\n @cost = cost\n\n # ⭐️ belongs to driver\n @driver = driver\n\n # ⭐️ belongs to passenger\n @passenger = passenger\n\n @@all << self\n end", "title": "" }, { "docid": "282864718591556717e5353635b692d9", "score": "0.5176812", "text": "def initialize(user)\n return unless user.present?\n\n if user.student? or user.teacher?\n # Students and teachers can read and pin projects\n can [:read, :pinned], Project\n can :manage, Pin, user: user\n\n # Stduent and teachers can read resources\n can :read, Resource\n # Stduent and teachers can manage their own resources\n can :manage, Resource, user: user\n end\n\n if user.teacher?\n # Teachers can do anything they want\n can :manage, :all\n end\n end", "title": "" }, { "docid": "fae10d907450b1ae3ff553a54f7ea1bf", "score": "0.51760143", "text": "def initialize(contenders)\n @contenders = contenders\n @referee = Referee.new\n end", "title": "" }, { "docid": "84e22eebbfcb3fe2ec28097b37549c56", "score": "0.517213", "text": "def initialize(remote_siblings, owners, model, plan, arguments, data, flags)\n\t\tsuper(remote_siblings, owners, model, plan)\n\t\t@arguments, @data, @flags = arguments, data, flags\n\t end", "title": "" }, { "docid": "e1ef76dda8d5d860dc4271b82eadf699", "score": "0.5158006", "text": "def set_admin_neighbourhood\n @admin_neighbourhood = Admin::Neighbourhood.find(params[:id])\n end", "title": "" }, { "docid": "b920dedb41c44559ae3e2529ae10017e", "score": "0.5156208", "text": "def initialize(descriptions)\n @descriptions = descriptions\n end", "title": "" }, { "docid": "4894ed84c29521029b5cb285619744bd", "score": "0.5153089", "text": "def setup\n @admin = users(:admin)\n @user = users(:user)\n @user2 = users(:user2)\n @user3 = users(:user3)\n @user4 = users(:user4)\n @instance = instances(:instance_teaming)\n @invitation = invitations(:invitation1)\n end", "title": "" }, { "docid": "d88825898c6b9898e549cc4320aeaf0a", "score": "0.5150461", "text": "def initialize\n \n end", "title": "" }, { "docid": "43adcba10778bb39dcf2f0bc4e86fd92", "score": "0.514539", "text": "def set_candidate\n @candidate = Candidate.find(params[:candidate_id])\n end", "title": "" }, { "docid": "43adcba10778bb39dcf2f0bc4e86fd92", "score": "0.514539", "text": "def set_candidate\n @candidate = Candidate.find(params[:candidate_id])\n end", "title": "" }, { "docid": "43adcba10778bb39dcf2f0bc4e86fd92", "score": "0.514539", "text": "def set_candidate\n @candidate = Candidate.find(params[:candidate_id])\n end", "title": "" }, { "docid": "021b95163032d4c9043982f6d79ceefb", "score": "0.5142797", "text": "def initialize\n super\n @strategy = :user\n end", "title": "" }, { "docid": "cd39ad56669746bfbebd79621bdb809d", "score": "0.51424193", "text": "def initialize(user)\n if user.role == \"member\"\n can :index, :all\n can :create, :all\n cannot :index, Passenger\n #cannot :index, Home\n # Jeder Member kann jede Übersicht außer der Übersicht der User sehen\n # und kann alle Elemente erstellen\n can [:show, :update, :destroy], Car do |car|\n car && car.user == user \n end\n can :show, user.get_visible_cars\n # Member können eigene Autos erstellen, editieren und zerstören und alle eigenen und bei teilzunehmenden Fahrten genutzten Autos anschauen \n can [:outbox, :show, :update], Message do |message|\n message && message.writer == user\n end\n can [:show, :update], Message do |message|\n message && message.receiver == user\n end\n cannot [:edit], Message do |message|\n message && message.receiver == user\n end\n # Member können alle mit ihnen in Verbindung stehenden Messages lesen und editieren\n can [:show, :update, :destroy], Request do |request|\n request && request.user == user\n end\n # Member haben kompletten Zugriff auf die eigenen Anfragen\n can :show, Trip\n can [:update, :destroy], Trip do |trip|\n trip && trip.user == user\n end\n # Member können alle Fahrten sehen, jedoch nur die eigenen verändern\n can [:update, :destroy], Rating do |rating|\n rating && rating.author == user\n end\n # Member können nur selbstgeschriebene Ratings verändern\n can :show, user.get_visible_users\n can [:show, :update, :destroy], User do |user1|\n user1 && user1 == user\n end\n # Member können alle User sehen mit denen sie eine Fahrt antreten wollen und ihren eigenen Account verändern\n\n # Rechte der Member\n elsif user.role == \"admin\"\n can :manage, :all\n # Der Admin hat vollständige Zugriffsrechte\n end\n end", "title": "" }, { "docid": "58f0723ab9404e553eb8c513d61b7733", "score": "0.5138634", "text": "def initialize(*args)\n @name = args[0]\n @email = args[1]\n @permissions = User.permissions_from_template\n end", "title": "" }, { "docid": "58f0723ab9404e553eb8c513d61b7733", "score": "0.5138634", "text": "def initialize(*args)\n @name = args[0]\n @email = args[1]\n @permissions = User.permissions_from_template\n end", "title": "" }, { "docid": "4d6c3434c223f1eba8bc3879939efc71", "score": "0.512813", "text": "def initialize(abilities)\n @abilities = abilities\n end", "title": "" }, { "docid": "93cedf63d5abeef42d6a3aa9d6be4a6a", "score": "0.5123478", "text": "def initialize\n @lister = Lister.new\n end", "title": "" }, { "docid": "e03dd9ac12c0b23444d02f7ac3555bb9", "score": "0.5123291", "text": "def initialize(criteria)\n @criteria = criteria\n if klass.hereditary? && !criteria.selector.keys.include?(:_type)\n @criteria = criteria.in(:_type => criteria.klass._types)\n end\n @criteria.enslave if klass.enslaved?\n @criteria.cache if klass.cached?\n end", "title": "" }, { "docid": "0184ab1d2c5e5c963be7df23413bb967", "score": "0.5122382", "text": "def initialize(user)\n if user.role == 'SuperAdmin'\n can :manage, :all\n elsif user.role == 'ChartedAccountant'\n can [:read, :create, :update], :all\n elsif user.role == 'Party'\n can [:read, :create, :update], :all\n end\n end", "title": "" }, { "docid": "3e5f87c326de01245591a5d97199f2f7", "score": "0.51171017", "text": "def initialize(args)\n\t\t\tif args[:superadmin] == true\n\t\t\t\tskin = {host: args[:host],skin: args[:skin]}\n\t\t\t\t@superadmin = OUApi::Superadmin.new(skin) \t\t\t\n\t\t\t\tparams = {accounts:args[:account],site:args[:site],user:args[:user]}\n\t\t\t\t@superadmin.default_account(params)\n\t\t\t\tsettings = site_settings(args)\n\t\t\telse\n\t\t\t\tsettings = args\n\t\t\tend\n\t\t\t@user = OUApi::User.new(settings)\n\t\tend", "title": "" }, { "docid": "ff20821a9a3ea191d9796cf04ffafd1c", "score": "0.51075566", "text": "def initialize(member)\n member ||= Member.new # guest user (not logged in)\n\n can :manage, :all if member.holds_position? 'Webmaster'\n can :update, Member if member.holds_position? 'Membership Officer'\n\n committee_permissions if member.committee?\n member_permissions(member) if member.persisted?\n guest_permissions\n end", "title": "" } ]
d7ebd1f1b4c6559eade7bd2e34d56490
HARD Define a method that accepts an array of words and returns an array of those words whose vowels appear in order. You may wish to write a helper method: ordered_vowel_word?
[ { "docid": "f564e19602b19016c7ff854d28e7976b", "score": "0.8518763", "text": "def ordered_vowel_words(words)\n words.select {|word| ordered_vowel_word?(word)}\nend", "title": "" } ]
[ { "docid": "8b5c359d42ed318c30a6f5e7f8e70265", "score": "0.88117325", "text": "def ordered_vowel_words(words)\n result = Array.new\n words.each do |el|\n if ordered_vowel_word?(el)\n result << el\n end\n end\n result\nend", "title": "" }, { "docid": "800531538b8c06371925a6a8e205344c", "score": "0.88066506", "text": "def ordered_vowels(words)\n ret = []\n words.each { |word| ret << word if ordered_vowel_word?(word) }\n ret\nend", "title": "" }, { "docid": "1d8c3c20ad8d81c1e46cf5f97e4aec5c", "score": "0.8772758", "text": "def ordered_vowels(words)\n finalArray = []\n words.each do |word|\n if ordered_vowel_word?(word)\n finalArray.push(word)\n end\n end\n return finalArray\nend", "title": "" }, { "docid": "bcf537c8805811e807cf64023995c0e7", "score": "0.8709135", "text": "def ordered_vowels(words)\n in_order = []\n words.each do |word|\n in_order << word if ordered_vowel_word?(word)\n end\n\n in_order\nend", "title": "" }, { "docid": "184b749e775b5295490480dc93357a85", "score": "0.8604387", "text": "def ordered_vowels(words)\n words.select { |el| ordered_vowel_word?(el) }\nend", "title": "" }, { "docid": "5b12c32bf51137b7d61d0a0da1f7f3fd", "score": "0.85761726", "text": "def ordered_vowels(words)\n words.select do |word|\n ordered_vowel_word?(word)\n end\nend", "title": "" }, { "docid": "5b12c32bf51137b7d61d0a0da1f7f3fd", "score": "0.85761726", "text": "def ordered_vowels(words)\n words.select do |word|\n ordered_vowel_word?(word)\n end\nend", "title": "" }, { "docid": "1f868b29391c22dcf360692060d22618", "score": "0.8502725", "text": "def ordered_vowel_words(words)\n words.select{|word| ordered_vowel_word?(word)}\nend", "title": "" }, { "docid": "7fdca55e124f24300d7972befa3e43be", "score": "0.84874636", "text": "def ordered_vowel_words(words)\n words.select {|word| ordered_vowel_word?(word)}\nend", "title": "" }, { "docid": "0c8db3c9cb90484ac4369a6bb2e90399", "score": "0.8438813", "text": "def ordered_vowel_words(words)\n words.reduce([]) do |ord_vowels, curr_word|\n if ordered_vowel_word?(curr_word) == true\n ord_vowels << curr_word\n else\n ord_vowels\n end\n end\nend", "title": "" }, { "docid": "86d0a95ef8e167927a4da5c7e937806e", "score": "0.83381003", "text": "def ordered_vowels(words)\nend", "title": "" }, { "docid": "defeaf60c5a2ace8e7a4a9572f0afe68", "score": "0.83200955", "text": "def ordered_vowel_words(words)\nend", "title": "" }, { "docid": "21a4d21f20f18601806767927178f8b8", "score": "0.82585454", "text": "def ordered_vowels(words)\n words.select { |w| extract_vowels(w).split(\"\") == extract_vowels(w).split(\"\").sort }\nend", "title": "" }, { "docid": "b8f3e813803fecf6c544f95c5662430e", "score": "0.80545974", "text": "def ordered_vowel_word?(word)\n vowels = \"aeiou\"\n word_arr = word.split(\"\")\n\n word_arr.select! do |letter|\n vowels.include?(letter) \n end\n word_arr == word_arr.sort\nend", "title": "" }, { "docid": "2e4358e0d679ece14da9bd284fea8caa", "score": "0.7929637", "text": "def ordered_vowel_words(str)\n word_arr = []\n str.downcase.split(\" \").each do |tester|\n word_arr << tester if ordered_vowel_word?(tester)\n end\n return word_arr.join(\" \")\nend", "title": "" }, { "docid": "5940c9bb195e0e1056d07c6ff6c86038", "score": "0.7863076", "text": "def ordered_vowel_words(str)\n strs=str.split(\" \")\n res=[]\n strs.each do |word|\n res << word if ordered_vowel_word?(word)\n end\n res.join(' ')\nend", "title": "" }, { "docid": "372f01f07c363d64888c0cbec835415c", "score": "0.7799408", "text": "def ordered_vowels(str)\n in_order = []\n\n str.split(\" \").each do |word| in_order.push(word) if ordered_vowel_word?(word) == true\n end\n return in_order.join(\" \")\nend", "title": "" }, { "docid": "37cb208c1714e0929ed49a013e50858c", "score": "0.7769422", "text": "def ordered_vowel_words(str)\n newStringArray = str.split(' ')\n\n newStringArray.select! { |e| ordered_vowel_word?(e) }\n\n return newStringArray.join(' ')\nend", "title": "" }, { "docid": "7a444963010d9bded56f8e95a0bef4d0", "score": "0.7731542", "text": "def ordered_vowel_words(str)\n words = str.split(\" \")\n words.select { |word| ordered_vowel_word?(word) }.join(\" \")\nend", "title": "" }, { "docid": "1e396e63d7f72e6ef6ba91238658d247", "score": "0.76931405", "text": "def ordered_vowel_words(str)\n words = str.split(\" \") \n vowels = words.map{ |e| e.scan(/[aeiou]/) }\n ordered_vowels = vowels.map{ |e| e.sort }\n index = 0\n while index < words.length\n if vowels[index]!=ordered_vowels[index]\n words.delete_at(index)\n end\n index = index + 1\n end\n return words.join(\" \")\nend", "title": "" }, { "docid": "c6815774eb28c01a69ede0ffd5d7132b", "score": "0.76771384", "text": "def ordered_vowel_words(str)\n ordered_vowel_words = []\n str.split.select do |word|\n ordered_vowel_words << word if ordered_vowel_word?(word)\n end\n ordered_vowel_words.join(\" \")\nend", "title": "" }, { "docid": "c690e0a5b185cf2467ccbb4def478c04", "score": "0.7676355", "text": "def ordered_vowel_words(str)\n\n str = str.split\n output = []\n str.each do |word|\n if ordered_vowel_word?(word)\n output << word\n end\n end\n puts output.join(\" \").inspect\nend", "title": "" }, { "docid": "dd74477757d28e09c5103ce2c1ed2712", "score": "0.76555777", "text": "def ordered_vowel_word?(word)\n vowels = \"aeiou\".chars\n vowels_in_word = word.chars.select do |letter|\n vowels.include?(letter)\n end\n vowels_in_word == vowels_in_word.sort\nend", "title": "" }, { "docid": "130e746082c8f61e0b16e1dfb16b33e8", "score": "0.76466435", "text": "def ordered_vowel_words(str)\n\tr = Array.new\n\ta = str.split(' ')\n\ta.each {|word| r << word if ordered_vowel_word?(word)}\n\tr.join(' ')\nend", "title": "" }, { "docid": "5184cf5719bc54ff791206174340f5dc", "score": "0.76018333", "text": "def ordered_vowel_word?(word)\n extract_vowels(word).split(\"\") == extract_vowels(word).split(\"\").sort\nend", "title": "" }, { "docid": "4a7d718625464af77cb5afc064f98a84", "score": "0.7594292", "text": "def ordered_vowel_words(str)\n str = str.split\n answer = []\n str.each do |word|\n if ordered_vowel_word?(word)\n answer << word\n end\n end\nanswer.join(\" \")\nend", "title": "" }, { "docid": "c4367232b313344b4939f211daf7f183", "score": "0.75415283", "text": "def ordered_vowel_word?(word)\n vowels = 'aeiou'\n selVowel = word.chars.select { |v| v =~ /[aeiou]/}\n selVowel == selVowel.sort\nend", "title": "" }, { "docid": "8823d0c40293c84dc6b53b7695935e83", "score": "0.7468931", "text": "def ordered_vowel_words(str)\n words_array = str.split(' ')\n\n words_array.map! { |e| ordered_vowel_words_helper(e) }\n\n string = words_array.compact.join(\" \")\n puts string\n return string\nend", "title": "" }, { "docid": "c31e9a80232b8fa99375b1d962f1f886", "score": "0.73969424", "text": "def ordered_vowel_word?(word)\n vowels = word.chars.keep_if {|x| /[aeiou]/ === x } # Make an array of only the vowels\n vowels == vowels.sort # If the vowels are already ordered, return true\nend", "title": "" }, { "docid": "a4f5855bf20f0ba96df6c331a9be1cac", "score": "0.7282344", "text": "def ordered_vowel_words(str)\n words = str.split(' ')\n words.delete_if {|word| !(ordered_word(word))}\n words.join(' ')\nend", "title": "" }, { "docid": "29215ab37e51b4e28e935c5f062d4685", "score": "0.721483", "text": "def ordered?(word)\n\tsplitted_word = word.split(\"\")\n\tvowels = [\"a\",\"e\",\"i\",\"o\",\"u\",\"y\"]\n\tnew_word = []\n\n splitted_word.each {|letter| new_word << letter if vowels.include?(letter)}\n new_word.sort == new_word\n\nend", "title": "" }, { "docid": "e8ab7392c97843b46f62b38dfc2f663a", "score": "0.7209596", "text": "def ordered_vowel_word?(word)\n\tvowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n\tletter_array = word.split(\"\")\n\tvowel_array = letter_array.select{|l| vowels.include?(l)}\n\t(0...(vowel_array.length-1)).all? do |i|\n\t\tvowel_array[i] <= vowel_array[i+1]\n\tend\nend", "title": "" }, { "docid": "bf312559f0d27561b1ee40df6f622151", "score": "0.70798606", "text": "def ordered_vowel_word?(word)\n vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n\n letters_in_word = word.split(\"\")\n vowels_in_word = letters_in_word.select{ |letter| vowels.include?(letter) }\n (0...(vowels_in_word.length - 1)).all? do |i|\n vowels_in_word[i] <= vowels_in_word[i + 1]\n end\nend", "title": "" }, { "docid": "1986d70eca89fe302d5204de820a9758", "score": "0.70629346", "text": "def ordered_vowel_word?(word)\n # extract all vowels\n # check order\n vowels = ['a','e','i','o','u']\n found = []\n word.split('').each { |letter| found << letter if vowels.include?(letter)}\n return true if found.length <= 1\n for i in 0...found.size - 1\n for k in i+1...found.size\n return false if found[i] > found[k]\n end\n end\n true\nend", "title": "" }, { "docid": "4a91b621617835feaa44936cb82a53bf", "score": "0.7031959", "text": "def all_vowel_pairs(words)\n vowels = ['a','e','i','o','u']\n arr = []\n # (0...words.length-1).each_with_index do |word,idx|\n # pairs = \"\" \n # pairs += words[idx] + words[idx+1]\n # if vowels.all? { |char| pairs.include?(char)}\n # arr << words[idx] + \" \" + words[idx+1]\n # end\n # end\n (0...words.length-1).each do |word_1|\n (word_1...words.length).each do |word_2|\n first = words[word_1]\n second = words[word_2]\n pair = first + \" \" + second\n if vowels.all? { |char| pair.include?(char) }\n arr << pair\n end\n end\n end\n arr\nend", "title": "" }, { "docid": "93e75dddcc8f0f90de10392678a2365a", "score": "0.69573814", "text": "def get_vowels_in_word(word)\n vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n vowels_in_word = []\n characters = word.chars\n\n characters.each do |letter|\n vowels.each do |el|\n if letter == el\n vowels_in_word << letter\n end\n end\n end\n vowels_in_word\nend", "title": "" }, { "docid": "2c7fa592692fafe726718549144c2655", "score": "0.69488037", "text": "def ordered_vowel_words(str)\n\tordered_vowel_words_in_string = []\n\tstr.split.each do |s|\n\t\tordered_vowel_words_in_string << s if ordered_vowel?(s)\n\tend\n\tordered_vowel_words_in_string.join(\" \")\nend", "title": "" }, { "docid": "309e9b6c22b99ff172adffdd72725357", "score": "0.69305646", "text": "def ordered_vowel_word?(word)\n\n\tsplitted_word = word.split(\"\")\n\n\tsplitted_word.each do |letter|\n\n\t\tif letter != \"a\" || \"e\" || \"i\" || \"o\" || \"u\" || \"y\"\n\t\t splitted_word.delete(letter)\n\t end\n\n\tend\n\tsorted_word = splitted_word.sort\n\tsplitted_word == sorted_word\nend", "title": "" }, { "docid": "829d32a65e127ee10850f0ba91b51c24", "score": "0.68593997", "text": "def ordered_vowel_word?(word)\nend", "title": "" }, { "docid": "829d32a65e127ee10850f0ba91b51c24", "score": "0.68593997", "text": "def ordered_vowel_word?(word)\nend", "title": "" }, { "docid": "829d32a65e127ee10850f0ba91b51c24", "score": "0.68593997", "text": "def ordered_vowel_word?(word)\nend", "title": "" }, { "docid": "1e5f9844e36607157bb44320798bd164", "score": "0.6823319", "text": "def get_all_letters_in_array_of_words(array)\n\t#split? then sort\nend", "title": "" }, { "docid": "c52ce3206d91334a1c43a5c5fd1f6187", "score": "0.6792395", "text": "def all_vowel_pairs(words)\n vowels = ['a', 'e', 'i', 'o', 'u']\n pairs = [] # empty array\n words.each_with_index do |word_1, i|\n words.each_with_index do |word_2, j|\n pair = word_1 + \" \" + word_2\n if j > i && vowels.all? { |vow| pair.include?(vow) } \n pairs << pair\n end\n end\n end\n pairs\nend", "title": "" }, { "docid": "1f5bb95028e2cb8549558618fd10aab3", "score": "0.67893237", "text": "def get_all_letters_in_array_of_words(array)\n\tarray.join.chars.sort\nend", "title": "" }, { "docid": "90f949eaf5d0521c0ee19a8d015f1790", "score": "0.6761613", "text": "def select_elements_starting_with_vowel(array)\nend", "title": "" }, { "docid": "90f949eaf5d0521c0ee19a8d015f1790", "score": "0.6761613", "text": "def select_elements_starting_with_vowel(array)\nend", "title": "" }, { "docid": "25406204923d73b43710c280726bc0a6", "score": "0.6758531", "text": "def get_all_letters_in_array_of_words(array)\n array.join(\"\").split(\"\").sort\nend", "title": "" }, { "docid": "f93aa784a9acfe909801656f67832732", "score": "0.6755172", "text": "def get_all_letters_in_array_of_words(array)\n array.join.split(//).sort\nend", "title": "" }, { "docid": "958c632403f1c66f537d584406a5f699", "score": "0.67400587", "text": "def vowels(word)\n word.gsub(/#{CONSONANTS.chars.to_a.join('|')}/,\"\").chars.to_a\n end", "title": "" }, { "docid": "b5bcde10013cb1fd56678cca345d0820", "score": "0.67382306", "text": "def get_all_letters_in_array_of_words(array)\n\tarray.join().split('').sort\nend", "title": "" }, { "docid": "79c2a7a2e1c71a573e654b2b5d11a3f4", "score": "0.6732142", "text": "def remove_vowels(words)\n words.map do |word|\n word.chars.select { |letter| !'aeiou'.include?(letter.downcase) }.join\n end\nend", "title": "" }, { "docid": "088aecf540f4d0b3bde19c5fc91dc98c", "score": "0.67255807", "text": "def ordered_vowel_word?(word)\n vowels = \"aeiou\"\n vowelExist = false\n yExist = false\n prevIdx = nil\n word.each_char do |c|\n if c == \"y\"\n yExist = true\n end\n if vowels.include?(c)\n vowelExist = true\n if prevIdx == nil\n prevIdx = vowels.index(c)\n else\n if vowels.index(c) < prevIdx\n return false\n end\n end\n end\n end\n\n if vowelExist\n return true\n elsif !vowelExist and yExist\n return true\n else\n return false\n end\nend", "title": "" }, { "docid": "5d8fc78ad0a5d39117e86a8964d15142", "score": "0.6716475", "text": "def select_elements_starting_with_vowel(array)\n barray = []\n for i in (0...array.length)\n barray << (array[i]) if (['a', 'e', 'i', 'o', 'u'].include?(array[i][0, 1]))\n end\n return barray\nend", "title": "" }, { "docid": "f1c5e099d5140454d9af1c1c6aeac5b9", "score": "0.6696292", "text": "def get_all_letters_in_array_of_words(array)\n array.map(&:chars).flatten.sort\nend", "title": "" }, { "docid": "a3c94c46915810264c34bc84b74a103b", "score": "0.66939557", "text": "def get_all_letters_in_array_of_words(array)\nend", "title": "" }, { "docid": "2ad24701a117e23a52f96f4786593ed5", "score": "0.6683415", "text": "def vowels (string)\r\n # Your code here\r\n phrase = string.chars\r\n vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\r\n result = []\r\n phrase.each do |element|\r\n if vowels.include?(element) == true\r\n result << element \r\n end \r\n end\r\n return result\r\nend", "title": "" }, { "docid": "7a25d1792dcf6d96d4086647d0dd27f0", "score": "0.66625017", "text": "def all_vowel_pairs(arr)\n vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n all_pairs = []\n\n (0...arr.length).each do |idx1|\n (idx1 + 1...arr.length).each do |idx2|\n word1 = arr[idx1]\n word2 = arr[idx2]\n pair = word1 + \" \" + word2\n\n all_pairs << pair if vowels.all? { |vowel| pair.include?(vowel) }\n end\n end\n \n all_pairs\nend", "title": "" }, { "docid": "23569bf013dc6dc0de1e95da6de415ce", "score": "0.6660271", "text": "def vowel_substitutions word\n # Array of arrays that contains the possible letters for each position in the word\n possible_letters_by_pos = Array.new\n\n word.scan(/./).each do |letter|\n if VOWELS.include? letter.upcase\n letter_candidates = [letter] + (VOWELS - [letter.upcase]).to_a\n possible_letters_by_pos << letter_candidates\n else\n possible_letters_by_pos << [letter]\n end\n end\n\n Enumerator.new do |yielder|\n lazy_cartesian_product(possible_letters_by_pos).each do |letters_ary|\n yielder.yield letters_ary.join\n end\n end\n end", "title": "" }, { "docid": "30c120227f345875de500af681fdd7fb", "score": "0.6628053", "text": "def get_all_letters_in_array_of_words(array)\n lets = []\n array.each{|word|\n word.each_char{|letter|\n lets.push(letter)\n }\n }\n lets.sort\nend", "title": "" }, { "docid": "4b7a6409ba02089b7783cc4f6dd37876", "score": "0.66268784", "text": "def vowels_with_array_no_equality_or_if(letter)\n vowel = %w(a e i o u)\n vowel.include?(letter)\nend", "title": "" }, { "docid": "958aa55544fcd1579b91c1d2ebaa1bf8", "score": "0.6618902", "text": "def ordered_vowel_word?(word)\n previous = \"\"\n hash = {\n \"a\": 1,\n \"e\": 2,\n \"i\": 3,\n \"o\": 4,\n \"u\": 5,\n \"y\": 6\n }\n \n \n arrayWord = word.split(\"\")\n arrayWord.each do |letter|\n if hash[previous.to_sym] == nil && hash[letter.to_sym] != nil\n previous = letter\n elsif hash[letter.to_sym] != nil\n if hash[letter.to_sym] < hash[previous.to_sym]\n return false\n elsif hash[letter.to_sym] > hash[previous.to_sym]\n previous = letter\n end\n end\n end\n \n return true\nend", "title": "" }, { "docid": "5b0c5990308c3c5901ac282b8982ebc2", "score": "0.6587284", "text": "def get_all_letters_in_array_of_words(array)\n new_array = []\n array.each{|elem| new_array.push(elem.split(//))}\n new_array.flatten.sort\nend", "title": "" }, { "docid": "f085b2e0b4b0de48fad303731a042ec4", "score": "0.65862685", "text": "def remove_vowels(array)\n new_array = []\n array.each do |word|\n vowels = %w(a e i o u)\n new_word = []\n word.each_char do |char|\n if vowels.include?(char.downcase) == false\n new_word << char\n end\n end\n new_array << new_word.join('')\n end\n new_array\nend", "title": "" }, { "docid": "ce6dde3b401677945181748d84beccd3", "score": "0.65162534", "text": "def vowel_swap\n\t\tvowels = %w| a e i o u|\n\t\tword=@domain\n\t\tord=word[1..-1];\n\t\t(vowels.map {|x| vowels.map {|y| ord.gsub(x,y) }}.flatten.sort.uniq - [word]).map {|x| word.chars.first+x }\n\tend", "title": "" }, { "docid": "ce6dde3b401677945181748d84beccd3", "score": "0.65162534", "text": "def vowel_swap\n\t\tvowels = %w| a e i o u|\n\t\tword=@domain\n\t\tord=word[1..-1];\n\t\t(vowels.map {|x| vowels.map {|y| ord.gsub(x,y) }}.flatten.sort.uniq - [word]).map {|x| word.chars.first+x }\n\tend", "title": "" }, { "docid": "b5a14b85c900a90e5283345104ef4183", "score": "0.6468138", "text": "def get_all_letters_in_array_of_words(array)\n barray = []\n array.each{|word| barray = barray + word.split('')}\n barray.sort!\n return barray\nend", "title": "" }, { "docid": "2d28377e330718054a74afb84fde6ab4", "score": "0.6461805", "text": "def vowel_swap\n vowels = %w| a e i o u|\n word = @domain\n ord = word[1..-1];\n (vowels.map { |x| vowels.map { |y| ord.gsub(x,y) }}.flatten.sort.uniq - [word]).map { |x| word.chars.first+x }\n end", "title": "" }, { "docid": "67725518545930508dd58a95cc9f0936", "score": "0.6434731", "text": "def select_elements_starting_with_vowel(array)\n\tarray.select { |item| item.match(/\\b[aeiou]/) }\nend", "title": "" }, { "docid": "5fd8554074d642825d89e4e3f429fd70", "score": "0.64285153", "text": "def translate(words)\n vowels = ['a','e','i','o','u','y']\n words = words.split(\" \")\n words.map! do |word|\n until vowels.include?(word[0])\n word += word[0]\n word[0] = ''\n end\n word += 'ay'\n end\n words.join(\" \")\nend", "title": "" }, { "docid": "8213c84a6882ac30ac19a4d016c80fbf", "score": "0.64268917", "text": "def remove_vowels(words)\n words.map { |word| word.scan(/[^aeiouAEIOU]/).join }\nend", "title": "" }, { "docid": "16f38fd31f25c2f8e7bf08cf0d13e586", "score": "0.64255166", "text": "def ordered_vowel_word?(word)\n vowels = ['a','e','i','o','u']\n last_vowel = \"a\"\n\n word.chars.each do |ch|\n if vowels.include?(ch)\n if ch < last_vowel\n return false\n else\n last_vowel = ch\n end\n end\n end\n\n true\nend", "title": "" }, { "docid": "fdea8d1c42fb67fe24a6c8ca828dfd32", "score": "0.6417842", "text": "def my_sort(vowel_words)\n done = false\n loop_times = vowel_words.size-1\n while !done\n done = true\n loop_times.times do |order|\n if vowel_words[order].size > vowel_words[order+1].size\n vowel_words[order],vowel_words[order+1] =vowel_words[order+1],vowel_words[order]\n done =false\n end\n end \n end\n return vowel_words\nend", "title": "" }, { "docid": "72c718015f81fa80f0e734d266b0b61c", "score": "0.640035", "text": "def get_all_letters_in_array_of_words(array)\n output = []\n array.each do |word|\n word.chars {|char| output.push(char)}\n end\n return output.sort\nend", "title": "" }, { "docid": "5fabcaf6639d63d5b0c33f09b761ed18", "score": "0.63653016", "text": "def select_elements_starting_with_vowel(array)\n\tarray.select{|el| el.match(/^[a,e,i,o,u,y]/i)}\nend", "title": "" }, { "docid": "5c96deedecad49663a05b506910ab433", "score": "0.6353107", "text": "def vowels(string)\r\n # initialise arrays\r\n output = []\r\n vowels = [\"a\", \"e\", \"i\", \"o\", \"u\", \"A\", \"E\", \"I\", \"O\", \"U\"]\r\n for i in (0...string.length) # Runs this loop once for every character in the given string\r\n character = string[i] # Assigns one character to run comparisons on\r\n if vowels.include?(character) # If the character is in the list of vowels...\r\n output << character # ...add it to the output array\r\n end\r\n end\r\n return output\r\nend", "title": "" }, { "docid": "6b101e75142346ee9ee7653a277deeda", "score": "0.6349406", "text": "def get_all_letters_in_array_of_words(array)\n array.join(\" \").split(%r{\\s*}).sort\nend", "title": "" }, { "docid": "e7b7be718acf3ec202da3a87643a74c9", "score": "0.6346154", "text": "def vowel_indices(word)\n vowels = ['a', 'o', 'e', 'u', 'i','y']\n result = []\n arr = word.split(//)\n arr.each_with_index do |letter, index|\n if vowels.include?(letter.downcase)\n result << index + 1\n end\n end\n result\nend", "title": "" }, { "docid": "062394761569ea0a4702c59c5455762c", "score": "0.6333846", "text": "def vowel_organizer(str) # Changed method name to make it fit. Works for one word.\n \n vowels = str.chars.keep_if {|x| /[aeiou]/ === x } # Makes an array of vowels only\n return str if vowels == vowels.sort # Returns the string if its vowels are already organized\n\n letters = str.chars # Cut the string into an array of letters\n vowels.sort! # Sort the vowels array\n counter = 0 # Set a counter to keep track of which vowel we're at\n\n modified_word = \"\" # Set the modified word as an empty string\n\n letters.each do |x| # Originally I had this mapping each letter and replacing \n # each vowel with the approriate vowel but my for some reason \n # letters remained unchanged. I realized I didnt use the '!'\n if /[aeiou]/ === x \n modified_word << vowels[counter] # If the letter is a vowel, push the appropiate vowel into word\n counter += 1 # Increment counter so we know which vowel we are at\n else \n modified_word << x # If its not a vowel, push the character into the modified word \n end\n end\n\n modified_word # Return the modified word\nend", "title": "" }, { "docid": "f9484d4c81a989c06465755cb3271336", "score": "0.6321845", "text": "def get_vowel_indexes(sent)\n vowels = \"aeiou\"\n (0...sent.length).select { |idx| vowels.include?(sent[idx]) }\nend", "title": "" }, { "docid": "fb3e324cfab7e9e5f217c5a21339537c", "score": "0.6316592", "text": "def reverberate(sent)\n words = sent.split(\" \")\n vowels = \"aeiou\"\n words.map do |word|\n if word.length < 3\n word\n elsif vowels.include?(word[-1].downcase)\n word + word.downcase\n else\n last_vowel_index = word.rindex(/[aeiou]/)\n word + word[last_vowel_index..-1].downcase\n end\n end.join(\" \")\nend", "title": "" }, { "docid": "be39def1c3d5199737f846258d172c74", "score": "0.63075763", "text": "def select_elements_starting_with_vowel(array)\n array.select(&:starts_with_vowel?)\nend", "title": "" }, { "docid": "ed8b0d903806e213b1beea8cdb6b01d0", "score": "0.6304886", "text": "def no_vowels(array)\n array.map do |word|\n word.chars.delete_if {|char| char.match(/[aeiouAEIOU]/)}.join\n end\nend", "title": "" }, { "docid": "a42d9ca0ac69ee09135058c0e9283d00", "score": "0.628175", "text": "def select_elements_starting_with_vowel(array)\n vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"]\n array.select{|elem| vowels.include?(elem.split(//)[0])}\nend", "title": "" }, { "docid": "5a3d9207a3c565abfd191c7734da5306", "score": "0.62764007", "text": "def vowel_indices(word)\n indexes = []\n word.downcase.split(//).each_with_index do |letter, index|\n indexes << (index + 1) if /[aeiouy]/=~letter\n end\n indexes\nend", "title": "" }, { "docid": "505ef118df015bde4bf4cb951ce62417", "score": "0.6260162", "text": "def remove_vowels(array)\n new_array = []\n array. each do |word|\n word.delete!('aeiouAEIOU')\n new_array << word\n end\n new_array\nend", "title": "" }, { "docid": "2b9a36158f4918aa45ed12465b7aea2c", "score": "0.62511325", "text": "def alternating_vowel(sentence)\n\n words = sentence.split(\" \")\n words.map! do |word|\n if words.index(word).even?\n first_vowel(word)\n else\n last_vowel(word)\n end\n end\n words.join(\" \")\nend", "title": "" }, { "docid": "b0362109a326a423c16aabbd0edcc07c", "score": "0.6243858", "text": "def all_vowels(word1, word2)\n \"aeiou\".chars.all? { |c| (word1 + word2).downcase.include?(c) }\nend", "title": "" }, { "docid": "7072c84649d1f4a5b95dbb3a68aff5f8", "score": "0.6237674", "text": "def word_sort (array,letter)\n array.each do |value|\n if value.include? letter\n puts value\n end\n end\nend", "title": "" }, { "docid": "3783ac92b6731934b43c43a34f389606", "score": "0.6227049", "text": "def solve(string)\n array = string.chars\n vowels = %w(a e i o u)\n vowels_in_word = []\n\n array.each { |char| vowels_in_word << char if vowels.include?(char) }\n array.map!{|char| vowels.include?(char) ? vowels_in_word.pop : char }\nend", "title": "" }, { "docid": "2894480ca4cf9c9914eacfc7b2d950dd", "score": "0.6226057", "text": "def alternating_vowel(sent)\n # debugger\n words = sent.split(\" \")\n vowels = \"aeiou\"\n words.map.with_index do |word, word_idx|\n if word.split(\"\").none? { |char| vowels.include?(char) }\n word\n else\n if word_idx.even?\n vowel_idx = word.index(/[aeiou]/)\n else\n vowel_idx = word.rindex(/[aeiou]/)\n end\n word.slice(0...vowel_idx) + word.slice(vowel_idx+1..-1)\n end\n end.join(\" \")\nend", "title": "" }, { "docid": "5b06500cf7c33a54665b443f706844df", "score": "0.6209214", "text": "def anagrams(word, array)\n array.map.select{|e|\n e.downcase.chars.sort == word.downcase.chars.sort}\nend", "title": "" }, { "docid": "ea89dacef237c9c9e282dacd41aa05e4", "score": "0.62005335", "text": "def no_vowels(arr)\n arr.map do |word|\n word.delete(\"aeiou\")\n end\nend", "title": "" }, { "docid": "ce1207726102129ec03a99a6526c71e5", "score": "0.61986315", "text": "def select_elements_starting_with_vowel(array)\n vowels = [\"a\",\"e\",\"i\",\"o\",\"u\"]\n array.select{ |item|\n item if vowels.include?(item[0])\n }\nend", "title": "" }, { "docid": "47907b55d302d85d7ca1d48aac6a1574", "score": "0.6196116", "text": "def select_elements_starting_with_vowel(array)\n array.select { |element| (element[0].downcase =~ /[aeiou]/) }\nend", "title": "" }, { "docid": "f8053d5cbbb779a8f8bea340f7b66f72", "score": "0.6186735", "text": "def vowels_removed(array)\n vowels = \"aeiouAEIOU\"\n array.each { |word| word.delete!(vowels)}\nend", "title": "" }, { "docid": "f0b4769ba8ec3fc51e2168b0163dd368", "score": "0.61863035", "text": "def remove_vowel(word)\n word_array = word.chars\n vowels = [\"a\",\"e\",\"i\",\"o\",\"u\"]\n new_word = []\n for letter in word_array\n if vowels.include?(letter.downcase)\n nil\n else \n new_word << letter\n end\n end\n return new_word.join\nend", "title": "" }, { "docid": "bb3b77c4a3eb97a8e79ece850ef152d5", "score": "0.61813587", "text": "def vowel_indices(word)\n result = []\n vowels = ['a', 'e', 'i', 'o', 'u', 'y']\n Array.new(0).tap {|arr| word.downcase.split('').each_with_index {|char, index| result << index + 1 if vowels.include? char}}\n result\nend", "title": "" }, { "docid": "370e73d802749348f0fb065c073cfd79", "score": "0.61733186", "text": "def vowel_in_array (array, letter)\n array.select do |value|\n value.include? letter\n end\nend", "title": "" }, { "docid": "eeaa213fbde4d327861cc2f29e41b927", "score": "0.6147562", "text": "def remove_vowels(array)\n array.map do |string|\n string.chars.select {|i| !'aeiou'.include?(i.downcase) }.join\n end\nend", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "f856e75c0452884974d86780d219e37a", "score": "0.0", "text": "def set_customer\n @user = User.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60310596", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.6014974", "text": "def on_setup_callbacks; end", "title": "" }, { "docid": "311e95e92009c313c8afd74317018994", "score": "0.59220976", "text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5914568", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5914568", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "bfea4d21895187a799525503ef403d16", "score": "0.589943", "text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end", "title": "" }, { "docid": "352de4abc4d2d9a1df203735ef5f0b86", "score": "0.5888941", "text": "def required_action\n # TODO: implement\n end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.58885634", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.58885634", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.58885634", "text": "def actions; end", "title": "" }, { "docid": "8713cb2364ff3f2018b0d52ab32dbf37", "score": "0.58782613", "text": "def define_action_helpers\n if action == :save\n if super(:create_or_update)\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 else\n super\n end\n end", "title": "" }, { "docid": "a80b33627067efa06c6204bee0f5890e", "score": "0.5861314", "text": "def actions\n\n end", "title": "" }, { "docid": "930a930e57ae15f432a627a277647f2e", "score": "0.5809542", "text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end", "title": "" }, { "docid": "33ff963edc7c4c98d1b90e341e7c5d61", "score": "0.5741235", "text": "def setup\n common_setup\n end", "title": "" }, { "docid": "a5ca4679d7b3eab70d3386a5dbaf27e1", "score": "0.57311964", "text": "def perform_setup\n end", "title": "" }, { "docid": "ec7554018a9b404d942fc0a910ed95d9", "score": "0.5716416", "text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5700531", "text": "def callbacks; end", "title": "" }, { "docid": "c85b0efcd2c46a181a229078d8efb4de", "score": "0.56932974", "text": "def custom_setup\n\n end", "title": "" }, { "docid": "100180fa74cf156333d506496717f587", "score": "0.56695074", "text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend", "title": "" }, { "docid": "2198a9876a6ec535e7dcf0fd476b092f", "score": "0.5651278", "text": "def initial_action; end", "title": "" }, { "docid": "b9b75a9e2eab9d7629c38782c0f3b40b", "score": "0.5648787", "text": "def setup_intent; end", "title": "" }, { "docid": "471d64903a08e207b57689c9fbae0cf9", "score": "0.5637279", "text": "def setup_controllers &proc\n @global_setup = proc\n self\n end", "title": "" }, { "docid": "468d85305e6de5748477545f889925a7", "score": "0.5625286", "text": "def inner_action; end", "title": "" }, { "docid": "bb445e7cc46faa4197184b08218d1c6d", "score": "0.56093556", "text": "def pre_action\n # Override this if necessary.\n end", "title": "" }, { "docid": "432f1678bb85edabcf1f6d7150009703", "score": "0.55957067", "text": "def target_callbacks() = commands", "title": "" }, { "docid": "48804b0fa534b64e7885b90cf11bff31", "score": "0.5595428", "text": "def execute_callbacks; end", "title": "" }, { "docid": "5aab98e3f069a87e5ebe77b170eab5b9", "score": "0.5587003", "text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.555788", "text": "def global_callbacks; end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.555788", "text": "def global_callbacks; end", "title": "" }, { "docid": "482481e8cf2720193f1cdcf32ad1c31c", "score": "0.5509564", "text": "def required_keys(action)\n\n end", "title": "" }, { "docid": "353fd7d7cf28caafe16d2234bfbd3d16", "score": "0.5503485", "text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end", "title": "" }, { "docid": "dcf95c552669536111d95309d8f4aafd", "score": "0.54668134", "text": "def layout_actions\n \n end", "title": "" }, { "docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40", "score": "0.5466406", "text": "def on_setup(&block); end", "title": "" }, { "docid": "8ab2a5ea108f779c746016b6f4a7c4a8", "score": "0.54484755", "text": "def testCase_001\n test_case_title # fw3_actions.rb\n setup # fw3_global_methods.rb\n \n get_page_url # fw3_actions.rb\n validate_page_title # fw3_actions.rb\n validate_page_link_set # fw3_actions.rb\n \n teardown # fw3_global_methods.rb\nend", "title": "" }, { "docid": "e3aadf41537d03bd18cf63a3653e05aa", "score": "0.5445224", "text": "def before(action)\n invoke_callbacks *options_for(action).before\n end", "title": "" }, { "docid": "6bd37bc223849096c6ea81aeb34c207e", "score": "0.54400647", "text": "def post_setup\n end", "title": "" }, { "docid": "07fd9aded4aa07cbbba2a60fda726efe", "score": "0.54170287", "text": "def testCase_001\n testTitle # fw2_actions.rb\n setup # fw2_global_methods.rb\n get_page_url # fw2_actions.rb\n validate_title # fw2_actions.rb\n teardown # fw2_global_methods.rb\nend", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5410386", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5410386", "text": "def action_methods; end", "title": "" }, { "docid": "9358208395c0869021020ae39071eccd", "score": "0.5400231", "text": "def post_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5394892", "text": "def before_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5394892", "text": "def before_setup; end", "title": "" }, { "docid": "cb5bad618fb39e01c8ba64257531d610", "score": "0.53915846", "text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end", "title": "" }, { "docid": "a468b256a999961df3957e843fd9bdf4", "score": "0.53883713", "text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.5377769", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.53559244", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "725216eb875e8fa116cd55eac7917421", "score": "0.53485996", "text": "def setup\n @controller.setup\n end", "title": "" }, { "docid": "39c39d6fe940796aadbeaef0ce1c360b", "score": "0.53475654", "text": "def setup_phase; end", "title": "" }, { "docid": "118932433a8cfef23bb8a921745d6d37", "score": "0.534689", "text": "def register_action(action); end", "title": "" }, { "docid": "bd03e961c8be41f20d057972c496018c", "score": "0.53444993", "text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end", "title": "" }, { "docid": "c6352e6eaf17cda8c9d2763f0fbfd99d", "score": "0.5340848", "text": "def initial_action=(_arg0); end", "title": "" }, { "docid": "207a668c9bce9906f5ec79b75b4d8ad7", "score": "0.532768", "text": "def before_setup\n\n end", "title": "" }, { "docid": "669ee5153c4dc8ee81ff32c4cefdd088", "score": "0.53044224", "text": "def ensure_before_and_after; end", "title": "" }, { "docid": "c77ece7b01773fb7f9f9c0f1e8c70332", "score": "0.5285527", "text": "def setup!\n adding_handlers do\n check_arity\n apply_casting\n check_validation\n end\n end", "title": "" }, { "docid": "1e1e48767a7ac23eb33df770784fec61", "score": "0.5283148", "text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7", "score": "0.52561116", "text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end", "title": "" }, { "docid": "4ad1208a9b6d80ab0dd5dccf8157af63", "score": "0.5255505", "text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end", "title": "" }, { "docid": "fc88422a7a885bac1df28883547362a7", "score": "0.5249269", "text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end", "title": "" }, { "docid": "8945e9135e140a6ae6db8d7c3490a645", "score": "0.52457106", "text": "def action_awareness\n if action_aware?\n if !@options.key?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end", "title": "" }, { "docid": "7b3954deb2995cf68646c7333c15087b", "score": "0.5239162", "text": "def after_setup\n end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5237084", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5237084", "text": "def action; end", "title": "" }, { "docid": "1dddf3ac307b09142d0ad9ebc9c4dba9", "score": "0.52318287", "text": "def external_action\n raise NotImplementedError\n end", "title": "" }, { "docid": "5772d1543808c2752c186db7ce2c2ad5", "score": "0.5228689", "text": "def actions(state:)\n raise NotImplementedError\n end", "title": "" }, { "docid": "64a6d16e05dd7087024d5170f58dfeae", "score": "0.5224244", "text": "def setup_actions(domain)\n\t\t\tpath_user = '/a/feeds/'+domain+'/user/2.0'\n\t\t\tpath_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n\t\t\tpath_group = '/a/feeds/group/2.0/'+domain # path for Google groups\n\n\t\t\taction = Hash.new\n\t\t\taction[:domain_login] = {:method => 'POST', :path => '/accounts/ClientLogin' }\n\t\t\taction[:user_create] = { :method => 'POST', :path => path_user }\n\t\t\taction[:user_retrieve] = { :method => 'GET', :path => path_user+'/' }\n\t\t\taction[:user_retrieve_all] = { :method => 'GET', :path => path_user } \n\t\t\taction[:user_update] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_rename] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_delete] = { :method => 'DELETE', :path => path_user +'/' }\n\t\t\taction[:nickname_create] = { :method => 'POST', :path =>path_nickname }\n\t\t\taction[:nickname_retrieve] = { :method => 'GET', :path =>path_nickname+'/' }\n\t\t\taction[:nickname_retrieve_all_for_user] = { :method => 'GET', :path =>path_nickname+'?username=' }\n\t\t\taction[:nickname_retrieve_all_in_domain] = { :method => 'GET', :path =>path_nickname }\n\t\t\taction[:nickname_delete] = { :method => 'DELETE', :path =>path_nickname+'/' }\n\t\t\taction[:group_create] = { :method => 'POST', :path =>path_group }\n\t\t\taction[:group_update] = { :method => 'PUT', :path =>path_group+'/' }\n\t\t\taction[:group_delete] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:groups_retrieve] = { :method => 'GET', :path =>path_group+'?member=' }\n\t\t\taction[:all_groups_retrieve] = { :method => 'GET', :path =>path_group }\n\t\t\taction[:membership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:membership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:membership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_members_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:ownership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:ownership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:ownership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_owners_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\n\t\t\t# special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n\t\t\taction[:next] = {:method => 'GET', :path =>nil }\n\t\t\treturn action \t\n\t\tend", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.52220625", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "db0cb7d7727f626ba2dca5bc72cea5a6", "score": "0.5220978", "text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end", "title": "" }, { "docid": "8d7ed2ff3920c2016c75f4f9d8b5a870", "score": "0.52146", "text": "def pick_action; end", "title": "" }, { "docid": "7bbfb366d2ee170c855b1d0141bfc2a3", "score": "0.5212803", "text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end", "title": "" }, { "docid": "78ecc6a2dfbf08166a7a1360bc9c35ef", "score": "0.520894", "text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end", "title": "" }, { "docid": "2aba2d3187e01346918a6557230603c7", "score": "0.5205112", "text": "def ac_action(&blk)\n @action = blk\n end", "title": "" }, { "docid": "4c23552739b40c7886414af61210d31c", "score": "0.5204084", "text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end", "title": "" }, { "docid": "d56f4ec734e3f3bc1ad913b36ff86130", "score": "0.5203692", "text": "def create_setup\n \n end", "title": "" }, { "docid": "6a98e12d6f15af80f63556fcdd01e472", "score": "0.52036524", "text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end", "title": "" }, { "docid": "691d5a5bcefbef8c08db61094691627c", "score": "0.51995677", "text": "def performed(action)\n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51958364", "text": "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 end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51958364", "text": "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 end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "7fca702f2da4dbdc9b39e5107a2ab87d", "score": "0.51914203", "text": "def add_transition_callbacks\n %w(before after).each {|type| owner_class.define_callbacks(\"#{type}_transition_#{attribute}\") }\n end", "title": "" }, { "docid": "063b82c93b47d702ef6bddadb6f0c76e", "score": "0.51794034", "text": "def setup(instance)\n action(:setup, instance)\n end", "title": "" }, { "docid": "9f1f73ee40d23f6b808bb3fbbf6af931", "score": "0.5178634", "text": "def setup( *args )\n\t\t\tself.class.setupMethods.each {|sblock|\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\tend", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.5173361", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.5173361", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.5173361", "text": "def setup(resources) ; end", "title": "" }, { "docid": "7a0c9d839516dc9d0014e160b6e625a8", "score": "0.51644397", "text": "def setup(request)\n end", "title": "" }, { "docid": "e441ee807f2820bf3655ff2b7cf397fc", "score": "0.51532143", "text": "def after_setup; end", "title": "" }, { "docid": "1d375c9be726f822b2eb9e2a652f91f6", "score": "0.51424634", "text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end", "title": "" }, { "docid": "c594a0d7b6ae00511d223b0533636c9c", "score": "0.5140684", "text": "def code_action_provider; end", "title": "" }, { "docid": "2fcff037e3c18a5eb8d964f8f0a62ebe", "score": "0.5140337", "text": "def setup(params)\n end", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.5139829", "text": "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", "title": "" }, { "docid": "111fd47abd953b35a427ff0b098a800a", "score": "0.513508", "text": "def setup\n make_notification_owner\n load_superusers\n admin_sets.each do |as|\n @logger.debug \"Attempting to make admin set for #{as}\"\n make_admin_set_from_config(as)\n end\n load_workflows\n everyone_can_deposit_everywhere\n give_superusers_superpowers\n end", "title": "" }, { "docid": "f2ac709e70364fce188bb24e414340ea", "score": "0.51161575", "text": "def setup_defaults\n add_help\n @handler = Cliqr::Util.forward_to_help_handler if @handler.nil? && help? && actions?\n @actions.each(&:setup_defaults)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.511372", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "4c7a1503a86fb26f1e4b4111925949a2", "score": "0.5111875", "text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.51083213", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.51083213", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.51083213", "text": "def action\n end", "title": "" }, { "docid": "63849e121dcfb8a1b963f040d0fe3c28", "score": "0.51056045", "text": "def perform_action(action, item)\n if action == :approve\n approve(item.fullid)\n elsif action == :remove\n remove(item.fullid)\n elsif action == :alert\n #perform_alert() check condition alert params and proceed\n else\n #something isn't cool, pass or error \n end\nend", "title": "" }, { "docid": "f04fd745d027fc758dac7a4ca6440871", "score": "0.51042956", "text": "def block_actions options ; end", "title": "" }, { "docid": "0d1c87e5cf08313c959963934383f5ae", "score": "0.5098082", "text": "def on_action(action)\n @action = action\n self\n end", "title": "" }, { "docid": "916d3c71d3a5db831a5910448835ad82", "score": "0.50948924", "text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end", "title": "" }, { "docid": "35b302dd857a031b95bc0072e3daa707", "score": "0.5091935", "text": "def config(action, *args); end", "title": "" } ]
91ac5e00ad1ab957937a59d68211811c
Finds categories by their title. This method is necessary because categories are translated which means the title attribute does not exist on the categories table thus requiring us to find the attribute on the translations table and then join to the categories table again to return the associated record.
[ { "docid": "29006101ebc8fb12217d8bbc1d56858f", "score": "0.742012", "text": "def by_title(title)\n Products::Categories::Finder.by_title(title)\n end", "title": "" } ]
[ { "docid": "e84a6ca6a6e49b2e0ca9a972290f3a5b", "score": "0.74376136", "text": "def by_title(title)\n Categories::Finder.by_title(title)\n end", "title": "" }, { "docid": "09d9475c5535a5a9bb9e3d746f04d0f6", "score": "0.57255036", "text": "def category_title_filter\n\n string_title = \"posts.title LIKE '#{params[:title]}'\"\n string_cate = \"categories.name LIKE '#{params[:category]}'\"\n \n filter_cat_title = @posts.where(status: true)\n .where(string_cate)\n .joins(:category).select(:id,:title,:image,:content)\n .where(string_title)\n \n \n \n\n render json: { \n message: \"Filter to Category and Post title\",\n object: filter_cat_title \n }\n end", "title": "" }, { "docid": "64857ec0435fb89211fad9436a8aac50", "score": "0.5703382", "text": "def category(id)\n db = connect()\n return db.execute('SELECT Id,Title FROM discussions WHERE CatId=?', id), db.execute('SELECT * FROM categories WHERE Id=?', id)\n end", "title": "" }, { "docid": "097175eac4d7f48bb988381f11bd9f23", "score": "0.55903506", "text": "def category()\n sql = \"SELECT * FROM categories WHERE id = $1 ORDER BY name;\"\n values = [@category_id]\n sql_result = SqlRunner.run(sql, values)\n return Category.new(sql_result[0])\n end", "title": "" }, { "docid": "1a92f65c19d2d3f8c983d61dd16a13a5", "score": "0.557069", "text": "def category categories\n categories = categories.to_a if !categories.is_a? Array\n categories.collect { |i| calendars.find_by_title i.to_s }.compact\n end", "title": "" }, { "docid": "35aa2afd950852e3de84ec1bdf9962e0", "score": "0.5558364", "text": "def get_title_with_category(listing)\n \"#{t(\"title_#{listing.category}\")} #{listing.title}\"\n end", "title": "" }, { "docid": "f2c74035d74e705105985807c40eb595", "score": "0.5531943", "text": "def search(text, category)\r\n\t\ttext = \"%#{text}%\"\r\n\t\tstmntSQL = \"title LIKE ? OR description LIKE ? COLLATE utf8_general_ci\"\r\n\t\tif category > 0\r\n\t\t\tcategory = Category.find(category)\r\n\t\t\tcategory.campaigns.where(stmntSQL, text, text).where(status: \"ready\")\r\n\t\telse\r\n\t\t\tCampaign.where(stmntSQL, text, text).where(status: \"ready\")\r\n\t\tend\r\n\tend", "title": "" }, { "docid": "aaaa30dd2d21a21b01c0279025c86330", "score": "0.5458929", "text": "def by_slug(slug, conditions = {})\n Products::Categories::Finder.by_slug(slug, conditions)\n end", "title": "" }, { "docid": "65e1ad6f1ee985022fd1cc9af222f13f", "score": "0.5400558", "text": "def category\n catName = params[:title]\n @meals = Meal.where(\"category like ?\", catName)\n end", "title": "" }, { "docid": "338189813efd5d5aaea49f52c1640276", "score": "0.5391425", "text": "def by_slug(slug, conditions = {})\n Categories::Finder.by_slug(slug, conditions)\n end", "title": "" }, { "docid": "baeb18f8f7459002e3cad902e1580970", "score": "0.5362835", "text": "def extract_categories(title)\n # First find the article_id\n article_id = get_article_id(title)\n return nil if article_id.nil?\n \n (prefix1, prefix2) = make_path_prefix(article_id)\n fname = @enwiki_dir + \"/\" + prefix1 + \"/\" + prefix2 + \"/#{article_id}.xml\"\n catlist = []\n open(fname).each_line do |line|\n if line =~ /\\[\\[(Category:.*?)\\]\\]/\n # Remove stuff after \"|\" if any\n cat_title = $1.gsub /\\|.*/, ''\n cat_article_id = get_article_id(cat_title)\n catlist.push(cat_article_id) if not cat_article_id.nil?\n end\n end\n return catlist\n end", "title": "" }, { "docid": "2fcd5acef41b2e86cffa57e5310ff528", "score": "0.53557026", "text": "def set_to_param_with_title\n Category.class_eval do\n def to_param\n title.downcase\n end\n end\n end", "title": "" }, { "docid": "8f26e62bfab92e8b4f62ca939bf18d7e", "score": "0.5313791", "text": "def collection_by_title(title)\n return self.root_collection.subcollection_by_title(title)\n end", "title": "" }, { "docid": "a61738f256c0870b1428da75bd9249b3", "score": "0.5296184", "text": "def category(name)\n @categories.find { |c| c.name == name}\n end", "title": "" }, { "docid": "fe96e7cb140f9dec180776e5d9ed511f", "score": "0.52621275", "text": "def find_categories(options = {})\n @language_permalink = options[:language_permalink]\n if @language_permalink\n options.delete(:language_permalink)\n Syntaxdb::Request.send_request(options, \"/languages/#{@language_permalink}/categories\")\n end\n end", "title": "" }, { "docid": "4d8772a5cc496953b88e6886d56387d3", "score": "0.52614015", "text": "def find_category(category_name, options = {})\n categories = self.categories\n if categories.is_a?(Array)\n categories.detect { |c| c['name'] == category_name }\n else\n raise \"Could not retrieve categories: #{categories}\"\n end\n end", "title": "" }, { "docid": "39dba36650e5922f8a8000d28e70bcb6", "score": "0.5250449", "text": "def find_collection(title)\n collection_id = ActiveFedora::SolrService.query(\"primary_title_ssi:\\\"#{title}\\\"\", {fq: \"has_model_ssim:Collection\", fl: \"id\"})\n\n (collection_id.count > 0) ? Collection.find(collection_id.first[\"id\"]) : nil\n end", "title": "" }, { "docid": "3f62c18ffbc234598acb3acdae4f8965", "score": "0.52460307", "text": "def categories_search(query, order = nil)\n Collection.find(:all, :select => 'DISTINCT collections.*', :joins => 'INNER JOIN linkings ON collections.id = linkings.category_id',\n :conditions => [\"(linkings.group_id IN (#{groups.map { |o| o.id }.join(',')})) AND (( (collections.`type` = 'Category' ) ) AND ((collections.name like ?) OR (collections.description like ?) OR \\\n (SELECT tags.name FROM tags INNER JOIN taggings ON tags.id = taggings.tag_id WHERE taggings.taggable_id = collections.id AND taggings.taggable_type = 'Category' AND tags.name LIKE ?) IS NOT NULL))\", \"%#{query}%\", \"%#{query}%\", \"%#{query}%\"],\n :order => order)\n end", "title": "" }, { "docid": "36640a25392a83fc66924e74d76fc99e", "score": "0.52137685", "text": "def category_titles\n categories.map(&:title)\n end", "title": "" }, { "docid": "0025e24401cb5007de0680f1a81044b2", "score": "0.5213132", "text": "def category_search(id)\n cached_request('category',{:id => id})\n end", "title": "" }, { "docid": "df5e7a6eecc064491a82607f8abd682a", "score": "0.5212926", "text": "def search_for_products\r\n @categories = Category.select(:id, :name).all\r\n end", "title": "" }, { "docid": "5e33be46c8002372bfb9b016efe83a1d", "score": "0.5205763", "text": "def with_title(items)\n return items if title.nil?\n return items.none if title.blank?\n\n items.where(title: title)\n end", "title": "" }, { "docid": "0f4e288282a509d9aeb61eedff547b2c", "score": "0.51757306", "text": "def find_book_by_title(title)\n for book in @books\n if book[:title] == title\n return book\n end\n end\n end", "title": "" }, { "docid": "8365b09ca996486623491bedfdfcbcb1", "score": "0.51736736", "text": "def categories\n return [] if @categories.blank?\n @categories.records.map {|c| c.display_name}\n end", "title": "" }, { "docid": "faec4377d8e041501c8b13edfb0fc8ef", "score": "0.5160626", "text": "def find_category\n @category = Category.includes(:items).find(params[:id])\n end", "title": "" }, { "docid": "7a94cea3682d0990a2e39d3e583f4b18", "score": "0.51547176", "text": "def category_with_name(name)\n categorized_items = categories_items\n categorized_items.detect{ |sub_item_array| sub_item_array[0].name == name }\n end", "title": "" }, { "docid": "4ee1bb442732e4b81de1c6e2287267e9", "score": "0.5151391", "text": "def category(rel_path)\n find_category based_on_root rel_path\n end", "title": "" }, { "docid": "4031c36795b8563d4cf746a185b2d85e", "score": "0.51506674", "text": "def category(id)\n categories.select do |category|\n category.id == id\n end.first\n end", "title": "" }, { "docid": "7dc66cf971a1b07ba8136715bcf38ea1", "score": "0.5140758", "text": "def find_recipe_by_title\n # view_recipe(Recipe.find_by(title: ask('Which recipe would you like to look for? >:'))) # ask for recipe title, search for it and display\n list_recipes(Recipe.where(\"title LIKE ?\", \"%\"+ ask('Which recipe would you like to look for? >:') + \"%\").order(:title))\n\n end", "title": "" }, { "docid": "8e5f8f9b392d95785f6e66b66b7dae34", "score": "0.5127127", "text": "def find_song_by_title(songs, title)\n songs.find do |song|\n song[:title] == title\n end\n end", "title": "" }, { "docid": "633acc3af7bd2570831ec3a0d6adc33e", "score": "0.5122583", "text": "def category_conditions\n [\"words.category LIKE ?\", \"%#{category}\"]\n end", "title": "" }, { "docid": "9ac2a04fb22bdb8823403e5ba3121911", "score": "0.50995594", "text": "def get_category_name(id)\n return db_connection().execute('SELECT name FROM categories WHERE id=?', id).first\n end", "title": "" }, { "docid": "b4003aac13a70ea843b56ff6b5a0bd3d", "score": "0.50722265", "text": "def categories\n\t\t\t@cat_cache ||= @db.js('musicthoughts.all_categories()').map {|c| c.merge(category: c[@lang]) }\n\t\t\t@cat_cache\n\t\tend", "title": "" }, { "docid": "6ecb95ed54e585453c644f16b5196443", "score": "0.50702983", "text": "def findCategoryID(community_id, category_title)\n category_found = false\n no_next_link = false\n offset = 0\n @@category_id = '_'\n\n until category_found or no_next_link\n getAllCategories(community_id, \"offset:#{offset},limit:100\")\n response_content = JSON.parse(@@response.body)['content']\n category = response_content.select{|h1| h1['title'] == category_title}.first\n category_found = !(category.nil?)\n @@category_id = category['id'] if category_found\n no_next_link = !((JSON.parse(@@response.body)['links'].select{|h1| h1['rel'] == 'next'}).nil?)\n offset += 100 unless no_next_link\n end\n end", "title": "" }, { "docid": "7d3ab7a638338ac5909da55e7daaba83", "score": "0.506336", "text": "def categories()\n db = connect()\n db.execute('SELECT * FROM categories')\n end", "title": "" }, { "docid": "7ec312f3c1430e14a583a389a38488e4", "score": "0.50518274", "text": "def uhook_index_search_subject\n ::Category.locale(current_locale, :all)\n end", "title": "" }, { "docid": "1bcba4a3ca25c4dd0f5c4fdc586eb2d5", "score": "0.5036052", "text": "def with_globalize(conditions = {})\n Products::Categories::Finder.with_globalize(conditions)\n end", "title": "" }, { "docid": "c921cf2d0a0f7565b979d11caafcc582", "score": "0.50336426", "text": "def title\n @category.split(':')[@depth-1].to_s.strip\n end", "title": "" }, { "docid": "b86f90644799c34feca57ec3e29d972b", "score": "0.5033187", "text": "def category\n categories.collect(&:title).join(',')\n end", "title": "" }, { "docid": "e121d21472fb6935a7578161e72211e5", "score": "0.5026808", "text": "def by_category\n @category = Category.roots.find_by_slug(params[:category])\n raise ListingException, \"missing category\" if @category.blank?\n @subcategory = @category.children.find_by_slug(params[:subcategory]) if params[:subcategory].present?\n terms = [ListingFilter.category(@subcategory.present? ? @subcategory.id : @category.id), ListingFilter.state('active')]\n query = {filter: {bool: {must: terms}}, sort: {id: \"desc\"}}\n @listings = Listing.search(query).page(page).per(per).records\n\n @subcategories = @category.children.with_listings\n\n @title = [@category.name, @subcategory.try(:name)].compact.join(\" : \") + \" | Category\"\n\n respond_to do |format|\n format.html { render(action: :index, layout: !request.xhr?) }\n end\n end", "title": "" }, { "docid": "99f556cf1cee45bb926693bc0797098f", "score": "0.5025467", "text": "def getCategories(_, _, _)\n @db.categories\n end", "title": "" }, { "docid": "6c6ddf990c827aa5920c55b52a3c23b0", "score": "0.49806714", "text": "def categories\n @categories ||= wayfinder.decorated_vocabularies.sort_by(&:label)\n end", "title": "" }, { "docid": "7d246ddef94b5e3e103c9723a750ad80", "score": "0.49652863", "text": "def categories\n Hash[self.class.catalogs.map { |fld, klass|\n name = fld.gsub(/_id$/, '_name');\n [fld, {:id => self.send(fld), :name => self.send(name)}] rescue nil\n }.reject {|cat| cat.nil?}]\n end", "title": "" }, { "docid": "094fa59fcabbe27ff9c2f1b71afe5afa", "score": "0.49587047", "text": "def category(id = nil)\n res = Connection.get('categories', id)\n id.nil? ? Category.all(res) : Category.new(res)\n end", "title": "" }, { "docid": "a6bfe51b41328120f3b08a877d628f7d", "score": "0.4952134", "text": "def by_title(title)\n Pages::Finder.by_title(title)\n end", "title": "" }, { "docid": "4115ac858a82882fa4987b5642c7af26", "score": "0.4937255", "text": "def categories\n add_to_query restrict_kind: 'category'\n end", "title": "" }, { "docid": "2dfd2935bf91e980ebf6a32008f66535", "score": "0.49087015", "text": "def get_all_category_words\n rows = Category.find_by(name: self.chosen_category_name).translations\n rows.map {|row| \"#{row.english} => #{row.send(self.chosen_language_name.downcase)}\"}\n end", "title": "" }, { "docid": "bb6d3071d2951076375071710d5983af", "score": "0.48973593", "text": "def category_name\n category = Category.find_by_id(self.category_id)\n return category.name\n end", "title": "" }, { "docid": "f078c51b00680ac3d94ad346552fc0fe", "score": "0.48797467", "text": "def find_category(specified_category)\n if specified_category.is_a?(String) || specified_category.is_a?(Symbol)\n Category.find_by_name(specified_category)\n else\n Category.find_by_id(category_id)\n end\n end", "title": "" }, { "docid": "0b5bdad955e171943a72f58786c43966", "score": "0.48745862", "text": "def search_for_title(title)\n parameters = {\n 'folderId' => find_public_folder,\n 'q' => \"title = '#{title}'\", # full_title\n 'fields' => 'items/id'}\n client = google_api_client\n drive = client.discovered_api('drive', 'v2')\n result = client.execute(:api_method => drive.children.list,\n :parameters => parameters)\n if result.status == 200\n if result.data.items.length > 0\n result.data.items[0]['id']\n elsif result.data.items.length == 0\n nil\n else\n nil\n end\n end\n end", "title": "" }, { "docid": "5ed4dfbe98f81f33e99e198e6660eae6", "score": "0.48592317", "text": "def find_category(cate_id)\n category = Category.find_by(id: cate_id).name\n end", "title": "" }, { "docid": "374b30d6be01540f6b885e75f01fbbd0", "score": "0.48565525", "text": "def find_topic(category_name, forum_name, topic_title, options = {})\n forum = self.find_forum(category_name, forum_name, options)\n if forum\n self.topics(forum['id'], options).detect {|t| t['title'] == topic_title}\n end\n end", "title": "" }, { "docid": "4949a10e30e5d9a734dda52bd4a39ab4", "score": "0.48563737", "text": "def category_name \n self.category ? self.category.name : nil\n end", "title": "" }, { "docid": "56d10198481012ce9b4588e696c6e074", "score": "0.4854875", "text": "def compare_catetegory category_name\n condition=\"%#{category_name}%\"\n category=Category.where(\"name like ? \",condition).first\n if category.nil?\n category=Category.create name:category_name\n end\n return category\n end", "title": "" }, { "docid": "1eec05751017ffcb0838494d6e39bd6d", "score": "0.48411804", "text": "def categories options = {}\n perform_get_with_object(\"/categories\", options, Vimeo::Entities::Category)\n end", "title": "" }, { "docid": "72a658ad744d014fe3342442e1ccc06a", "score": "0.48366264", "text": "def find(category_id)\n response, status = BeyondApi::Request.get(@session, \"/categories/#{category_id}\")\n\n handle_response(response, status)\n end", "title": "" }, { "docid": "e29454de41dd2a376255e0a3dbeb9305", "score": "0.4830853", "text": "def categories(params={})\n return @categories if (@categories && !params[:force])\n @categories = get_categories\n end", "title": "" }, { "docid": "e2c4a44d0b2f2af0db00f23dc241ca04", "score": "0.48302865", "text": "def category_names\n self.categories.map do |category|\n category.name\n end\n end", "title": "" }, { "docid": "a0254045a3dc4ed5a3bc92332ef36078", "score": "0.48081014", "text": "def categories\n pages = page.children.all(\n :conditions => { :class_name => 'ShopCategoryPage' },\n :order => 'pages.position ASC'\n ).map(&:shop_category)\n end", "title": "" }, { "docid": "bab3241f6e267e3ff50899190aef98b3", "score": "0.48006532", "text": "def category_name\n category.name\n end", "title": "" }, { "docid": "1126374d13b242e47e7429c19311afe3", "score": "0.47985178", "text": "def categories(options = {})\n options = options.merge(:facets => 'category', :facet_num_results => 100, :num_results => 0)\n search('*:*', options).facets['category'].values\n end", "title": "" }, { "docid": "74ed35929e392450d9799c08d02090a1", "score": "0.479224", "text": "def categories_attributes=(attributes)\n attributes.each do |index, attribute|\n unless attribute[:title].blank? || self.categories.map(&:title).include?(attribute[:title])\n existing_category = self.categories[index.to_i]\n if existing_category == nil\n new_category = Category.create(title: attribute[:title])\n self.categories << new_category\n else\n existing_category.update(title: attribute[:title])\n end\n end\n end\n end", "title": "" }, { "docid": "fce6082ca57fca571f1d6121c0194b3b", "score": "0.47913405", "text": "def categories_list\n self.categories.collect{|c| c.name}\n end", "title": "" }, { "docid": "ece9658361830b06eed2f3b44fcc20c9", "score": "0.47807747", "text": "def load_category\n @category = Category.friendly.find(params[:id])\n end", "title": "" }, { "docid": "91847f049e51f3171bdf23c76fcb7ad6", "score": "0.47721773", "text": "def find_by_title(*opts)\n find_by_titles(opts).pages.first\n end", "title": "" }, { "docid": "1dc58330e2ccd0a770af185534a1a663", "score": "0.47682947", "text": "def find_agenda_item_categories\n @categories = AgendaItemCategory.all(:order => 'name')\n end", "title": "" }, { "docid": "4de0189e6aa1620732542b4b2a4e842e", "score": "0.47678372", "text": "def category_object\n task = Todo.find_by_id(self.todo_id)\n category = Categories.find_by_id(task.category_id)\n return category\n end", "title": "" }, { "docid": "dc7fbf0c33108d30310bbdbd4b5ce598", "score": "0.47657433", "text": "def category\n Topic.find(self.category_id)\n end", "title": "" }, { "docid": "e4b4363601b674943a0e0125092bf6c9", "score": "0.47642973", "text": "def categories\n notify Category.all(:order => \"name ASC\").collect {|c| c.name_with_id }.join(\"\\n\")\n end", "title": "" }, { "docid": "48cb2dae095e4eeb710deb9c74ebcdf0", "score": "0.4762173", "text": "def get_categories(query_obj=nil)\n uri = URI.parse(@uri + \"/Categories\")\n results = get(uri,query_obj)\n end", "title": "" }, { "docid": "134f49da21ceae8ca39df629eaed061d", "score": "0.47603607", "text": "def index\n authorize! :read, Category\n if params[:search] \n @categories = Category.includes(:related_categories, :suggested_categories).where(\"lower(name) LIKE :search\",{search: \"%#{params[:search].downcase}%\"}).order( :name )\n else\n @categories = Category.includes(:related_categories, :suggested_categories).all.order( :name )\n end\n end", "title": "" }, { "docid": "4cad441fc2edc0ac193aa29d35e9271c", "score": "0.47565785", "text": "def main_category_titles\n main_categories.map(&:title)\n end", "title": "" }, { "docid": "cb712dacf025b0abea91960561721593", "score": "0.47553647", "text": "def get_related_categories(query='', results=10, start=0)\r\n get_related('Categories',query, results, start)\r\n end", "title": "" }, { "docid": "ba972d2983e7117f6a5b8f7e60d47cf5", "score": "0.47417703", "text": "def category\n client.categories.find(data[\"categoryId\"])\n end", "title": "" }, { "docid": "d3c0c880aa2f5f1e5ca607f34f645cbf", "score": "0.4740375", "text": "def find_book_by_title(book_title)\n books = @books\n for book in books\n if (book[:title] == book_title)\n return book\n end\n end\n return nil\n end", "title": "" }, { "docid": "818d00766832efb73da2ab117c61b27e", "score": "0.4737057", "text": "def set_categories\n @categories = Category.order(:name).pluck(:name, :id)\n end", "title": "" }, { "docid": "35802ecc80da3ace95df8f771700702b", "score": "0.47370544", "text": "def GetCategories params = {}\n\n params = params.merge(path: 'categories.json')\n APICall(params)\n\n end", "title": "" }, { "docid": "08616b94c72aa224335305a6991560a4", "score": "0.47253674", "text": "def load_categories\n q = @db.query(\"select t.term_id, t.name, t.slug\n from wp_terms as t join wp_term_taxonomy as x\n on t.term_id = x.term_id\n where x.taxonomy = 'category'\")\n\n q.each_hash { |c| os = OpenStruct.new(c) ; @categories[os.term_id.to_i] = OpenStruct.new(c) }\n end", "title": "" }, { "docid": "d3eddeb9c8242f15e9af5f9b8d05d333", "score": "0.4724465", "text": "def title\n title = \"No Title\"\n if (@language.present?)\n nt = NewsTitle.where(news_id: self.id).where(language: @language)\n if (nt != nil && nt.size > 0)\n title = nt.first.title\n end\n end\n\n title\n end", "title": "" }, { "docid": "bb095def1a3fb8604bb5da808334c256", "score": "0.47162393", "text": "def category_title\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 6 )\n value = nil\n title13 = nil\n\n begin\n # at line 74:37: ';' ( WS )? 'title' '=' '\\\"' title '\\\"'\n match(T__11, TOKENS_FOLLOWING_T__11_IN_category_title_240)\n # at line 74:41: ( WS )?\n alt_10 = 2\n look_10_0 = @input.peek(1)\n\n if (look_10_0 == WS)\n alt_10 = 1\n end\n case alt_10\n when 1\n # at line 74:41: WS\n match(WS, TOKENS_FOLLOWING_WS_IN_category_title_242)\n\n end\n match(T__16, TOKENS_FOLLOWING_T__16_IN_category_title_245)\n match(T__13, TOKENS_FOLLOWING_T__13_IN_category_title_247)\n match(T__14, TOKENS_FOLLOWING_T__14_IN_category_title_249)\n @state.following.push(TOKENS_FOLLOWING_title_IN_category_title_251)\n title13 = title\n @state.following.pop\n match(T__14, TOKENS_FOLLOWING_T__14_IN_category_title_253)\n # --> action\n value = (title13 && @input.to_s(title13.start, title13.stop))\n # <-- action\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 6 )\n\n end\n\n return value\n end", "title": "" }, { "docid": "8bb01edfcce95632b2bf7518d87c4027", "score": "0.47089592", "text": "def find_collection_by_title(val)\n val_pattern = /#{val.to_s.downcase.gsub(/\\s/, '')}/\n worksheet = self.spreadsheet.worksheets.find { |w| w.title.downcase.gsub(/\\s/, '') =~ val_pattern }\n raise CollectionNotFound, \"No worksheet found '#{val}'! Please try again.\" unless worksheet\n Collection.new(self, worksheet)\n end", "title": "" }, { "docid": "d0144a2ca50f06c6d77ecc6a403a79f6", "score": "0.47054985", "text": "def show_cat\n @categories = Category.parent_categories\n if params[:sort]\n @products = Product.where(category_id: @category.id).order(params[:sort]).page(params[:page]).per(9)\n else\n @products = Product.where(category_id: @category.id).order(:title).page(params[:page]).per(9)\n end\n end", "title": "" }, { "docid": "2610e20ed10bb7982e457d3431acfba4", "score": "0.4705093", "text": "def categories\r\n return handle_resource_not_found unless @article_category\r\n\r\n add_category_breadcrumbs(@article_category)\r\n if @article_category.leaf?\r\n @title_text = @article_category.display_text\r\n @articles = fetch_articles(order_by, nil, :conditions => {:article_category_id => @article_category.id}, :include => [:user, :article_category])\r\n @other_recent_posts = @article_category.parent.all_recent_posts(:exclude_category => @article_category) if @article_category.parent\r\n render 'articles/subcategories'\r\n else\r\n return unless check_category_for_stale\r\n @subcategories_with_posts = @article_category.children.with_published_articles\r\n render 'articles/categories'\r\n end\r\n end", "title": "" }, { "docid": "5f761ef3d4c23a1096bba290fd9a859e", "score": "0.4698566", "text": "def index\n @q = SearchParams.new(params[:search_params] || {})\n @categories = Category.default_where(@q.attributes(self)).order(:mode).page(params[:page]).per(10)\n end", "title": "" }, { "docid": "b970329baab37186c23ce7c412677aa8", "score": "0.4697795", "text": "def title_issues(title)\n issues_array = self.issues.select do |issue|\n issue.comic.title == title\n end\n issues_array.sort\n end", "title": "" }, { "docid": "f6987450b882eb5e0d5387de370a340e", "score": "0.46914577", "text": "def category_label\n Categories::LABELS[category]\n end", "title": "" }, { "docid": "9733bf14f40fb13fe0a480624b1bdd27", "score": "0.46794045", "text": "def find(category_query, search_query, page)\n if access_open(category_query, search_query)\n category(category_query).search(escape(search_query), page: page, per_page: 10)\n end\n end", "title": "" }, { "docid": "2100dc4f900894dff49f67678ca533ad", "score": "0.46689737", "text": "def [](key)\n @children.find { |c| c.title == key }\n end", "title": "" }, { "docid": "06463b89a67c9e3ec1508d1c5af774f6", "score": "0.46666887", "text": "def find_by_title(title, options = {})\n options = {\n limit: nil,\n types: %w(title_popular title_exact title_approx title_substring)\n }.merge!(options)\n\n result = self.class.get('http://www.imdb.com/xml/find', :query => {\n :q => title,\n :json => '1',\n :tt => 'on'\n }).parsed_response\n\n results = []\n\n options[:types].each do |key|\n if result[key]\n result[key].each do |row|\n break unless results.size < options[:limit] if options[:limit]\n next unless row['id'] && row['title'] && row['description']\n\n title = {\n type: key,\n imdb_id: row['id'],\n title: row['title'],\n release_year: row['description'].scan(/\\A\\d{4}/).first\n }\n\n results << title\n end\n end\n end\n\n results\n end", "title": "" }, { "docid": "433f18c5d5684c13d47074eb66d68ca3", "score": "0.46611843", "text": "def find_by_title(todo_title)\n select { |todo| todo.title == todo_title }.first\n end", "title": "" }, { "docid": "e78faac6d84bca25aeabf41c789c6fb8", "score": "0.46596527", "text": "def get_category_names \n @data.search(\"div.award h1\").collect { |title| title.text }\n end", "title": "" }, { "docid": "53906febac1101fb1a743d803e675306", "score": "0.46577382", "text": "def category_title\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 6 )\n value = nil\n title13 = nil\n\n begin\n # at line 47:37: SEMICOLON ( WS )? TITLE EQUALS QUOTE title QUOTE\n match( SEMICOLON, TOKENS_FOLLOWING_SEMICOLON_IN_category_title_237 )\n # at line 47:47: ( WS )?\n alt_10 = 2\n look_10_0 = @input.peek( 1 )\n\n if ( look_10_0 == WS )\n alt_10 = 1\n end\n case alt_10\n when 1\n # at line 47:47: WS\n match( WS, TOKENS_FOLLOWING_WS_IN_category_title_239 )\n\n end\n match( TITLE, TOKENS_FOLLOWING_TITLE_IN_category_title_242 )\n match( EQUALS, TOKENS_FOLLOWING_EQUALS_IN_category_title_244 )\n match( QUOTE, TOKENS_FOLLOWING_QUOTE_IN_category_title_246 )\n @state.following.push( TOKENS_FOLLOWING_title_IN_category_title_248 )\n title13 = title\n @state.following.pop\n match( QUOTE, TOKENS_FOLLOWING_QUOTE_IN_category_title_250 )\n # --> action\n value = ( title13 && @input.to_s( title13.start, title13.stop ) ) \n # <-- action\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 6 )\n\n end\n \n return value\n end", "title": "" }, { "docid": "33822f82cacc775d6fc381d1dd536395", "score": "0.46571568", "text": "def all_news_category_names\n categorizations = NewsItemCategorization.where(news_item_id: id)\n category_names = NewsCategory.where(id: categorizations.pluck(:news_category_id)).pluck(:name).join(', ')\n end", "title": "" }, { "docid": "3e11fcc157e4517d52f5cd8b4f3fa02b", "score": "0.46541274", "text": "def find_by_title(title)\n url = SEARCH_URL+\"#{URI.escape(title)}&first=yes\"\n Kinopoisk.fetch(url, proxies: @proxies, debug: @debug).headers['Location'].to_s.match(/\\/(\\d*)\\/$/)[1]\n end", "title": "" }, { "docid": "47c632e85e09046221e937d668437e77", "score": "0.46533492", "text": "def get_categories\n @categories = Category.all\n end", "title": "" }, { "docid": "6ffa0045a1efd3ac9d432c87b278baf7", "score": "0.46472675", "text": "def categories\n Category.categories_for_movie self\n end", "title": "" }, { "docid": "50410fd910a69f3e8a8d3fc19e64c4c1", "score": "0.46369812", "text": "def articles_with_category(category, posts=articles)\n posts.select { |article| has_category?(category, article) }\n end", "title": "" }, { "docid": "c8011fea627d79c42f5ef08b3ae03bc8", "score": "0.46333933", "text": "def categories\n if @categories.nil?\n @categories = []\n category_nodes =\n FeedTools::XmlHelper.try_xpaths_all(self.channel_node, [\n \"category\",\n \"dc:subject\"\n ])\n unless category_nodes.nil?\n for category_node in category_nodes\n category = FeedTools::Category.new\n category.term = FeedTools::XmlHelper.try_xpaths(category_node, [\n \"@term\",\n \"text()\"\n ], :select_result_value => true)\n category.term.strip! unless category.term.blank?\n category.label = FeedTools::XmlHelper.try_xpaths(\n category_node, [\"@label\"],\n :select_result_value => true)\n category.label.strip! unless category.label.blank?\n category.scheme = FeedTools::XmlHelper.try_xpaths(category_node, [\n \"@scheme\",\n \"@domain\"\n ], :select_result_value => true)\n category.scheme.strip! unless category.scheme.blank?\n @categories << category\n end\n end\n end\n return @categories\n end", "title": "" }, { "docid": "97acaf14520a5f8d29073ab312246710", "score": "0.46323663", "text": "def find_product_categories(opts = {})\n data, _status_code, _headers = find_product_categories_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "8a18fe210981ecd2177554c668ec27a7", "score": "0.46309137", "text": "def categories_items\n all_items = self.all_active_items\n categories_given_items(all_items)\n end", "title": "" } ]
82c97e89259bc94a4f68f0bd05855fc4
Validates that a network name exists. If it does not exist, an exception is raised.
[ { "docid": "4e9f4cc8435832863a648d4cd49c0858", "score": "0.84132564", "text": "def validate_network_name!(network_name, env)\n if !env[:machine].provider.driver.existing_named_network?(network_name)\n raise Errors::NetworkNameUndefined,\n network_name: network_name\n end\n true\n end", "title": "" } ]
[ { "docid": "ba22c6cd782a242fe1e1147ea0ce908f", "score": "0.7739829", "text": "def network_exists?(name)\n net_obj = Com::Vmware::Vcenter::Network.new(vapi_config)\n filter = Com::Vmware::Vcenter::Network::FilterSpec.new(names: Set.new([name]))\n net = net_obj.list(filter)\n\n raise format(\"Unable to find target network: %s\", name) if net.empty?\n end", "title": "" }, { "docid": "08658fd99c4d135fc06c5ecb6899344e", "score": "0.7572565", "text": "def network_exists?(name)\n net_api = VSphereAutomation::VCenter::NetworkApi.new(api_client)\n raise_if_unauthenticated net_api, \"checking for VM network `#{name}`\"\n\n nets = net_api.list({ filter_names: name }).value\n\n raise_if_missing nets, format(\"Unable to find target network: `%s`\", name)\n end", "title": "" }, { "docid": "6d4fabc526121a5743fd5f96084aa5cf", "score": "0.72823703", "text": "def network_exists?(network_name)\n networks_list.include?(network_name)\n end", "title": "" }, { "docid": "1a9db6296a22239752461ad68bf23e06", "score": "0.64103615", "text": "def exists?(resource_group_name)\n OOLog.fatal('VNET name is nil. It is required.') if @name.nil?\n OOLog.info(\"Checking if Virtual Network '#{@name}' Exists! ...\")\n begin\n result = @network_client.virtual_networks.check_virtual_network_exists(resource_group_name, @name)\n rescue MsRestAzure::AzureOperationError => e\n OOLog.fatal(\"Error getting virtual network: #{@name} from resource group #{resource_group_name}. Exception: #{e.body}\")\n rescue => ex\n OOLog.fatal(\"Error getting virtual network: #{@name} from resource group #{resource_group_name}. Exception: #{ex.message}\")\n end\n result\n end", "title": "" }, { "docid": "e95e6208ba434962d5d5804d0acaf2c6", "score": "0.63604665", "text": "def exists?(resource_group_name)\n OOLog.fatal('VNET name is nil. It is required.') if @name.nil?\n\n begin\n OOLog.info(\"Checking if Virtual Network '#{@name}' Exists! ...\")\n promise = @client.virtual_networks.get(resource_group_name, @name)\n response = promise.value!\n OOLog.info('VNET EXISTS!!')\n return true\n rescue MsRestAzure::AzureOperationError => e\n OOLog.info(\"Exception from Azure: #{e.body}\")\n # check the error\n # If the error is that it doesn't exist, return true\n OOLog.info(\"Error of Exception is: '#{e.body.values[0]}'\")\n OOLog.info(\"Code of Exception is: '#{e.body.values[0]['code']}'\")\n if(e.body.values[0]['code'] == 'ResourceNotFound')\n OOLog.info('VNET DOES NOT EXIST!!')\n return false\n else\n # for all other errors, throw the exception back\n OOLog.fatal(\"Error getting virtual network: #{@name} from resource group #{resource_group_name}. Exception: #{e.body}\")\n end\n rescue => ex\n OOLog.fatal(\"Error getting virtual network: #{@name} from resource group #{resource_group_name}. Exception: #{ex.message}\")\n end\n end", "title": "" }, { "docid": "7ee3465d31ba374d86d25525f26217cc", "score": "0.6048537", "text": "def validate_network_configuration!(network_name, root_options, network_options, driver)\n if root_options[:ip] &&\n driver.network_containing_address(root_options[:ip]) != network_name\n raise Errors::NetworkAddressInvalid,\n address: root_options[:ip],\n network_name: network_name\n end\n if network_options[:subnet] &&\n driver.network_containing_address(network_options[:subnet]) != network_name\n raise Errors::NetworkSubnetInvalid,\n subnet: network_options[:subnet],\n network_name: network_name\n end\n true\n end", "title": "" }, { "docid": "1a30dbc861f6797bf265ebb1e0700e82", "score": "0.59856987", "text": "def ensure_valid_network\n if valid_network.nil?\n self.build_valid_network(:tag => \"#{self.tag} Asset Config Network\")\n end\n end", "title": "" }, { "docid": "abc40313f8a0c558d23c0c27f1de1e45", "score": "0.5686097", "text": "def find_network(name)\n @networks.find { |nw| nw.name == name }\n end", "title": "" }, { "docid": "e9d09c59a0dae89932c43123423400b5", "score": "0.5673746", "text": "def ensure_name_availability!(name)\n raise 'Name already in use' if kvm_exists?(name)\nend", "title": "" }, { "docid": "6b7d3067df9d94e17a79370571a63cf2", "score": "0.5662899", "text": "def CheckNetwork(network)\n CheckNetwork4(network) || CheckNetwork6(network)\n end", "title": "" }, { "docid": "40c63944c0a5fb527e2ab40c499af0bb", "score": "0.5624763", "text": "def valid_name!\n return unless @name.blank?\n\n @success = false\n @error = 'Error: site name must be present'\n end", "title": "" }, { "docid": "ca011fdb3a178132e9dfe3f6cfde5331", "score": "0.5616302", "text": "def check_network(options, attributes)\n env.logger.info \"Checking network\"\n if options.nil? or options.empty? or options[\"network_type\"].nil? or options[\"network_type\"] == \"network\"\n check_default_network\n attributes[:network_interface_type] = \"network\"\n elsif options[\"network_type\"] == \"bridge\"\n options[\"network_bridge_name\"].nil?\n if options[\"network_bridge_name\"].nil?\n raise Veewee::Error, \"You need to specify a 'network_bridge_name' if you plan to use 'bridge' as network type\"\n else\n attributes[:network_interface_type] = \"bridge\"\n attributes[:network_bridge_name] = \"#{options[\"network_bridge_name\"]}\"\n end\n else\n raise Veewee::Error, \"You specified a 'network_type' that isn't known (#{options[\"network_type\"]})\"\n end\n end", "title": "" }, { "docid": "1d38a1d1e353dd09cc52883154b3cb4f", "score": "0.555064", "text": "def ValidNetwork\n # TRANSLATORS: description of the valid network definition\n _(\n \"A valid network definition can contain the IP,\\n\" +\n \"IP/Netmask, IP/Netmask_Bits, or 0/0 for all networks.\\n\" +\n \"\\n\" +\n \"Examples:\\n\" +\n \"IP: 192.168.0.1 or 2001:db8:0::1\\n\" +\n \"IP/Netmask: 192.168.0.0/255.255.255.0 or 2001:db8:0::1/56\\n\" +\n \"IP/Netmask_Bits: 192.168.0.0/24 or 192.168.0.1/32 or 2001:db8:0::1/ffff::0\\n\"\n )\n end", "title": "" }, { "docid": "0002c411c54733ea192c7f687741a5ca", "score": "0.5548655", "text": "def valid?\n (ip.nil? || name.nil?) ? false : true\n end", "title": "" }, { "docid": "2ae2294cab0faf4f56de88270e66f493", "score": "0.5525873", "text": "def edge_net?(network_name:)\n @networks_nodes[network_name].nil? || @networks_nodes[network_name].length == 1\n end", "title": "" }, { "docid": "acd2d50efb1a8a1a28b4b95f0ff36d41", "score": "0.54614204", "text": "def test_should_require_name\n ng = NodeGroup.create(:name => nil)\n assert ng.errors.on(:name)\n end", "title": "" }, { "docid": "572914a2aa19e86f1529bd6f6deb7451", "score": "0.54117244", "text": "def use_existing_network?\n return false unless configured?\n\n @gcp_config['use_existing_network']\n end", "title": "" }, { "docid": "fcd1cc69fadef097d208c68f0cc2f3b6", "score": "0.5393872", "text": "def ensure_network\n ensure_valid_network\n if network.nil?\n valid_network.build_network(:tag => \"#{self.tag} View\")\n end\n end", "title": "" }, { "docid": "9e202d4b011be23d083541d7af9441d9", "score": "0.5362974", "text": "def use_existing_network?\n @gcp_config['use_existing_network']\n end", "title": "" }, { "docid": "f3961b8ac67ed0a698c9683e8d259274", "score": "0.53483933", "text": "def has_node_with_name?(name)\n !find_node_by_name(name).nil?\n end", "title": "" }, { "docid": "c9b2c49991d6a72f1431ad9dd340cde5", "score": "0.5348285", "text": "def valid?\n (internal_ip.nil? || name.nil?) ? false : true\n end", "title": "" }, { "docid": "d0d4ddd09f07d754a4a78d3884d4da84", "score": "0.53247726", "text": "def network n\n @logger.debug \"OpenStack: Looking up network '#{n}'\"\n @network_client.networks.find { |x| x.name == n } || raise(\"Couldn't find network: #{n}\")\n end", "title": "" }, { "docid": "4141def7ed9fcaae1c5d8a8750d27513", "score": "0.5314657", "text": "def valid?\n !name.nil?\n end", "title": "" }, { "docid": "4141def7ed9fcaae1c5d8a8750d27513", "score": "0.5314657", "text": "def valid?\n !name.nil?\n end", "title": "" }, { "docid": "4141def7ed9fcaae1c5d8a8750d27513", "score": "0.5314657", "text": "def valid?\n !name.nil?\n end", "title": "" }, { "docid": "3de2836d2746a677d5b896b00db34472", "score": "0.53106534", "text": "def given_account_exists( name )\n if send( name ).present?\n errors.add( name, I18n.t( 'sir_logs.msg.account_nonexist' )) \\\n unless Account.exists?( send( name ))\n end\n end", "title": "" }, { "docid": "963b612bb5c9f64ccabb2fb24e2e6d2f", "score": "0.53086156", "text": "def get_networkid(network_name)\n network_res = find_match(@network.networks, network_name)\n network_to_use = (network_res != nil) ? network_res.id.to_s : nil\n if network_to_use.nil?\n Puppet.crit \"The network is not found on cloud account!, network_name => #{network_name}\"\n raise Puppet::Error, \"The network is not found on cloud account!, network_name => #{network_name}\"\n else\n Puppet.notice \"Network '#{network_name}' found : '#{network_to_use}'\"\n end\n return network_to_use\n end", "title": "" }, { "docid": "a9fecc914106dfefb3aad6c1d80d11c5", "score": "0.5305903", "text": "def name_invalid\n errors.add(:name, :unknown)\n end", "title": "" }, { "docid": "c76c30522dd8a807d8945e744fb2b0c3", "score": "0.5276594", "text": "def valid_name?(nm)\n\t\treturn false unless (nm =~ VALID_NAME)\n\t\ttrue\n\tend", "title": "" }, { "docid": "afcbeb21305f9e209550e596ebd99787", "score": "0.52408934", "text": "def exists?\n File.directory?(\"/sys/class/net/#{name}\").tap do |exists|\n deconfigure unless exists || @clean\n end\n end", "title": "" }, { "docid": "9b3c65be402760fb5d8f6f7d72f9a28f", "score": "0.5229557", "text": "def validate_name\n\t\t\tunless Nacreon::NameRX.match(name)\n\t\t\t\terrors.add(:name,\n\t\t\t\t\t'must contain only letters, numbers, and \"-\".')\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "1bd23f920677096f33b9454cf3986655", "score": "0.5228432", "text": "def name_is_valid?\n return false unless not_nil_and_string(self.name)\n return self.name.length > 0\n end", "title": "" }, { "docid": "1bd23f920677096f33b9454cf3986655", "score": "0.5228432", "text": "def name_is_valid?\n return false unless not_nil_and_string(self.name)\n return self.name.length > 0\n end", "title": "" }, { "docid": "773f234889be2bf63e6bda9cb1bd8a16", "score": "0.51975036", "text": "def delete_network(network_name)\n return if !configured? || !network_exists?(network_name)\n\n @service.delete_network(@gcp_config['project'], network_name)\n rescue StandardError => e\n @logger.error(e.message)\n end", "title": "" }, { "docid": "213ff17a4aa6a81924b0792dd8fee91b", "score": "0.51921093", "text": "def name_is_valid\n errors.add(:name,\"Invalid string for name.\") unless name_is_valid?\n end", "title": "" }, { "docid": "3b3ffd4f1f1b597957c91a39ce6cea76", "score": "0.5174165", "text": "def name_valid(name)\n if !name.empty?\n self.name = name\n return true\n end\n end", "title": "" }, { "docid": "b27a210e7e8f32ef6e7ce0713b56b02e", "score": "0.5144072", "text": "def name_exists?(name)\n return false unless name_detector.present?\n\n name_detector.name_exists?(name)\n end", "title": "" }, { "docid": "b27a210e7e8f32ef6e7ce0713b56b02e", "score": "0.5144072", "text": "def name_exists?(name)\n return false unless name_detector.present?\n\n name_detector.name_exists?(name)\n end", "title": "" }, { "docid": "899ca4d7d1e4657d7c1278d87660e71d", "score": "0.5122808", "text": "def validate_name\n if third_party && name.blank?\n errors.add(\n :name,\n :blank,\n )\n end\n end", "title": "" }, { "docid": "4e8965f45b61345de5ebd05aba727f0c", "score": "0.51217526", "text": "def exists?(name)\n begin\n g = list([name.to_s])\n rescue ::AWS::InvalidGroupNotFound\n return false \n end\n \n !g.empty?\n end", "title": "" }, { "docid": "932183958aac1c3748a6ab381410805d", "score": "0.5119129", "text": "def name_valid(name)\n if !name.empty?\n self.name = name\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "d812fe3523c8be90ea212e6f6f813f01", "score": "0.5111262", "text": "def file_name_exist?(name)\n return true if !name.blank?\n errors.add(:name, \"Nazwa nie moze byc pusta!\")\n false\n end", "title": "" }, { "docid": "75a43562eebf3507eaae73b831892d9b", "score": "0.50948995", "text": "def delete_network(name)\n data = false\n conn = @ec2_main.environment.connection\n if conn != nil\n response = conn.delete_network(name)\n if response.status == 200\n data = response.body\n else\n data = {}\n end\n else\n raise \"Connection Error\"\n end\n return data\n end", "title": "" }, { "docid": "e879d3ce6c0ca55e057d9d58d270d723", "score": "0.5089741", "text": "def create\n @network = params[:network]\n @account = current_user.accounts[@network]\n raise RuntimeError if @account.nil? # TODO: What should we do here?\n # TODO: This stuff not tested yet.\n @account = SocialNetworkAccount.new(params[:user].merge(:network => @network))\n if @network.valid?\n @network.save!\n flash[:notice] = \"Successfully added the #{@network.name} network\"\n redirect_to session[:referrer]\n else\n render 'network/add'\n end\n end", "title": "" }, { "docid": "9dfbf9a80bbebba7a4655e26d207dc31", "score": "0.50836647", "text": "def network_params\n params.require(:network).permit(:name)\n end", "title": "" }, { "docid": "4fa4064d12f61fcd5e5cf0f5747fe507", "score": "0.5080573", "text": "def verify_networks(networks_in_zone, zone_name)\n b_verify_ok = true\n networks_in_zone.each do |network_name, network_data|\n $log.debug(\"Verifying network \\'#{network_name}\\'\")\n\n bridge_name = network_name\n\n $log.debug 'checking bridge ...'\n # we should have a bridge with that name.\n if @handler.handle_bridge(bridge_name) == false\n network_data.store :status, :failed\n b_verify_ok = false\n mark(\"Bridge \\'#{bridge_name}\\' does not exist.\",\n :network, network_name, network_data)\n else\n network_data.store :status, :ok\n\n hostip = network_data[:hostip]\n # if we have a host ip, then that bridge should have\n # this ip\n if hostip\n $log.debug 'checking host-ip ...'\n\n # if the hostip is not in cidr, take netmask\n # from network entry, add to hostip\n hostip = ensure_hostip_netmask(hostip, network_data)\n\n if @handler.handle_hostip(bridge_name, hostip) == false\n network_data.store :status, :failed\n b_verify_ok = false\n mark(\"Host ip \\'#{hostip}\\' not up on bridge \\'#{bridge_name}\\'.\",\n :network, network_name, network_data)\n else\n network_data.store :status, :ok\n end\n end\n\n # if we have dhcp, check this\n dhcp_data = network_data[:dhcp]\n if dhcp_data\n $log.debug 'checking dhcp ...'\n if @handler.handle_dhcp(zone_name, network_name, network_data,\n dhcp_data[:start],\n dhcp_data[:end]) == false\n network_data.store :status, :failed\n b_verify_ok = false\n mark(\"dnsmasq/dhcp not configured on network \\'#{bridge_name}\\'.\",\n :network, network_name, network_data)\n else\n network_data.store :status, :ok\n end\n end\n end\n end\n b_verify_ok\n end", "title": "" }, { "docid": "24bd9131cadfbed91fc98ae295bef0c3", "score": "0.5077187", "text": "def exist?\n self.class.exists?(dn)\n end", "title": "" }, { "docid": "242578b526533611efdabeecb0709663", "score": "0.5075318", "text": "def invalid?(save_name)\n save_name.include?(\"http\")\n end", "title": "" }, { "docid": "a998b5f4c5938498f8ed06d15b303bbf", "score": "0.50630313", "text": "def name_is_valid\n errors.add(:name,'Invalid empty string for name.') unless name_is_valid?\n end", "title": "" }, { "docid": "874d99e73790a5edd07f6da9a62233f3", "score": "0.5060337", "text": "def validate_name(name)\n return if name =~ /\\A[a-z0-9]+[-\\/][a-z][a-z0-9_]*\\Z/i\n\n namespace, modname = name.split(/[-\\/]/, 2)\n modname = :namespace_missing if namespace == ''\n\n err = case modname\n when nil, '', :namespace_missing\n \"the field must be a namespaced module name\"\n when /[^a-z0-9_]/i\n \"the module name contains non-alphanumeric (or underscore) characters\"\n when /^[^a-z]/i\n \"the module name must begin with a letter\"\n else\n \"the namespace contains non-alphanumeric characters\"\n end\n\n raise ArgumentError, \"Invalid 'name' field in metadata.json: #{err}\"\n end", "title": "" }, { "docid": "cffdc15bd0edca191aed8b0ee7c2521c", "score": "0.5041151", "text": "def network?\n if matches = match(/\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(\\/\\d{1,2})/)\n matches.captures[0]\n else \n false\n end\n end", "title": "" }, { "docid": "b6b85c7ee43796c1bc4d0f9758d07fc9", "score": "0.5040005", "text": "def validate_domain(name)\n jid = Blather::JID.new(name)\n raise \"incorrect domain: #{name}\" if jid.node || jid.resource\n end", "title": "" }, { "docid": "3b7fabf5c2f952954823d9450422d811", "score": "0.5032728", "text": "def find_net(name)\n cmd = \"docker network ls -q --filter label=#{label_pair(:name, name)}\"\n netid = `#{cmd}`.chomp\n return netid unless netid.empty?\n nil\n end", "title": "" }, { "docid": "1f7cc9441ef01d38cb1be579b4918480", "score": "0.50324917", "text": "def name_valid?\n\t\tif self.name == nil\n\t\t\treturn false\n\t\telsif VALID_NAME_REGEX !~ self.name || self.name.empty? || self.name.length > MAX_CREDENTIAL_LENGTH\n\t\t\treturn false\n\t\tend\n\t\ttrue\n\tend", "title": "" }, { "docid": "8284e71cc84d4cd32cd53c40ab3d066a", "score": "0.50301605", "text": "def validate_server(name)\n return true unless name # if no name is provided, just go with the defaults\n valid = name.is_a? String\n begin\n u = URI.parse(name)\n valid = false unless u.class == URI::HTTP || u.class == URI::HTTPS\n rescue URI::InvalidURIError\n valid = false\n end\n valid || raise(Exceptions::InvalidOptions, 'Invalid server')\n end", "title": "" }, { "docid": "011a9e8cfeb6d0e126064cc4fe4c3eaa", "score": "0.50113785", "text": "def node_exists?(name)\n exists?(\"node\", name)\n end", "title": "" }, { "docid": "aadc81d09e515974e272038472c1867c", "score": "0.5006279", "text": "def validateName(name)\n if (name == nil)\n return false\n end\n \n return true # TODO This is wrong. Finish this function.\nend", "title": "" }, { "docid": "9dfabb5e47c43cd8088abb5335133a3c", "score": "0.49947044", "text": "def valid?\n return false if @name.nil?\n return true\n end", "title": "" }, { "docid": "bc4fc817b10069d6092a9325e46e8974", "score": "0.4988932", "text": "def exists?\n\t\tbegin\n\t\t\tdom\n\t\t\tdebug \"Domain %s exists? true\" % [resource[:name]]\n\t\t\ttrue\n\t\trescue Libvirt::RetrieveError => e\n\t\t\tdebug \"Domain %s exists? false\" % [resource[:name]]\n\t\t\tfalse # The vm with that name doesnt exist\n\t\tend\n\tend", "title": "" }, { "docid": "879333e1ee4031ab9468a1cfdabff0d3", "score": "0.4981766", "text": "def validate_server(name)\n return true unless name # if no name is provided, just go with the defaults\n\n valid = name.is_a? String\n begin\n u = URI.parse(name)\n valid = false unless u.is_a?(URI::HTTP) || u.is_a?(URI::HTTPS)\n rescue URI::InvalidURIError\n valid = false\n end\n valid || raise(Exceptions::InvalidOptions, 'Invalid server')\n end", "title": "" }, { "docid": "e9838fda863210eb404d010afec2c7da", "score": "0.4980103", "text": "def check_ip_format\n begin\n ::NetAddr.parse_net(\"#{ip}/#{subnet}\")\n rescue Exception => e\n self.errors.add(:subnet, :format, default: e.message)\n return false\n end\n end", "title": "" }, { "docid": "421ca580a2175917cc642967595e7fb1", "score": "0.49685076", "text": "def exist?\n not self.name.nil?\n end", "title": "" }, { "docid": "959f22fd8252d55d0a0196ba374f28dc", "score": "0.49647763", "text": "def exists?\n\n\t\tbegin\n\t\t\tdom\n\t\t\tdebug \"Domain %s exists? true\" % [resource[:name]]\n\t\t\ttrue\n\t\trescue Libvirt::RetrieveError => e\n\t\t\tdebug \"Domain %s exists? false\" % [resource[:name]]\n\t\t\tfalse # The vm with that name doesnt exist\n\t\tend\n\n\tend", "title": "" }, { "docid": "6cd844029ce4733cc0a8f35eaff3c440", "score": "0.49556464", "text": "def has_network?\n Friend.has_network?(self)\n end", "title": "" }, { "docid": "ef96b5ace37d6a07d1890cd82fd0b03f", "score": "0.49451256", "text": "def error_for_list_name(name)\n if @storage.all_lists.any? { |list| list[:name] == name }\n 'List name must be unique.'\n elsif !(1..100).cover?(name.size)\n 'List name must be between 1 and 100 characters.'\n end\nend", "title": "" }, { "docid": "f6b1214ca0352bcf418350dd5829333b", "score": "0.4944098", "text": "def _validate_name(name)\n if name =~ %r{/}\n results.add_error('name', 'The name of a spec should not contain ' \\\n 'a slash.')\n end\n\n if name =~ /\\s/\n results.add_error('name', 'The name of a spec should not contain ' \\\n 'whitespace.')\n end\n\n if name[0, 1] == '.'\n results.add_error('name', 'The name of a spec should not begin' \\\n ' with a period.')\n end\n end", "title": "" }, { "docid": "29ec61a0756d075a7bc9e12ec7dd3fa2", "score": "0.49394813", "text": "def make_sure_location_isnt_dubious!(name)\n return if name.blank? || Location.where(name: name).any?\n citations =\n Location.check_for_empty_name(name) +\n Location.check_for_dubious_commas(name) +\n Location.check_for_bad_country_or_state(name) +\n Location.check_for_bad_terms(name) +\n Location.check_for_bad_chars(name)\n return if citations.none?\n raise DubiousLocationName.new(citations)\n end", "title": "" }, { "docid": "c647b6e9e4c1ea603bbe8c7015dc4ebf", "score": "0.49372327", "text": "def validate_username\n if User.where(email: username).exists?\n errors.add(:username, :invalid)\n end\n end", "title": "" }, { "docid": "c647b6e9e4c1ea603bbe8c7015dc4ebf", "score": "0.49372327", "text": "def validate_username\n if User.where(email: username).exists?\n errors.add(:username, :invalid)\n end\n end", "title": "" }, { "docid": "36c6d0cd048ef97382a64d553abd47c4", "score": "0.49369848", "text": "def valid_name?(name)\n !!(name =~ NAME_REGEX)\n end", "title": "" }, { "docid": "265b2caf6a38232dfd8104b378074785", "score": "0.49221084", "text": "def network_name\n return self.class.generate_network_name(@configuration_id) unless use_existing_network?\n\n @gcp_config['network']\n end", "title": "" }, { "docid": "650b2d4e1a43dc176ec21ca955cfad4f", "score": "0.49215463", "text": "def missing_name?(name)\n if name.is_a? Symbol\n last_name = (missing_name || '').split('::').last\n last_name == name.to_s\n else\n missing_name == name.to_s\n end\n end", "title": "" }, { "docid": "650b2d4e1a43dc176ec21ca955cfad4f", "score": "0.49215463", "text": "def missing_name?(name)\n if name.is_a? Symbol\n last_name = (missing_name || '').split('::').last\n last_name == name.to_s\n else\n missing_name == name.to_s\n end\n end", "title": "" }, { "docid": "34b5b03e6caf7f7592b8a9c314eda4e3", "score": "0.49205506", "text": "def exist_name(name)\n @names.value?(name)\n end", "title": "" }, { "docid": "58a11594f2d045ffa643c747f4095e5b", "score": "0.4914037", "text": "def error_for_list_name(name)\n if !(1..100).cover? name.size\n 'The list name must be between 1 and 100 characters.'\n elsif @storage.list_name_exists?(name)\n 'List name must be unique'\n end\nend", "title": "" }, { "docid": "176332c4135b9419e662387e2f870e8d", "score": "0.4911211", "text": "def valid_name?\n proto_table.key?(@name)\n end", "title": "" }, { "docid": "8066ca859b3994f320389bf485ce7da0", "score": "0.4908502", "text": "def given_account_exists( name )\n if send( name ).present?\n errors.add( name, I18n.t( 'db_change_requests.msg.bad_account_id' )) \\\n unless Account.exists?( send( name ))\n end\n end", "title": "" }, { "docid": "c4f584e1d7be0c8250097f9e4d57dc1f", "score": "0.49041364", "text": "def name_present\n if name.blank?\n errors.add(:name, \"Can't be empty\")\n end\n end", "title": "" }, { "docid": "e6d247250309ce37c034baf2f77e2a63", "score": "0.48945838", "text": "def neighborhood_exists\n errors.add(:neighborhood_id, \"doesn't exist\") unless Neighborhood.exists?(neighborhood_id)\n end", "title": "" }, { "docid": "6251480bba01fe8703c96d442d915e02", "score": "0.48782715", "text": "def layer?(name)\n response = get(\"/#{CitySDK::LAYER_PATH}/#{name}/\")\n case response.status\n when 200 then true\n when 404 then false\n else api_error(response)\n end # case\n end", "title": "" }, { "docid": "8ddc51d3c0048dbb4821058fc198cac0", "score": "0.4874171", "text": "def with_error_message(name)\n return if APP_CONFIG.disabled?(\"ldap\")\n return unless exists?(name)\n\n \"The username '#{name}' already exists on the LDAP server. Use \" \\\n \"another name to avoid name collision\"\n end", "title": "" }, { "docid": "6c3591f4bdbca7b0ce61b434c77fbc7e", "score": "0.48674795", "text": "def validate_node!\n if @name_args[0].nil?\n ui.error(\"You must specify a node name\")\n show_usage\n exit 1\n end\n end", "title": "" }, { "docid": "f9e223435e4ab3fb807aa469b07e8191", "score": "0.48668003", "text": "def subnet_exist?\n return false if current_resource.netmasks.nil? || current_resource.addresses.nil?\n current_resource.netmasks[current_resource.addresses.index(new_resource.address)] == new_resource.netmask\n end", "title": "" }, { "docid": "c9c8f27ec7e85e8982cce58f3dec63e0", "score": "0.48636305", "text": "def exists_ip_in_unique_net?(object, parent)\n puts \"\\\\\\\\ 1. IP IN UNIQUE_NET ?? \\\\\\\\\"\n temp = Ipnet.find(:first, :conditions => [\"parent_id = ? and unq = ?\", parent, true])\n if not temp.nil?\n puts \"ipnet.rb: Validierung fehlgeschlagen (Unique IP für das Netz bereits vergeben)\"\n errors.add(:ipaddr, \"ist für das Netz bereits vergeben.\") and puts \"ipnet.rb: Validierung fehlgeschlagen\"\n else\n return true\n end\n end", "title": "" }, { "docid": "ce238ac4141a9c5c66a492fc464abdb9", "score": "0.4861427", "text": "def station_exist?(station)\n raise \"station don\\'t exist\" unless get_station(station)\n true\n end", "title": "" }, { "docid": "ed3e581223aacdb15603371c4cc8fc42", "score": "0.48566842", "text": "def test_inexistent_local_name\n assert_equal(\"\", N::URI.new(\"http://somethingelse.com/\").local_name)\n end", "title": "" }, { "docid": "f654fa606674bc76d3e26beb12dfcbad", "score": "0.4855982", "text": "def validate_domain(name)\n jid = JID.new(name)\n raise \"incorrect domain: #{name}\" if jid.node || jid.resource\n end", "title": "" }, { "docid": "f654fa606674bc76d3e26beb12dfcbad", "score": "0.4855982", "text": "def validate_domain(name)\n jid = JID.new(name)\n raise \"incorrect domain: #{name}\" if jid.node || jid.resource\n end", "title": "" }, { "docid": "f9dc44935b9cd1db340c6b169db0523a", "score": "0.48528", "text": "def check_dns_available(vm_name)\n begin\n dns_ip = Resolv.getaddress(vm_name)\n rescue Resolv::ResolvError\n # this is the expected case, swallow the error\n # eg \"no address for blah-daisy.example.com\"\n return ['', true]\n end\n [dns_ip, false]\n end", "title": "" }, { "docid": "cfd8babf1868049867d54fa07e3c6fc7", "score": "0.484795", "text": "def validate_group_name\n group_name_param = params[:group_name]\n if group_name_is_unique?(group_name_param)\n render json: { valid_group_name: true }, status: :ok\n else\n render json: { valid_group_name: false,\n message: \"A Space named \\\"#{group_name_param}\\\" already exists\"\n },\n status: :ok\n end\n end", "title": "" }, { "docid": "2dd4204d0e1d51d898b2d40e2bbb1b43", "score": "0.483906", "text": "def validate_username\n if User.where(email: username).exist?\n errors.add(:username, :invalid)\n end\n end", "title": "" }, { "docid": "730612e3aa1c178a9336bfb18a9dabf7", "score": "0.48378316", "text": "def test_should_require_name\n intitution = create(:name => nil)\n assert intitution.errors.invalid?(:name), \":name should be required\"\n assert_invalid intitution, \"intitution shouldn't be created\"\n end", "title": "" }, { "docid": "e6b26a5c1f851e01fbddca88f1e11f60", "score": "0.48376438", "text": "def zone_exist?(name)\n match = find_match(@dns.domains, name)\n if match != nil\n Puppet.notice \"found dns zone #{match.name}\"\n return true\n else\n Puppet.debug \"zone not found : #{name}\"\n return false\n end\n end", "title": "" }, { "docid": "f455e25f34cd510f7400d174d602fc31", "score": "0.48363256", "text": "def exists?\n name, type = resource[:name].split('/')\n # Create the resolver, pointing to the nameserver\n r = Resolv::DNS.new(:nameserver => server)\n # Do the look-up\n begin\n @dnsres = r.getresources(name, typeclass(type))\n rescue Resolv::ResolvError\n return false\n end\n # MX and SRV lookups will return empty arrays\n if @dnsres.is_a? Array\n return false if @dnsres.empty?\n end\n # The record exists!\n return true\n end", "title": "" }, { "docid": "86d183c15859356d8c3f819d9f9ad735", "score": "0.4809264", "text": "def network\n n = @head.fetch[0]\n raise \"Invalid network name '#{n}'\" unless n =~ /^[a-z]{4,16}$/\n n\n end", "title": "" }, { "docid": "0334cb5e452c4adbf76f49cb9f4fbf88", "score": "0.4808636", "text": "def error_for_list_name(name)\n if !(1..100).cover? name.size\n 'The list name must be between 1 and 100 characters.'\n elsif @storage.all_lists.any? { |list| list[:name] == name }\n 'The list name must be unique.'\n end\nend", "title": "" }, { "docid": "89960d85059b79c24847e51e2d71a18c", "score": "0.4807068", "text": "def name_should_exist\n\t agent = Mechanize.new { |agent| agent.user_agent_alias = \"Windows Chrome\" }\n searchPage = agent.get('http://www.lolking.net/')\n\t#search for player with the user name keyword\n\tsearchBox = searchPage.forms.first\n\tsearchBox['name'] = name\n\tresultPage = searchBox.submit\n\tresultBody = resultPage.body\n\tresult_doc = Nokogiri::HTML(resultBody)\n\n\trank = result_doc.xpath(\"//li[contains(@class, 'featured')]/div[3]/div[1]\").text.strip\n \t if rank.length == 0\n \t errors.add(:name, \"Error: We could not find a North America summoner with the name #{name}\")\n \t end\n end", "title": "" }, { "docid": "11fdccf88a15f894bf3fad271f9568b4", "score": "0.48031002", "text": "def folder_exists?\n empty_name?\n\n if File.exists?(\"#{LOCAL_PATH}/#{@name}\") || File.exists?(\"#{REMOTE_PATH}/#{@name}.git\")\n if File.exists?(\"#{LOCAL_PATH}/#{@name}\")\n print \"Directory `#{@name}` exists in #{LOCAL_PATH}. Pass a new name: \"\n elsif File.exists?(\"#{REMOTE_PATH}/#{@name}.git\")\n print \"Directory `#{@name}.git` exists in #{REMOTE_PATH}. Pass a new name: \"\n end\n\n @name = gets.chomp\n folder_exists?\n end\n\n false\n end", "title": "" }, { "docid": "884d9b174e191f8c0ea06010979e2070", "score": "0.4795303", "text": "def validate!\n logger.debug \"Starting validation for #{description}\"\n raise NotFound.new name, connection unless exists?\n logger.info \"Successfully validated #{description}\"\n self\n end", "title": "" }, { "docid": "8e79c05176225dd4b470d933d608d2a9", "score": "0.47870186", "text": "def monitor_net(params = nil)\n if @name_index\n @conf.insert(@name_index + @conf.length, \" \" + \"monitor-net \" + params.to_s + \"\\n\")\n else\n puts \"no #{@proxy_type} name assigned\"\n return false\n end\n end", "title": "" } ]
11a9019e087bcc3067506b019af9cee1
Return link code for editing this piece.
[ { "docid": "d496494004d0345b057c70be23a59989", "score": "0.7492851", "text": "def link_4edit()\n html = ''\n return html if @opts[:edit_mode] < 2\n @opts[:editparams].merge!( { table: 'dc_piece', \n form_name: 'dc_piece', \n controller: 'cmsedit', \n action: 'edit', \n id: @piece.id,\n title: \"#{t('drgcms.edit')}: #{@piece.name}\" } )\n html << dc_link_for_edit( @opts[:editparams] )\nend", "title": "" } ]
[ { "docid": "0b2c9b4dbcb16d65ad4fe64078bdf609", "score": "0.7301902", "text": "def get_EditLink()\n \t return @outputs[\"EditLink\"]\n \tend", "title": "" }, { "docid": "0b2c9b4dbcb16d65ad4fe64078bdf609", "score": "0.7301902", "text": "def get_EditLink()\n \t return @outputs[\"EditLink\"]\n \tend", "title": "" }, { "docid": "750ba7284eb8b2676769931f9e8974c1", "score": "0.71033835", "text": "def edit_link\n _link = self[\"link\"].find { |l| l.rel == \"edit\" }\n _link ? _link.href : nil\n end", "title": "" }, { "docid": "750ba7284eb8b2676769931f9e8974c1", "score": "0.71033835", "text": "def edit_link\n _link = self[\"link\"].find { |l| l.rel == \"edit\" }\n _link ? _link.href : nil\n end", "title": "" }, { "docid": "0fe47fb2de78b3325ecdd182ce7f85df", "score": "0.7009341", "text": "def edit_link(attr_name)\n if h.own_profile?\n link_text = contractor_missing_attr?(attr_name) ? \"Add\" : \"Edit\"\n\n h.link_to(\"javascript:void(0)\", id: attr_name, class: \"edit-link #{link_text} pull-right\") do\n #h.haml_concat h.content_tag(:i, class: \"e-icon-pencil\", style: \"height: 20px; line-height: 16px;\")\n h.haml_concat link_text\n end\n end\n end", "title": "" }, { "docid": "f243d576ec966152bdd973a48ff6ca55", "score": "0.6957887", "text": "def edit\n h.link_to(\"#{url}/edit\", target: \"_blank\") do\n\n h.content_tag(:i, nil, class: \"icon-pencil\")\n end\n end", "title": "" }, { "docid": "c848785a352bf96753823138fc8e572c", "score": "0.6881954", "text": "def edit_action_link(path = nil)\n path ||= path_args(entry)\n path = path.is_a?(String) ? path : edit_polymorphic_path(path)\n action_link(ti('link.edit'), 'pencil', path)\n end", "title": "" }, { "docid": "4c363de5ab0682f16e6e61fb50fd608d", "score": "0.6774913", "text": "def edit_link\n detect { |link| link.rel == 'edit' }\n end", "title": "" }, { "docid": "d21d0ad6a7c005cd31a32b8280b23203", "score": "0.67299765", "text": "def dc_link_for_edit(opts)\n opts.stringify_keys! \n title = opts.delete('title') #\n title = t(title)\n target = opts.delete('target') || 'iframe_cms'\n icon = opts.delete('icon') || 'edit-o'\n opts['controller'] ||= 'cmsedit'\n opts['action'] ||= 'edit'\n opts['form_name'] ||= opts['table'].to_s.split(';').last\n js = \"$('##{target}').attr('src', '#{_origin.url_for(opts)}'); return false;\"\n dc_link_to(nil, _origin.fa_icon(icon), '#',\n { onclick: js, title: title, class: 'dc-inline-link', alt: 'Edit'})\nend", "title": "" }, { "docid": "c0460d261ebf2b5b9513c491d046df08", "score": "0.67243576", "text": "def dc_link_for_edit(opts)\n opts.stringify_keys! \n title = opts.delete('title') #\n target = opts.delete('target') || 'iframe_cms'\n opts['controller'] ||= 'cmsedit'\n opts['action'] = 'edit'\n opts['form_name'] ||= opts['table']\n js = \"$('##{target}').attr('src', '#{_origin.url_for(opts)}'); return false;\"\n dc_link_to(nil, _origin.fa_icon('edit lg', class: 'dc-inline-link'), '#', \n { onclick: js, title: title, alt: 'Edit'})\nend", "title": "" }, { "docid": "0a839a345678d89dca75910a7e52e324", "score": "0.6716589", "text": "def edit_link\n url = current_page.source_file.sub(/^(.*)\\/source/,\n \"#{settings.github_profile}/developer.skroutz.gr/blob/master/source\")\n\n link_to \"<span>#{t('common.edit_on_github')}</span>\", url,\n title: t('common.edit_on_github'), class: 'btn-edit-github'\n end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6697904", "text": "def edit; end", "title": "" }, { "docid": "bba60c4f4df1152442d28067605666c7", "score": "0.66974497", "text": "def entry_edit_uri #media_entry_uri\n Utility.find_link_uri(links, \"edit\")\n end", "title": "" }, { "docid": "15bd465ebdca22f0336486b1a673f813", "score": "0.66936547", "text": "def edit_link(button = false, path_params = {}, fast = false)\n if user_allowed_to?(:edit)\n generic_link_chooser(ApplicationDecorator::EDIT_LINK, fast, 'edit'.freeze, button, path_params)\n end\n end", "title": "" }, { "docid": "03269b7353e60e7e373ef0b15969a043", "score": "0.66778076", "text": "def edit() end", "title": "" }, { "docid": "03269b7353e60e7e373ef0b15969a043", "score": "0.66778076", "text": "def edit() end", "title": "" }, { "docid": "06ecf9d4e37895ff7ac44869b53057d2", "score": "0.66711384", "text": "def e\n edit\n end", "title": "" }, { "docid": "7d24cdbb4c75bc3df28b379894de45a2", "score": "0.6652096", "text": "def edit_model_link m, reload_on_success=false\n edit_path = send(\"edit_admin_#{m.class.name.underscore}_path\", m)\n reload = reload_on_success ? 'reload' : nil\n return icon_link_to 'edit', edit_path, 'pencil', :remote => true, :class => \"dialog edit #{reload}\"\n end", "title": "" }, { "docid": "227e000b6769b7614b9ba6d9cce3a69a", "score": "0.6648659", "text": "def content_edit_link\n \n result = if content and content.publishing_state and content.can_write?(context.user) #(not content.new?) \n\n edit_content_url = \"/admin/cms/content/edit/#{content.id}\"\n \n if context and context.respond_to?(:request) and context.request.respond_to?(:path_info)\n edit_content_url << \"?destination=#{context.request.path_info}\"\n end\n \n context.render_content_action_button({:link => edit_content_url, :text => 'Edit'})\n \n else\n \"\"\n end \n \n end", "title": "" }, { "docid": "cef03dbe22a3aba6462898b5de850a36", "score": "0.66423476", "text": "def link_4edit(opts) #:nodoc:\n html = ''\n# return html unless @opts[:edit_mode] > 1\n\n opts.merge!( { controller: 'cmsedit', action: 'edit' } )\n title = \"#{t('drgcms.edit')}: \"\n opts[:title] = \"#{title} #{opts[:title]}\"\n \n html << '<li>'+dc_link_for_edit(opts)+'</li>'\nend", "title": "" }, { "docid": "23934b7ed8cb77c47c32f6929a8b527f", "score": "0.6633892", "text": "def link_4edit() #:nodoc:\n html = ''\n return html unless @opts[:edit_mode] > 1\n#\n @opts[:editparams].merge!( { table: 'dc_simple_menu', controller: 'cmsedit', action: 'edit' } )\n if @menu # edit, when menu exists\n title = \"#{t('drgcms.edit')}: \"\n @opts[:editparams].merge!( { id: @menu.id, title: \"#{title}#{@menu.name}\" } ) \n html << dc_link_for_edit( @opts[:editparams] )\n else # list available menus when menu does not yet exist\n title = \"#{t('drgcms.new')}: \"\n title << t('helpers.label.dc_simple_menu.tabletitle')\n @opts[:editparams].merge!( { action: 'index', title: title })\n html << dc_link_for_create( @opts[:editparams] )\n end\n html\nend", "title": "" }, { "docid": "419a6f93d773b84645ae2e147e8ea60c", "score": "0.66055006", "text": "def edit\n \n end", "title": "" }, { "docid": "62aa980193721874fc7b401ced39607e", "score": "0.6593903", "text": "def element_edit_link(survey, survey_version, element)\n generate_element_edit_link( url_for([:edit, survey, survey_version, element.assetable]) )\n end", "title": "" }, { "docid": "6ee592656d94941e468b8efb8b5ed997", "score": "0.65714824", "text": "def link_edit(object)\n if admin? && object && object.id\n link_to content_tag(:span, \"Edit\"), edit_url(object), :style => \"float: left; margin-top: 20px; width: 100px;\", :class => \"button\"\n end\n end", "title": "" }, { "docid": "9f55b0372f1faeb765009ab0d9afc3a8", "score": "0.65687007", "text": "def edit_url\n self.url + \"/edit\"\n end", "title": "" }, { "docid": "f88aeaba1175a4da259885b7696cec80", "score": "0.6562169", "text": "def edit ; end", "title": "" }, { "docid": "f88aeaba1175a4da259885b7696cec80", "score": "0.6562169", "text": "def edit ; end", "title": "" }, { "docid": "994b1015161813296f620379bdac5f0d", "score": "0.65477973", "text": "def action_edit_link\n link_to edit_admin_project_path(object),\n class: 'icon hint--top',\n id: dom_id(object, :edit),\n data: { hint: 'Edit' } do\n fa_icon 'pencil'\n end\n end", "title": "" }, { "docid": "3dc32d3e6a06c0c529a699c633af02d3", "score": "0.65459555", "text": "def default\n html = link_4edit()\n html << @piece.body\nend", "title": "" }, { "docid": "e4b74e3a7a65018ca42d3cdc2378d2c9", "score": "0.6543057", "text": "def edit\n # not implemented yet\n end", "title": "" }, { "docid": "e4b74e3a7a65018ca42d3cdc2378d2c9", "score": "0.6543057", "text": "def edit\n # not implemented yet\n end", "title": "" }, { "docid": "8ea5f5e2327092dc50ad2331f2b77a82", "score": "0.65251166", "text": "def edit\n \"edit\"\n end", "title": "" }, { "docid": "77256ef3e965637dfee8b9823ec7cfa2", "score": "0.6512766", "text": "def edit_url\n nil\n end", "title": "" }, { "docid": "41c6bcca5ad89da2200a36f755489c72", "score": "0.6506338", "text": "def edit_link(exam)\n link_to_remote(t(:message_12, :scope => [:helper, :exams]), :url => {:action => 'edit',\n :id => exam.id},\n :loading => visual_effect(:pulsate, \"edit_link_%i\" % exam.id))\n end", "title": "" }, { "docid": "737ac16e77a3649b1ea5afb288c580a6", "score": "0.64845186", "text": "def edit_business_link; @browser.a( :text => 'Edit business details' ) end", "title": "" }, { "docid": "074decea64f9da5e302585c408f84b56", "score": "0.6455774", "text": "def generate_element_edit_link(url)\n link_to image_tag('edit.png', :alt=>\"edit\"),\n url,\n { :method => :get,\n :remote => true,\n :title => \"Edit the questions and other survey content on the page.\",\n :class => \"edit_asset_link\" }\n end", "title": "" }, { "docid": "8fcf9417071163bb0bb734ef1c55c925", "score": "0.6448254", "text": "def display_edit_link(product)\n\t\tlink_to \"Edit\", edit_product_path(product)\n\tend", "title": "" }, { "docid": "c34702908e00015f28f66efe2f18d2ef", "score": "0.64438075", "text": "def click_edit(the_name)\n end", "title": "" }, { "docid": "f81644f0aab79b5a6dcf8a49ad930150", "score": "0.64415026", "text": "def edit_link\n if h.current_user == user\n nav_item do\n h.link_to '<i class=\"icon-pencil\"></i>Edit'.html_safe, h.edit_admin_content_path(self)\n end\n end\n end", "title": "" }, { "docid": "d973dee5e2611edcb977a10fb0c80c57", "score": "0.6424401", "text": "def edit\n \t\n end", "title": "" }, { "docid": "dcf156fd6531ff2f12f3fe164b2c65eb", "score": "0.64053845", "text": "def edit\n \n end", "title": "" }, { "docid": "dcf156fd6531ff2f12f3fe164b2c65eb", "score": "0.64053845", "text": "def edit\n \n end", "title": "" }, { "docid": "dcf156fd6531ff2f12f3fe164b2c65eb", "score": "0.64053845", "text": "def edit\n \n end", "title": "" }, { "docid": "9bf51ccf293e9d6bc571c6569612acec", "score": "0.64052254", "text": "def edit_url(object)\n eval(\"edit_#{object.class.name.underscore}_url\")\n end", "title": "" }, { "docid": "2812c7bf98529350e802a736a6a2f582", "score": "0.6398975", "text": "def edit_tool_url(object)\n return \"/tools/#{object.id}/edit\"\n end", "title": "" }, { "docid": "cbe63886c58bed84d4c3ed948eb624a0", "score": "0.63853246", "text": "def githubEditUrl(item)\n\treturn \"https://github.com/HeapSpace/website/edit/master/content\" + item.identifier.without_exts + \".md\"\nend", "title": "" }, { "docid": "91051dd2b6080fa9e78c8a763d79910c", "score": "0.6384252", "text": "def cms_edit_links!\n RequestStore.store[:rep_edit_links] = (@part_type == 'html')\n end", "title": "" }, { "docid": "ea01cbb224298f0507e70c6f46ff5a81", "score": "0.6356508", "text": "def edit\r\n end", "title": "" }, { "docid": "ea01cbb224298f0507e70c6f46ff5a81", "score": "0.6356508", "text": "def edit\r\n end", "title": "" }, { "docid": "ea01cbb224298f0507e70c6f46ff5a81", "score": "0.6356508", "text": "def edit\r\n end", "title": "" }, { "docid": "ea01cbb224298f0507e70c6f46ff5a81", "score": "0.6356508", "text": "def edit\r\n end", "title": "" }, { "docid": "ea01cbb224298f0507e70c6f46ff5a81", "score": "0.6356508", "text": "def edit\r\n end", "title": "" }, { "docid": "ea01cbb224298f0507e70c6f46ff5a81", "score": "0.6356508", "text": "def edit\r\n end", "title": "" }, { "docid": "ea01cbb224298f0507e70c6f46ff5a81", "score": "0.6356508", "text": "def edit\r\n end", "title": "" }, { "docid": "2bff80391050e381b8d2f7fd37f1b664", "score": "0.6352214", "text": "def edit_url(page)\n \"#{page_url(page)}?action=edit\"\n end", "title": "" }, { "docid": "9b7d4dedea12e39c0f87c47b1f04e3dd", "score": "0.6350002", "text": "def edit_link(resource)\n return unless policy(resource).edit?\n link_to(\"Edit\", url_for([:edit, resource]), class: \"button is-success\")\n end", "title": "" } ]
ee1b7d29e9a1bc0889b774cf7c6d21ae
use only uniq keys! or zk_map_keys will fire an error! if transition is not one to one zk_map_keys would also fire an error
[ { "docid": "8aa5f1cfcb530dc62738a0372ca47196", "score": "0.6552781", "text": "def zk_map_keys(keys)\n keys.map{ |key| [zip_key(key), key] }.to_h\n .tap{ |result| raise ArgumentError.new( \"Key zipping is not one to one! #{result.keys} != #{keys}\" ) if result.length != keys.length }\n end", "title": "" } ]
[ { "docid": "c10d6a8845db2e4be014b80347458099", "score": "0.6541017", "text": "def update_key_map; end", "title": "" }, { "docid": "b8070cd17ebe9d569d57898918b75c1c", "score": "0.6080686", "text": "def fix_mapping_key_required(nodes)\n nodes.reverse.each do |node|\n node.state? :sorted\n next unless node.is_a? Psych::Nodes::Mapping\n node.children.each_slice(2) do |k, v|\n k.required = v.required if k.required.nil?\n v.required = k.required\n end\n end\n end", "title": "" }, { "docid": "22666c2dc255aad6528bf6d01b65999c", "score": "0.5918734", "text": "def normalize_keys(mapping); end", "title": "" }, { "docid": "36edadb35b0203aae9da2a8aae769894", "score": "0.5832498", "text": "def change_key_changes\n Array( change_key ).inject( [] ) do |m,k|\n c = state[ k ]\n if c\n m + c\n else\n m\n end\n end\n end", "title": "" }, { "docid": "f22f5699cdf287d92fe0facf729b9226", "score": "0.58163935", "text": "def make_keys\n # No-op. Will be generated on construction of @keys\n end", "title": "" }, { "docid": "23aa0417c90831c4f5278ecbc8cab312", "score": "0.5773189", "text": "def migrate_to_key_zipping(keys)\n pipelined do\n zk_map_keys(keys).each{|new_key, key| renamenx( key, new_key )}\n end\n end", "title": "" }, { "docid": "83737fa7968c0459b42570189f8d5ea2", "score": "0.56993085", "text": "def map_keys(&blk)\n self.dup.map_keys!(&blk)\n end", "title": "" }, { "docid": "cca99e435b35cce215a8ca02b378b0f7", "score": "0.56826615", "text": "def missing_keys; end", "title": "" }, { "docid": "4dc61c71078a8353799e4b9d630f24d8", "score": "0.5645127", "text": "def unmatched_keys; end", "title": "" }, { "docid": "6aaf57b0ef09df21c1e3b8fa6a0c3c16", "score": "0.5630603", "text": "def check_key_enumeration(keys)\n @target = setup_heap(keys.shuffle)\n\n # Act\n i = 0\n @target.each { |key|\n # Assert\n assert_equal keys[i], key\n i += 1\n }\n\n assert_equal i, keys.length\n # each should not change the size\n assert_equal keys.length, @target.size\n\n # Clean\n @target = nil\n end", "title": "" }, { "docid": "a781b1e6395419602aef3709302bff8f", "score": "0.5618281", "text": "def sync_keys\n @mutex.synchronize do\n @sync_keys.clone\n end\n end", "title": "" }, { "docid": "23b72c3afe67d53763f584138b1d3d7c", "score": "0.56123734", "text": "def key_map\n @key_map ||= {}\n end", "title": "" }, { "docid": "30da86c936b89db4ebd15b5e50418db7", "score": "0.5609276", "text": "def temp_keys() @temp_keys ||= Array.new end", "title": "" }, { "docid": "3133a7a66d38e2b2a895744434188f3a", "score": "0.55952895", "text": "def map_keys! &block # :yields: key\n return enum_for(:map_keys!) unless block_given?\n replace map_keys(&block)\n end", "title": "" }, { "docid": "f80046b74f5b7b1ae5d907cfa6799e8f", "score": "0.55873746", "text": "def transform_keys(&block); end", "title": "" }, { "docid": "33387c9c5b4ac85b1b9e68abf19cc383", "score": "0.55561405", "text": "def map_keys(&block)\n dup.map_keys!(&block)\n end", "title": "" }, { "docid": "33387c9c5b4ac85b1b9e68abf19cc383", "score": "0.55561405", "text": "def map_keys(&block)\n dup.map_keys!(&block)\n end", "title": "" }, { "docid": "642e1ce75f65b5826afb92f697b1f40a", "score": "0.55466455", "text": "def manipulate_keys!(&block)\n @store.keys.each do |old_name|\n new_name = block.call(old_name)\n unless new_name == old_name\n @store[new_name] = @store[old_name]\n @store.delete(old_name)\n end\n end\n end", "title": "" }, { "docid": "0598a5b8a767a3d8b5d49dea157d27d6", "score": "0.5544542", "text": "def update_keys hash\n\t\t\t\told_keys = self.list.keys \n\t\t\t\tnew_keys = (old_keys + hash.keys.map(&:to_s)).uniq \n\t\t\t\tself.list.keys = new_keys #we are updating the first row.\n\t\t\tend", "title": "" }, { "docid": "a91842c82ff5fc5ce85eee9cc0689f9e", "score": "0.55392706", "text": "def refresh_keys(*keys)\n raise NotImplementedError # TODO\n end", "title": "" }, { "docid": "22fc500a8f84e8742dd217e427f53ce6", "score": "0.5515244", "text": "def transform_keys!(&block); end", "title": "" }, { "docid": "55df16c219518734fe23d35418d3d230", "score": "0.5506318", "text": "def uncreatable_keys\n [:_delete]\n end", "title": "" }, { "docid": "b262f38d0c7f9e6a905b5f5e38fa9bf6", "score": "0.54768497", "text": "def key_state(key)\n return false unless key\n return false if key <= 0\n return false if @keys.length <= key\n @keys[key]\n end", "title": "" }, { "docid": "763ce9b59ac72ddb5dc23755d9b437cb", "score": "0.54717207", "text": "def map_keys!\n keys.each do |k|\n self[yield(k)] = self.delete(k)\n end\n self\n end", "title": "" }, { "docid": "a0d4db2b88047178290bd6262be33d97", "score": "0.5465589", "text": "def changed_keys\n @changed_keys ||= {}\n end", "title": "" }, { "docid": "4e0623848c485fdcc8afbabf6f9992c4", "score": "0.54518306", "text": "def key_list\n super\n end", "title": "" }, { "docid": "d09375d7d0c60094a2d18bb555f84dd0", "score": "0.5445769", "text": "def get_keys\n super(true)\n end", "title": "" }, { "docid": "d87cdbec155ebc780ecf2687896b39e7", "score": "0.5435669", "text": "def preserve_key?(key)\n false\n end", "title": "" }, { "docid": "898c018c80f4c8442c3c6f50667dfd62", "score": "0.54304886", "text": "def build_slot_node_key_map(available_slots); end", "title": "" }, { "docid": "98e15726249693bfd7b72918b6db4e80", "score": "0.54285353", "text": "def possible_keys(row, col, steps=0)\n # print_map\n v = @map[row][col]\n if key?(row,col)\n # puts \"found key #{v} in #{steps} steps\"\n return [Key.new(row,col,v,steps)]\n end\n\n @map[row][col] = ' '\n keys = []\n possible_moves(row, col).each do |r,c|\n keys += possible_keys(r,c, steps+1)\n end\n @map[row][col] = v\n keys\nend", "title": "" }, { "docid": "36390bbee7a78aa82fc2027566b6612b", "score": "0.5427037", "text": "def reverse_from_key_zipping!( keys )\n pipelined do\n zk_map_keys(keys).each{|new_key, key| rename( new_key, key ) }\n end\n end", "title": "" }, { "docid": "a229eedb73107547eebf54274e239d58", "score": "0.5419961", "text": "def translate_keys(mapping)\n dup.translate_keys!(mapping)\n end", "title": "" }, { "docid": "8b5e1503b799d2002ef04bd820139a15", "score": "0.54161996", "text": "def redacted_keys; end", "title": "" }, { "docid": "ec835628cec108dcdd8596ee76580f84", "score": "0.538499", "text": "def all_keys(recycle_hash)\n recycle_hash.each_key do |key|\n # puts \"#{key}\"\n end\nend", "title": "" }, { "docid": "66f0b10266968eb3057a671c88853466", "score": "0.53763354", "text": "def hkeys(key); end", "title": "" }, { "docid": "66f0b10266968eb3057a671c88853466", "score": "0.53763354", "text": "def hkeys(key); end", "title": "" }, { "docid": "bcbcd9ea5bbe7891ca5ea212ba6cea71", "score": "0.53733224", "text": "def old_cluster_keys\n @old_cluster_keys ||= @old_cluster.keys(\"*\")\n end", "title": "" }, { "docid": "2b1d968915b6d34d86fd4721378f550b", "score": "0.5349659", "text": "def keys; end", "title": "" }, { "docid": "2b1d968915b6d34d86fd4721378f550b", "score": "0.5349659", "text": "def keys; end", "title": "" }, { "docid": "2b1d968915b6d34d86fd4721378f550b", "score": "0.5349659", "text": "def keys; end", "title": "" }, { "docid": "2b1d968915b6d34d86fd4721378f550b", "score": "0.5349659", "text": "def keys; end", "title": "" }, { "docid": "2b1d968915b6d34d86fd4721378f550b", "score": "0.5349659", "text": "def keys; end", "title": "" }, { "docid": "2b1d968915b6d34d86fd4721378f550b", "score": "0.5349659", "text": "def keys; end", "title": "" }, { "docid": "2b1d968915b6d34d86fd4721378f550b", "score": "0.5349659", "text": "def keys; end", "title": "" }, { "docid": "2b1d968915b6d34d86fd4721378f550b", "score": "0.5349659", "text": "def keys; end", "title": "" }, { "docid": "2b1d968915b6d34d86fd4721378f550b", "score": "0.5349659", "text": "def keys; end", "title": "" }, { "docid": "2b1d968915b6d34d86fd4721378f550b", "score": "0.5349659", "text": "def keys; end", "title": "" }, { "docid": "2b1d968915b6d34d86fd4721378f550b", "score": "0.5349659", "text": "def keys; end", "title": "" }, { "docid": "2b1d968915b6d34d86fd4721378f550b", "score": "0.5349659", "text": "def keys; end", "title": "" }, { "docid": "2b1d968915b6d34d86fd4721378f550b", "score": "0.5349659", "text": "def keys; end", "title": "" }, { "docid": "2b1d968915b6d34d86fd4721378f550b", "score": "0.5349659", "text": "def keys; end", "title": "" }, { "docid": "2b1d968915b6d34d86fd4721378f550b", "score": "0.5349659", "text": "def keys; end", "title": "" }, { "docid": "12fd247d5276caf889c3b3f2379b5316", "score": "0.5348095", "text": "def redacted_keys=(_arg0); end", "title": "" }, { "docid": "d4512392039e5cc1870ebcd296fa3b2f", "score": "0.5339118", "text": "def remove_all_keys\n super\n end", "title": "" }, { "docid": "0bd6d5b74710ad4a9b4c9ee75409e740", "score": "0.53221375", "text": "def generate_base_keys(pos, from_key, new_key)\r\n if !@unchanged.include? from_key[pos]\r\n if from_key[pos] % 2 == 0\r\n new_key[pos] = (from_key[pos] + 1).chr\r\n else\r\n new_key[pos] = (from_key[pos] - 1).chr\r\n end\r\n\r\n if new_key.length == 8\r\n @possible_keys.add(String.new(new_key))\r\n\r\n # also add key with original value\r\n new_key[pos] = (from_key[pos]).chr\r\n @possible_keys.add(String.new(new_key))\r\n else\r\n generate_base_keys(pos + 1, from_key, String.new(new_key))\r\n\r\n # also generate keys with original value\r\n new_key[pos] = (from_key[pos]).chr\r\n generate_base_keys(pos + 1, from_key, String.new(new_key))\r\n end\r\n else\r\n new_key[pos] = (from_key[pos]).chr\r\n if new_key.length == 8\r\n @possible_keys.add(String.new(new_key))\r\n else\r\n generate_base_keys(pos + 1, from_key, String.new(new_key))\r\n end\r\n end\r\n end", "title": "" }, { "docid": "5591b4c02ca5c36d722128ece529316c", "score": "0.53125507", "text": "def conv_keys\n [:rx, :tx, :rx_last, :tx_last]\n end", "title": "" }, { "docid": "600e0b566b1948ddc7f401236d6b3a7c", "score": "0.5302502", "text": "def change_key_changes?\n Array( change_key ).any? do |k|\n c = state[ k ]\n c && !c.empty?\n end\n end", "title": "" }, { "docid": "2c194fe0174a88dfc19a4d488a5dd3fc", "score": "0.52936006", "text": "def test_broken_prefix\n km = Tui::Core::KeyMaker.new( lambda { |i| return i } )\n km << 'cor'\n km << 'core1'\n keys = km.make\n assert_equal 2, keys.length\n assert keys.has_key?( 'r' ), keys.to_s\n assert keys.has_key?( '1' ), keys.to_s\n km = Tui::Core::KeyMaker.new( lambda { |i| return i } )\n km << 'cor'\n km << 'core1'\n km << 'core2'\n keys = km.make\n assert_equal 3, keys.length\n assert keys.has_key?( '1' ), keys.to_s\n assert keys.has_key?( '2' ), keys.to_s\n assert keys.has_key?( 'r' ), keys.to_s\n km = Tui::Core::KeyMaker.new( lambda { |i| return i } )\n km << 'cor'\n km << 'corr'\n km << 'core2'\n keys = km.make\n assert_equal 3, keys.length\n assert keys.has_key?( '.' ), keys.to_s\n assert keys.has_key?( 'r' ), keys.to_s\n assert keys.has_key?( 'e' ), keys.to_s\n end", "title": "" }, { "docid": "5eda132094a34b720543492a1d517a41", "score": "0.5278186", "text": "def unique_key\n Array[\"Name\",\"Location\"] \n end", "title": "" }, { "docid": "5eda132094a34b720543492a1d517a41", "score": "0.5278186", "text": "def unique_key\n Array[\"Name\",\"Location\"] \n end", "title": "" }, { "docid": "59bd8a354a7307913d0f37017c42ad63", "score": "0.5246859", "text": "def extra_keys(hash, recall={})\n generate( hash, recall) # called for side-effect: set @keys_we_dont_need\n @keys_we_dont_need - [:controller, :action] # it seems we always need controller and action\n end", "title": "" }, { "docid": "2a880293c763d1dd5e29908540933354", "score": "0.52325386", "text": "def keys(reload = T.unsafe(nil)); end", "title": "" }, { "docid": "000611d81365d36a60b2f1117e89afc7", "score": "0.5227262", "text": "def key_coercions; end", "title": "" }, { "docid": "cc29494b06c6c2103b11ace15b441704", "score": "0.5225617", "text": "def shift\n (k,v) = super\n @deleted_keys << k\n [k,v]\n end", "title": "" }, { "docid": "ca73eb39c83af961b8d68a37785368b5", "score": "0.52233356", "text": "def fast_assert_valid_keys(valid_keys)\n unknown_keys = keys - valid_keys\n raise(ArgumentError, \"Unknown key(s): #{unknown_keys.join(\", \")}\") unless unknown_keys.empty?\n end", "title": "" }, { "docid": "7b4e40a5483d917690128ece3f471af2", "score": "0.52212745", "text": "def each_key; end", "title": "" }, { "docid": "7b4e40a5483d917690128ece3f471af2", "score": "0.52212745", "text": "def each_key; end", "title": "" }, { "docid": "7b4e40a5483d917690128ece3f471af2", "score": "0.52212745", "text": "def each_key; end", "title": "" }, { "docid": "3cb14ca07c318f96e2b4a0a4e3f0f1e9", "score": "0.5212904", "text": "def clean\n keys = nil\n @mutex.synchronize do\n keys = @map.keys\n end\n \n keys.each do |key|\n begin\n self.get(key) #this will remove the key if the object no longer exists.\n rescue Wref::Recycled\n #ignore.\n end\n end\n \n return nil\n end", "title": "" }, { "docid": "a26e1c5e0a5a68d5c2ff3180919477bb", "score": "0.52096295", "text": "def shallow_map_keys(&block)\n deep_dup.shallow_map_keys!(&block)\n end", "title": "" }, { "docid": "9e3cc08696ec2b3011725ada183cca7f", "score": "0.52045345", "text": "def mash_keys(key_code = nil)\n @key = key_code || create_random_key\n @key.map.with_index do |number, index|\n number.to_s + @key[index + 1].to_s if index < 4\n end.compact!\n end", "title": "" }, { "docid": "b0cff16f63ee0fc56e4725353936a0d6", "score": "0.51993436", "text": "def keys_down\n rev_map(@key_handler.keys_down)\n end", "title": "" }, { "docid": "5033d3f14c35cfe168eadda575b3d283", "score": "0.51991445", "text": "def upcase_keys\n get_keys.reverse.each do |key|\n # upper case last part of the path\n parts = key.split('/', 2)\n parts[-1].upcase!\n new_key = parts.join('/')\n\n # TODO: on duplicate tm_mad_system breaks the order\n # rubocop:disable Style/Next\n if key != new_key\n if new_key.end_with?(']')\n # if we are changing casing on last indexed []\n # node we have to drop the index as the new\n # index will be assigned automatically by\n # Augeas, for example:\n # tm_mad_conf[2] -> TM_MAD_CONF\n # tm_mad_conf/tm_mad_system[2] -> TM_MAD_SYSTEM\n parts[-1].sub!(/\\[[0-9]+\\]$/, '')\n new_key = parts.join('/')\n end\n\n # Rename only if paths differ and expect\n # the change to happen on just single node,\n # not more or less. Otherwise it's a BUG!\n changed = @content.rename(key, parts[-1])\n\n if changed != 1\n raise OneCfg::Config::Exception::StructureError,\n \"Upcase of '#{key}' to '#{new_key}' updated \" \\\n \"#{changed} nodes instead of expected 1\"\n end\n end\n # rubocop:enable Style/Next\n end\n end", "title": "" }, { "docid": "b89bdfa7563e5fc7587e3b7d9fbf3110", "score": "0.5194488", "text": "def mapped_msetnx(hash); end", "title": "" }, { "docid": "e3ac4808b81bb44743aa495492febd76", "score": "0.51908195", "text": "def migrate_keys(node, keys, options={})\n return false if keys.empty? || keys.nil?\n \n Thread.current[:redis] = Redis::Distributed.new(old_hosts)\n\n pipe = IO.popen(\"redis-cli -h #{node[:host]} -p #{node[:port]} -n #{node[:db]} --pipe\", IO::RDWR)\n\n keys.each {|key|\n copy_key(pipe, key)\n\n #remove key from old node\n redis.node_for(key).del(key) unless options[:do_not_remove]\n }\n\n pipe.close\n end", "title": "" }, { "docid": "b2d1994bcd2734b2b952851e51b157ab", "score": "0.51879203", "text": "def key(*args)\n args.each { |k|\n self.keys << k if not keys.include? k\n }\n end", "title": "" }, { "docid": "0debcb3a6d553753c53b4009b8258ac2", "score": "0.5170097", "text": "def delete_all_keys\n super\n end", "title": "" }, { "docid": "e5eacdd28408166e52492d812a103cd1", "score": "0.5169775", "text": "def migrate_keys(node, keys, options={})\n return false if keys.empty? || keys.nil?\n\n migrator(options[:do_not_remove]).new(old_hosts).migrate(node, keys, options)\n end", "title": "" }, { "docid": "cb0b728b0f0e1b5fb4c0cd4b09694829", "score": "0.5163133", "text": "def key3; end", "title": "" }, { "docid": "1d45d450007a916cfd27dca9d74327b8", "score": "0.5160882", "text": "def store_key_references; end", "title": "" }, { "docid": "5130baabec72d439e86447331e181b76", "score": "0.51518965", "text": "def mp_transform_keys!\n return enum_for(:mp_transform_keys!) unless block_given?\n keys.each do |key|\n self[yield(key)] = delete(key)\n end\n self\n end", "title": "" }, { "docid": "6263052402582a997bbdc7ec343d3479", "score": "0.5151774", "text": "def clean\n keys = nil\n @mutex.synchronize do\n keys = @map.keys\n end\n\n keys.each do |key|\n begin\n get(key) #this will remove the key if the object no longer exists.\n rescue Wref::Recycled\n #ignore.\n end\n end\n\n return nil\n end", "title": "" }, { "docid": "171f1b0b7eceff4242fc50547b2cfe32", "score": "0.5150677", "text": "def global_keys\n\t\t\t\t\tzk.children(@base_path)\n\t\t\t\tend", "title": "" }, { "docid": "952dfc56a34436475bed1566479c4872", "score": "0.5150166", "text": "def unupdatable_keys\n model.key.to_a.map { |property| property.name } << :_delete\n end", "title": "" }, { "docid": "0a5fa37cc3726ebbe84b74bb242d8766", "score": "0.514814", "text": "def keys; @map.values.sort end", "title": "" }, { "docid": "10b93ea3755ab21e95009fc73083979c", "score": "0.5142473", "text": "def map_keys\n if( not @ordered )\n FileSystem.smembers( ProcessInfo.keys(@pid) )\n else\n FileSystem.zrange( ProcessInfo.keys(@pid), 0, -1 )\n end\n end", "title": "" }, { "docid": "f8703385dd2552487cea3899832cedf5", "score": "0.5133177", "text": "def sorted_keys; end", "title": "" }, { "docid": "491cf15c4b97ac57bfc972b197e6a424", "score": "0.51145905", "text": "def worktree_has_key_changes?\n json_generate && has_key_changes?\n end", "title": "" }, { "docid": "407b429fb75d411857d956eab987e021", "score": "0.5110456", "text": "def key(*) end", "title": "" }, { "docid": "407b429fb75d411857d956eab987e021", "score": "0.5110456", "text": "def key(*) end", "title": "" }, { "docid": "dc5e03cb4a525b5a8a9d3305432df455", "score": "0.510764", "text": "def key_map\r\n hash = {}\r\n hash['trunk'] = trunk\r\n hash\r\n end", "title": "" }, { "docid": "b5ccff39580b41ff59782ae0c4fb4f72", "score": "0.5107277", "text": "def transform_keys!\n return enum_for(:transform_keys!) { size } unless block_given?\n keys.each do |key|\n self[yield(key)] = delete(key)\n end\n self\n end", "title": "" }, { "docid": "b5ccff39580b41ff59782ae0c4fb4f72", "score": "0.5107277", "text": "def transform_keys!\n return enum_for(:transform_keys!) { size } unless block_given?\n keys.each do |key|\n self[yield(key)] = delete(key)\n end\n self\n end", "title": "" }, { "docid": "34bf3151ba77039dc017b354946a795b", "score": "0.51067746", "text": "def shuffle_keys some_hash\n\tsome_hash.keys.shuffle\nend", "title": "" }, { "docid": "08893e106a1997eab5672f10a5dfc806", "score": "0.5099284", "text": "def regenerate_reactor_keys()\n start.uri('/api/reactor')\n .put()\n .go()\n end", "title": "" }, { "docid": "e6242a95a9b1c4610b1879a29913657a", "score": "0.5094699", "text": "def keys\n @hash_keys ||= []\n end", "title": "" }, { "docid": "2c600284311c4b6c3993b4caa454f18e", "score": "0.50851685", "text": "def underscore_keys!(options = {})\n Hash::KeyChanger.new(self).underscore_keys(options)\n end", "title": "" }, { "docid": "6a5eebe055e30fc5025fb09b1d2829f5", "score": "0.50791645", "text": "def clear_assigned_keys\n @key_assignments = {}\n end", "title": "" }, { "docid": "d636945a6c041a22878a98a3e76095bd", "score": "0.5076527", "text": "def moves_for_key_held\n MOVES_FOR_KEY_HELD\n end", "title": "" }, { "docid": "5b3625331101aebbb3dd2383358cf5ea", "score": "0.5075744", "text": "def keys_to_check\n # We include nil with response_id so that all chunk positions have a pair of elements.\n # This simplifies the main code.\n @keys_to_check ||= [[\"response_id\", nil]] + (1..max_depth).to_a.map do |i|\n [\"group#{i}_rank\", \"group#{i}_inst_num\"]\n end\n end", "title": "" } ]
d8801eccecb6c9da161646b9b40c697d
/catalog/import Import a custom set of recipes in the catalog to be used by a single project
[ { "docid": "f8f0c9803ff5b9dadb122adc59ea2ddd", "score": "0.6833783", "text": "def importCustomCatalog\r\n require 'fileutils'\r\n require 'find'\r\n require 'uri'\r\n\r\n @project = Project.find(params[\"project_id\"])\r\n @role = Role.find_by_actor_id_and_project_id(current_actor.id, @project.id)\r\n if @role.nil? and !current_actor.superadmin\r\n json_response({ message: \"You don't have permission to update service types\" }, :unauthorized)\r\n return\r\n end\r\n\r\n temp_dir = FileUtils.mkdir_p(\"custom-recipes/\"+@project.id.to_s)[0]\r\n\r\n begin\r\n URI.parse(params[\"custom_catalog_uri\"])\r\n if params[\"custom_catalog_branch\"].present?\r\n repo_branch = params[\"custom_catalog_branch\"]\r\n else\r\n repo_branch = 'master'\r\n end\r\n\r\n system(\"git clone -b \" + repo_branch + \" --single-branch \" + params[\"custom_catalog_uri\"] + \" \" + temp_dir + \"/mastermind-services\")\r\n\r\n Find.find(temp_dir + \"/mastermind-services\") do |path|\r\n if path =~ /.*mastermind\\.yml$/\r\n directory = File.dirname(path)\r\n mastermindConf = YAML::load(File.open(directory+'/mastermind.yml'))\r\n dockerCompose = YAML::load(File.open(directory+'/docker-compose.yml'))\r\n serviceType = ServiceType.find_by name: mastermindConf[\"name\"], version: mastermindConf[\"version\"], is_imported: true, project_id: @project.id\r\n # NOTE: The gsub done on the Docker Compose might be moved into the Service Manager instead. This fix is likely temporary\r\n if serviceType.nil?\r\n ServiceType.create(is_imported: true, project_id: @project.id, local_path: directory, name: mastermindConf[\"name\"], description: mastermindConf[\"description\"], version: mastermindConf[\"version\"], service_protocol_type: mastermindConf[\"protocol_type\"], ngsi_version: mastermindConf[\"ngsi_version\"], configuration_template: File.read(directory+'/mastermind.yml'), deploy_template: File.read(directory+'/docker-compose.yml').gsub(/:-.+}/, \"}\"))\r\n else\r\n serviceType.update({is_imported: true, project_id: @project.id, local_path: directory, name: mastermindConf[\"name\"], description: mastermindConf[\"description\"], version: mastermindConf[\"version\"], service_protocol_type: mastermindConf[\"protocol_type\"], ngsi_version: mastermindConf[\"ngsi_version\"], configuration_template: File.read(directory+'/mastermind.yml'), deploy_template: File.read(directory+'/docker-compose.yml').gsub(/:-.+}/, \"}\")})\r\n end\r\n end\r\n end\r\n\r\n json_response({ message: \"Service Types imported\" }, 200)\r\n rescue\r\n json_response({ message: \"Invalid Catalog Repository URI or malformed Repository\" }, 400)\r\n end\r\n end", "title": "" } ]
[ { "docid": "764750373b1dcd3c2459150dfdcf3671", "score": "0.7153511", "text": "def import\n search_word = @view.ask_for_import\n recipes = @scraper.get_recipes(search_word)\n chosen_one = @view.pick_import(recipes)\n difficulty = @view.ask_for_difficulty\n recipe = Recipe.new(chosen_one[:title], chosen_one[:description], chosen_one[:time], difficulty)\n @cookbook.add_recipe(recipe)\n end", "title": "" }, { "docid": "6871778c4c15e5bd0c75f3d0b964b718", "score": "0.676764", "text": "def load_recipes(*files)\n files.flatten.each { |f| import f }\n end", "title": "" }, { "docid": "0bfc1d5327f3b4955e666c0ae513a46c", "score": "0.64054865", "text": "def import\n end", "title": "" }, { "docid": "0bfc1d5327f3b4955e666c0ae513a46c", "score": "0.64054865", "text": "def import\n end", "title": "" }, { "docid": "0bfc1d5327f3b4955e666c0ae513a46c", "score": "0.64054865", "text": "def import\n end", "title": "" }, { "docid": "0bfc1d5327f3b4955e666c0ae513a46c", "score": "0.64054865", "text": "def import\n end", "title": "" }, { "docid": "c13bd4d8a02ffc8c7e3ac5e1d4f98f8e", "score": "0.6404461", "text": "def import\n\n end", "title": "" }, { "docid": "cef41123e59768c18f8c02886c47928a", "score": "0.6357747", "text": "def import\n\n # TODO\n # Ask by which category to import (ingredient / difficulty)\n\n # category =\n\n # if category == \"1\"\n # url = \"http://www.letscookfrench.com/recipes/find-recipe.aspx?s=#{keyword}\"\n # elsif category == \"2\"\n # url = \"http://www.letscookfrench.com/recipes/find-recipe.aspx?dif=#{keyword}\"\n # else\n # puts \"Please press 1 or 2\"\n # end\n\n # Ask the user the ingredient that he/she wants\n ingredient = @view.ask_user_for_ingredient\n\n\n message = \"'#{ingredient}' recipes\"\n @view.show_scraping_message(\"Looking for\", message)\n\n # Scraping the data\n scraper = ScrapeLetsCookFrenchService.new\n data_recipes = scraper.call(ingredient)\n\n @view.show_recipes_found(data_recipes)\n\n # Ask the user the recipe to import\n index_recipe = @view.ask_user_for_index(\"import\")\n\n # TODO\n # Let the user import multiple recipes in one time\n\n # creating the recipe and adding it to the database\n recipe = data_recipes[index_recipe]\n\n message = \"'#{recipe.name}'\"\n\n @view.show_scraping_message(\"Importing\", message)\n\n # recipe = Recipe.new(attributes)\n @cookbook.add_recipe(recipe)\n end", "title": "" }, { "docid": "15827439ecfc801ba81e6dc403e02a47", "score": "0.6275729", "text": "def import\n @import\n end", "title": "" }, { "docid": "396c43221acf27297947f718069331b4", "score": "0.62070435", "text": "def import_supply_items(filename = self.import_filename)\n super\n end", "title": "" }, { "docid": "d2773b5da9ee4c4947ffb6bf0799828d", "score": "0.61859155", "text": "def new_import\n end", "title": "" }, { "docid": "4256d8eca09cd61ec456c9523b36d1bd", "score": "0.6183017", "text": "def import\n\t\tadd_breadcrumb 'Import', import_path\n\tend", "title": "" }, { "docid": "90c500cbe965b859f67ea0714cc8b2a3", "score": "0.6166327", "text": "def import_supply_items(filename)\n super\n end", "title": "" }, { "docid": "622dfb835e024399ed1fd5df2e52a40d", "score": "0.61639637", "text": "def import\n\nend", "title": "" }, { "docid": "5e89e04a734e64261b0ee7c07d7ea1de", "score": "0.6025731", "text": "def import import_filepath\n log.info(x) { \"importing into current book from file #{import_filepath}.\" }\n import_uc = SafeDb::Import.new\n import_uc.import_filepath = import_filepath\n import_uc.flow() \n end", "title": "" }, { "docid": "27a068d00423eb639ccafc9aa8de338a", "score": "0.6012362", "text": "def import\n\tend", "title": "" }, { "docid": "ecf9db5af255ce35c4ea52ee766a647c", "score": "0.5907139", "text": "def include_recipe(*recipes)\n loaded_recipes = []\n mashup = mashup_block do\n recipes.each do |recipe|\n case recipe\n when String\n Chef::Log.debug \"Loading recipe #{recipe} via include_recipe\"\n loaded_recipes += run_context.include_recipe(recipe)\n when Proc\n r = Chef::Recipe.new(cookbook, new_resource.recipe, run_context)\n r.instance_eval(&r)\n loaded_recipes << r\n end\n end\n end\n\n Garcon::Tournant.new(new_resource, mashup).converge\n collection = global_resource_collection\n mashup.resource_collection.each do |r|\n collection.insert(r)\n collection.iterator.skip_forward if collection.iterator\n end\n loaded_recipes\n end", "title": "" }, { "docid": "48baa6cdc8e8b307c6eb08eaa25ea75e", "score": "0.58892304", "text": "def import_animal(animal_to_import)\n \n @animals << animal_to_import\n end", "title": "" }, { "docid": "03d11ca2aebe94b1ad8727b90429e209", "score": "0.58675295", "text": "def import_with_resource( new_attributes={})\n self.transaction do\n new_theme = import( new_attributes ) \n #include taxon, image, file, specific-taxon\n self.class.import_assigned_resource( self, new_theme ) \n new_theme\n end\n end", "title": "" }, { "docid": "d6a724eb38ea72631141c5dd2c73f23c", "score": "0.58618855", "text": "def import_new\n end", "title": "" }, { "docid": "4c5888779be6c1cd5064c1472abebd59", "score": "0.5859467", "text": "def import_plain; end", "title": "" }, { "docid": "9f162412c279ae02668a5ad94d462a35", "score": "0.58552176", "text": "def import(*fns)\n fns.each do |fn|\n Rake.application.add_import(fn)\n end\nend", "title": "" }, { "docid": "9f162412c279ae02668a5ad94d462a35", "score": "0.58552176", "text": "def import(*fns)\n fns.each do |fn|\n Rake.application.add_import(fn)\n end\nend", "title": "" }, { "docid": "90f50b3a58ed9fd57576c176159dbdff", "score": "0.5851527", "text": "def autoimport\n\n\t ActionFramework::Project.autoimport\n\n\t end", "title": "" }, { "docid": "ba5a51d91496ecef0455507b8e7eac3c", "score": "0.58320916", "text": "def load_rakefiles\n Dir[\"#{recipe_dir}/*/*.rake\"].each do |recipe|\n logger.debug \"loading #{recipe}\"\n import recipe\n end\n end", "title": "" }, { "docid": "55f13246154f8803e7970cf2e31a2d02", "score": "0.5818517", "text": "def extract_imports!(config)\n config.delete('import') || []\n end", "title": "" }, { "docid": "ed82bcb4206762b051208f140bce5bb2", "score": "0.58137184", "text": "def add_import(fn); end", "title": "" }, { "docid": "6c365941f66c5a81c151eee974a253c8", "score": "0.5777269", "text": "def import_dependents\n import_dependent('homeworld')\n import_dependent('species')\n import_dependent('starships')\n end", "title": "" }, { "docid": "220265c1b81d63499f02bd841ec4b237", "score": "0.57650864", "text": "def import(*sets); end", "title": "" }, { "docid": "220265c1b81d63499f02bd841ec4b237", "score": "0.57650864", "text": "def import(*sets); end", "title": "" }, { "docid": "d1de283c717e6b8165d35b5b6c2aa5fc", "score": "0.5756559", "text": "def import_action_pack(args)\n load_action_pack(args[:path]) unless args[:path].nil?\n register_action_pack(args[:name])\n merge_dependencies(args[:dependencies]) unless\n args[:dependencies].nil?\n end", "title": "" }, { "docid": "41ce848dcc458f4a996b8a3bed0d7910", "score": "0.57482725", "text": "def import(*args)\n @store = store.import(*args)\n self\n end", "title": "" }, { "docid": "dc9dde83fc6c094518493a83b43660ef", "score": "0.57324386", "text": "def import(new_attributes={})\n raise ArgumentError unless self.template_releases.exists? && self.is_public?\n #only released template and :is_public is importable\n #create theme record\n new_theme = self.dup\n #set resource to site native\n new_theme.title = \"Imported \"+ new_theme.title\n new_theme.attributes = new_attributes\n new_theme.assigned_resource_ids = {}\n new_theme.site_id = SpreeTheme.site_class.current.id\n new_theme.save!\n new_theme\n end", "title": "" }, { "docid": "06f080b9902a9e096eaa608b0b2415d4", "score": "0.5706491", "text": "def load_imports; end", "title": "" }, { "docid": "57768c76edf4f5a08c20658b56b586ce", "score": "0.5693227", "text": "def compile_import_file filepath, import_role\n # REVISIT: Save and use another @vocabulary for this file?\n File.open(filepath) do |f|\n compile_import_input(f.read, import_role)\n end\n end", "title": "" }, { "docid": "bf36fdfe48f6d64281d2e411e851fda1", "score": "0.56777185", "text": "def import(*keys)\n raise NotImplementedError # TODO\n end", "title": "" }, { "docid": "a6f50f730c385bcffc564ad37e8e090f", "score": "0.5674797", "text": "def import\n #1.Ask the user for keyword\n ingredient = @view.ask_input(\"ingredient\")\n #call the service\n #2. open url\n #3. parse html\n #4.For the first five results\n #5. Create a recipe and store it in a results array\n scrape = ScrapeallrecipesService.new(ingredient)\n imported_recipes = scrape.call\n\n #6. display the results\n @view.display(imported_recipes)\n #7. ask the user which recipe to import\n selected_recipe = imported_recipes[@view.get_index]\n #8. add it to the cookbook\n @cookbook.add(selected_recipe)\n #9. display it\n list\n end", "title": "" }, { "docid": "e085fb4946926243057ff251b0dee7fc", "score": "0.56736374", "text": "def import *args, &block\n import_options = args.extract_options!\n batch_size = import_options.delete(:batch_size) || BATCH_SIZE\n\n objects = args.empty? && @target.respond_to?(import_all_method) ?\n @target.send(import_all_method) : args.flatten.compact\n\n import_objects(objects, batch_size, &block)\n end", "title": "" }, { "docid": "099d0efde3204226c967e09c214c01c1", "score": "0.5663482", "text": "def import_all!\n return if spree_class.nil?\n import_all_perform(client_query)\n end", "title": "" }, { "docid": "785e6a4fdd689f1e1dd8c781e1d2e2b3", "score": "0.5656796", "text": "def import!\n check_arguments!\n run || raise(ImportError)\n save!\n end", "title": "" }, { "docid": "b2dad1ab08c3619f3785ee50c8429261", "score": "0.56567", "text": "def action_import\n converge_by(\"importing #{new_resource.name} into cobbler\") do\n notifying_block do\n create_image\n cobbler_import\n cobbler_profile_add\n delete_image\n end\n end\n end", "title": "" }, { "docid": "be62341891af25bfbc983d6dbc4e87c8", "score": "0.5637632", "text": "def import\n @imports.each do |item|\n source = @sources[item['source']] || {}\n source_dir = source['path']\n source_files = item['files'] || []\n target = @targets[item['target']] || {}\n table_name = target['table']\n \n file_list = build_file_list(source_dir, source_files)\n transform = @transforms[item['transform']] || {}\n \n file_list.each do |file_name|\n columns = parse_file(file_name, source_dir, transform)\n \n create_table(target, columns)\n \n data_file_name = File.basename(file_name, '.*') + '.dat'\n data_file_path = File.full_path(@working_dir, data_file_name)\n error_file_name = File.basename(file_name, '.*') + '.err'\n error_file_path = File.full_path(@error_dir, error_file_name)\n \n bcp_file(table_name, data_file_path, error_file_path, target)\n end\n end\n end", "title": "" }, { "docid": "7afefd7b9263722653902e192bf0c7da", "score": "0.56344074", "text": "def import(name, args, return_type)\n end", "title": "" }, { "docid": "689c7afaf5718fca8912538ca34bdbca", "score": "0.56214696", "text": "def import\n \tExpense.import(params[:file])\n \tredirect_to root_url, notice: \"Products imported.\"\n \tend", "title": "" }, { "docid": "0a01329e93ed51964c76e563a2b9c533", "score": "0.5619132", "text": "def import(*fns) # :doc:\n fns.each do |fn|\n Rake.application.add_import(fn)\n end\n end", "title": "" }, { "docid": "854cd83a00cbfb34ecf76a9bd73f0c00", "score": "0.56179076", "text": "def import(resource_config={})\n raise ArgumentError unless self.template_releases.exists?\n #only released template is importable\n #create theme record\n new_theme = self.dup\n new_theme.title = \"Imported \"+ new_theme.title\n new_theme.site_id = SpreeTheme.site_class.current.id\n new_theme.release_id = self.template_releases.last.id\n new_theme.save!\n new_theme\n end", "title": "" }, { "docid": "f6aae8a1a6016af47b4e37e60d8d3f38", "score": "0.5596684", "text": "def import_item_lines(file_name)\n @items.import_item_lines file_name\n end", "title": "" }, { "docid": "6bfa4f443ad431d37148513f3774d46f", "score": "0.5585306", "text": "def import\n spree_product = update_or_create\n # TODO: Move each of these to its own importer class?\n set_stock(spree_product) unless @product.stock.blank?\n add_images(spree_product) unless @product.image_urls.count.zero?\n add_taxons(spree_product) unless @product.taxon_strings.blank?\n spree_product\n end", "title": "" }, { "docid": "1f3158f29e73c46543a44db6f60fe538", "score": "0.5582717", "text": "def import(filenames)\n setup\n filenames.each {|f| import_file(f)}\n self\n end", "title": "" }, { "docid": "98aacb14b1ac36a4306e6371e053676e", "score": "0.5581647", "text": "def create_import url\n post_request \"imports\", {url: url}\n end", "title": "" }, { "docid": "d188041be9d746922d30477684d99a3a", "score": "0.5565305", "text": "def import\n\n start_connections\n\n result = options[:result]\n\n result = File.join(result, DEFAULT_IMPORT_TEMPLTE) if File.directory?(result)\n\n logger.info \"Datashift: Starting Import mapping template generation to [#{result}]\"\n\n mapper = DataShift::ConfigGenerator.new\n\n puts \"Creating new configuration file : [#{result}]\"\n begin\n mapper.write_import(result, options[:model], options)\n rescue StandardError => x\n puts \"ERROR - Failed to create config file #{result}\"\n puts x.message\n end\n\n end", "title": "" }, { "docid": "0da91269308f486aeca0c0bc4cf7a5e1", "score": "0.553736", "text": "def set_import\n @import = TrelloImport.find(params[:id])\n end", "title": "" }, { "docid": "31b1550ccaebd0f3e6333cb205162f90", "score": "0.55290335", "text": "def import\n \t@brands = Brands.all()\n end", "title": "" }, { "docid": "68eb01dfe09a7f943e600edb8699ce92", "score": "0.5524342", "text": "def load_recipes(filename)\n CSV.foreach(filename, :headers => true) do |row|\n recipeparams = {:id => row[0],\n :name => row[1],\n :description => row[2],\n :ingredients => row[3],\n :directions => row[4]\n }\n @recipes << Recipe.new(recipeparams)\n end\n\n @recipes\n end", "title": "" }, { "docid": "ea780ecc611458ac8050cda72711ee51", "score": "0.55225384", "text": "def import_product_sets \\\n parent,\n input_config,\n options: nil,\n &block\n request = {\n parent: parent,\n input_config: input_config\n }.delete_if { |_, v| v.nil? }\n request = Google::Gax.to_proto request, Google::Cloud::Vision::V1::ImportProductSetsRequest\n @import_product_sets.call(request, options, &block)\n end", "title": "" }, { "docid": "e64ce492658a375331350bac3630c7b3", "score": "0.5510044", "text": "def import(file)\n app_resource_data.import file\n app_resource_dir.save\n save\n end", "title": "" }, { "docid": "0b272b5aea265e9ad5cb9ec2e2ecf9fe", "score": "0.55060726", "text": "def import\n @@all.each do |file|\n new_song = Song.new_by_filename(file)\n new_song.artist.add_song(new_song)\n end\n @@all\n end", "title": "" }, { "docid": "5c426f75bcee72c12032fe5994772497", "score": "0.5497273", "text": "def import(*paths)\n if paths.any?\n @@imports = @@imports.concat(paths)\n end\n @@imports\n end", "title": "" }, { "docid": "0fd0572094d672fce2f105285fa8afbd", "score": "0.5488915", "text": "def import(*args)\n base_path = current_path.nil? ? nil : File.dirname(current_path)\n args.each do |fn|\n fn = File.expand_path(fn, base_path)\n add_import(fn)\n end\n end", "title": "" }, { "docid": "604d811619e8044b4332d7ca05fa46ac", "score": "0.5486894", "text": "def sequential_import\n each_object_to_import do |object|\n repr = representation_class.from_api_response(object)\n\n importer_class.new(repr, project, client).execute\n end\n end", "title": "" }, { "docid": "3a6ada6807ab071f2c38cde2e6b9e012", "score": "0.54804236", "text": "def import_all(options)\n import_docx_specific_steps(options)\n import_folio_xml_specific_steps(options)\n import_idml_specific_steps(options)\n import_shared_steps(options)\n end", "title": "" }, { "docid": "352d636531d0c7a4155ec44ab268dfdd", "score": "0.54782677", "text": "def import_cities_from_file\n cities = JSON.parse File.read(\"#{PATH}/db/cities_pop.json\")\n cities.each do |city|\n import city\n end\nend", "title": "" }, { "docid": "1968139b07a68e118b2f936b93040ab2", "score": "0.54777205", "text": "def import(*fns); end", "title": "" }, { "docid": "43d8f860b7c449665ec5ce5ebfd69d15", "score": "0.5475012", "text": "def commence_comfy_import(answer, source)\n logger = ComfortableMexicanSofa.logger\n ComfortableMexicanSofa.logger = Logger.new(STDOUT)\n site = Comfy::Cms::Site.first.identifier\n folder = source.split('/').last\n\n if answer == 'all'\n Rake::Task[\"comfy:cms_seeds:import\"].invoke(folder, site)\n else\n module_name = \"ComfortableMexicanSofa::Seeds::#{answer.singularize.capitalize}::Importer\".constantize\n module_name.new(folder, site).import!\n end\n \n ComfortableMexicanSofa.logger = logger\n end", "title": "" }, { "docid": "ee665007d0ec507f75f9a62c79ff4f26", "score": "0.5466018", "text": "def import_all(options)\n import_folio_xml_specific_steps(options)\n import_idml_specific_steps(options)\n import_shared_steps(options)\n end", "title": "" }, { "docid": "41e19d3186b946c7de620f3bbb66823e", "score": "0.5443693", "text": "def import_all(path, caller_location = caller(CALLER_RANGE).first)\n Modulation.import_all(path, caller_location)\n end", "title": "" }, { "docid": "2d5a33f4b115204e6f33c1388c12faa2", "score": "0.5443405", "text": "def import file_path\n File.open(file_path).read.split(\";\").each do |line|\n title, author, description, year_published, edition = line.split(\",\")\n @library_books << Book.new(title, author, description, year_published, edition)\n end\n print_all_books\n end", "title": "" }, { "docid": "b51f0085f980d19459de95b3fc2ff9ec", "score": "0.54417825", "text": "def import_collection(collection)\n puts \"Ingesting #{collection.name} (#{collection.alias})\"\n\n # delete any old collection containers\n url = \"#{@root_container_url}/#{collection.slug}\"\n @http.delete(url) rescue nil\n @http.delete(\"#{url}/fcr:tombstone\") rescue nil\n\n # create a new collection container\n container = Fedora::Container.create(@root_container_url, collection.slug)\n\n # GET the newly created container's JSON-LD representation\n struct = JSON.parse(container.fedora_json_ld)\n\n # append metadata to the JSON-LD representation via PUT\n @http.put(container.fedora_metadata_url,\n collection.to_json_ld(container.fedora_url, struct),\n { 'Content-Type' => 'application/ld+json' })\n\n File.open(File.join(File.expand_path(@source_path),\n collection.alias + '.xml')) do |file|\n doc = Nokogiri::XML(file)\n doc.xpath('//record').each do |record|\n item = Contentdm::Item.from_cdm_xml(@source_path, collection, record)\n self.import_item(item, container.fedora_url)\n end\n end\n end", "title": "" }, { "docid": "d3a0ef4265a9f26e682fcc9e82abf2ca", "score": "0.54405683", "text": "def load_file full_name\n cr_count = 0\n rows = CSV.read( full_name , {:col_sep=>\"\\t\",:quote_char=>\"\\t\"} )\n\n if IMPORT_PRODUCT_SETTINGS[:first_row_is_headings]\n col = get_column_mappings(rows[0])\n else\n col = IMPORT_PRODUCT_SETTINGS[:column_mappings]\n end\n\n log(\"Importing products for #{full_name} began at #{Time.now}\")\n log(\"Elements for import in file:#{rows.size}\")\n rows[IMPORT_PRODUCT_SETTINGS[:rows_to_skip]..-1].each do |row|\n #rows[0..10].each do |row|\n\n product_information = {}\n\n #Automatically map 'mapped' fields to a collection of product information.\n #NOTE: This code will deal better with the auto-mapping function - i.e. if there\n #are named columns in the spreadsheet that correspond to product\n # and variant field names.\n\n col.each do |key, value|\n #Trim whitespace off the beginning and end of row fields\n row[value].try :strip!\n product_information[key] = row[value]\n end\n\n #Manually set available_on if it is not already set\n product_information[:available_on] = Date.today - 1.day if product_information[:available_on].nil?\n product_information[:master_price] = product_information[:cost_price].to_f*product_information[:margin].to_f\n product_information[:permalink] = create_permalink_url(product_information[:name].clone, product_information[:sku])\n\n #log(\"#{pp product_information}\")\n\n # распределение по моим таксонам\n #my_real_taxonomies = Spree::Taxon.select(:name).where(\"parent_id IS NOT NULL\")\n\n taxons = Spree::Taxon.all\n if product_information[:category]\n taxons.each do |_taxon|\n if product_information[:category].include? _taxon[:name]\n product_information[:tax] = _taxon\n product_information[:for_import] = true\n end\n end\n end\n\n\n\n variant_comparator_field = IMPORT_PRODUCT_SETTINGS[:variant_comparator_field].try :to_sym\n variant_comparator_column = col[variant_comparator_field]\n\n if IMPORT_PRODUCT_SETTINGS[:create_variants] and variant_comparator_column and\n p = Spree::Product.where(variant_comparator_field => row[variant_comparator_column]).first\n\n log(\"found product with this field #{variant_comparator_field}=#{row[variant_comparator_column]}\")\n p.update_attribute(:deleted_at, nil) if p.deleted_at #Un-delete product if it is there\n p.variants.each { |variant| variant.update_attribute(:deleted_at, nil) }\n create_variant_for(p, :with => product_information)\n else\n if product_information[:for_import] == true\n create_product_using(product_information)\n cr_count = cr_count+1\n else\n log(\"skip product becose #{product_information[:category]} not in our taxon \")\n end\n\n end\n end\n\n #if IMPORT_PRODUCT_SETTINGS[:destroy_original_products]\n # @products_before_import.each { |p| p.destroy }\n #end\n log(\"Importing products for #{full_name} completed at #{DateTime.now} imported #{cr_count} elements\")\n end", "title": "" }, { "docid": "1936450707041c093f1618c466da4357", "score": "0.5436227", "text": "def call\n csv = CSV.parse(Paperclip.io_adapters.for(@import.file).read, headers: true, col_sep: COL_SEPARATOR)\n\n csv.each do |row|\n next if row.to_h.values.all?(&:nil?)\n\n create_product(row)\n end\n end", "title": "" }, { "docid": "c4520e66ca85de2a49b363dc11da6227", "score": "0.54324496", "text": "def bulk_import!\n remote_filenames = [ENV['BULK_IEP_IMPORT_TARGET']]\n\n import_ieps!(remote_filenames)\n end", "title": "" }, { "docid": "83a5ed6eb15f0c1c01bdc129294e7e90", "score": "0.542936", "text": "def import\n # Connect to Shopify\n shopify_integration = ShopifyIntegration.new(\n url: current_account.shopify_account_url,\n password: current_account.shopify_password,\n account_id: current_account.id\n )\n\n respond_to do |format|\n shopify_integration.connect\n result = shopify_integration.import_products\n format.html { redirect_to ({action: :index}), notice: \"#{result[:created].to_i} created, #{result[:updated]} updated, #{result[:failed]} failed.\" }\n end\n end", "title": "" }, { "docid": "a0df2889e86404fc5ad2cc514d3fa474", "score": "0.542762", "text": "def import\n self.files.collect do |file_name|\n Song.new_by_filename(file_name)\n end\n #Artist.all\n end", "title": "" }, { "docid": "77e2ccd000e28d89e65920ae4d8b28e2", "score": "0.54272366", "text": "def import # imports the files into the library by creating songs from a filename\n files.each {|song| Song.new_by_filename(song)}\n end", "title": "" }, { "docid": "1db40b646c2f9dbfa478dc75c73344ac", "score": "0.54257673", "text": "def set_imports_import\n @imports_import = Imports::Import.find(params[:id])\n end", "title": "" }, { "docid": "26b3598ef3108624e3435e632e2e23a3", "score": "0.5418853", "text": "def import(dir)\n setup\n create_basics\n import_data(dir)\n create_relations if @relations\n create_optionals if @optionals\n create_optional_relations if @relations and @optionals\n end", "title": "" }, { "docid": "9bc2c58d30239d78cdec4550c01b3f6f", "score": "0.5417808", "text": "def import id\n get_request \"imports/#{id}\"\n end", "title": "" }, { "docid": "4660bb69e41142b3b34e83c3e2bbc44a", "score": "0.5411321", "text": "def before_import\n end", "title": "" }, { "docid": "17cdd28c4f0006bef4dc78e5ba440326", "score": "0.5409218", "text": "def add_from_catalog(catalog, test_module)\n catalog.to_a.each do |resource|\n # check filters\n next if @filters.include?(resource.to_s)\n if resource.type == 'Class'\n # if the resource is a class, make sure the class belongs to\n # module test_module\n module_name = resource.title.split('::').first.downcase\n next if module_name != test_module\n elsif resource.file\n # otherwise, the source file should be available, so make\n # sure the manifest declaring the resource is in\n # test_module's directory tree or the site manifest(s)\n if Puppet.version.to_f >= 4.0\n paths = [\n (Pathname.new(Puppet[:environmentpath]) + 'fixtures' + 'modules' + test_module + 'manifests').to_s,\n (Pathname.new(Puppet[:environmentpath]) + 'fixtures' + 'manifests' + 'site.pp').to_s\n ]\n else\n paths = Puppet[:modulepath].split(File::PATH_SEPARATOR).map do |dir|\n (Pathname.new(dir) + test_module + 'manifests').to_s\n end\n paths << Puppet[:manifest]\n end\n next unless paths.any? { |path| resource.file.include?(path) }\n end\n add(resource)\n end\n end", "title": "" }, { "docid": "9bec7c88c981ac19a6ddecc757cdd611", "score": "0.54065245", "text": "def import(*sets)\n sets.each do |set|\n commands.merge! set.commands\n helper_module.send :include, set.helper_module\n end\n end", "title": "" }, { "docid": "4c339d75bdd67382352182d08dab7205", "score": "0.540055", "text": "def import\n fetch\n convert\n load\n end", "title": "" }, { "docid": "8bd63820d886b6029027cb30c293ee43", "score": "0.5392249", "text": "def custom_imports\n return []\n end", "title": "" }, { "docid": "ce584fed471b91133fcc104d57e24a12", "score": "0.5383668", "text": "def createTemplates\n\n\tapp = ImportApplication.new 'Shop'\n\tapp.steps.push ImportStep.new 'compile source code', [ 'automated', 'maven-build' ]\n\tapp.steps.push ImportStep.new 'unit testing', [ 'automated', 'maven-build' ]\n\tapp.steps.push ImportStep.new 'jmeter tests', [ 'automated', 'maven-build' ]\n\tapp.steps.push ImportStep.new 'deploy on pre production', [ 'manual', 'shellscript' ]\n\tapp.steps.push ImportStep.new 'switch production clusters', [ 'manual', 'shellscript' ]\n\n\tsaveTemplateReleaseConfiguration(app)\n\n\tapp = ImportApplication.new 'Admintool'\n\tapp.steps.push ImportStep.new 'compile source code', [ 'automated', 'maven-build' ]\n\tapp.steps.push ImportStep.new 'unit testing', [ 'automated', 'maven-build' ]\n\tapp.steps.push ImportStep.new 'jmeter tests', [ 'automated', 'maven-build' ]\n\tapp.steps.push ImportStep.new 'deploy on pre production', [ 'manual', 'shellscript' ]\n\tapp.steps.push ImportStep.new 'switch production clusters', [ 'manual', 'shellscript' ]\n\n\tsaveTemplateReleaseConfiguration(app)\n\nend", "title": "" }, { "docid": "8fad193803295aaa73a0141cf0d16229", "score": "0.53800523", "text": "def deploy_rawdata\n\n \n arguments_rawdata = %W{\n import -mode local\n -input_file_path data/AAPL_1M_CSV.csv\n -input_file_type delimited_text\n -delimited_uri_id Key\n -delimited_root_name Raw_data\n -output_uri_prefix /Raw_data/\n -output_collections Raw_data\n -transform_module /transform/Rawdata-transform.xqy\n -transform_namespace http://marklogic.com/transform/rawdata \n -transform_function transform\n -output_permissions\n #{role},read,#{role},update,#{role},insert,#{role},execute\n }\n mlcp(arguments_rawdata)\nend", "title": "" }, { "docid": "5cc929697d00b309660d557907326bd6", "score": "0.53700703", "text": "def import_cookbooks\n @import.each_child do |cb_bundle|\n\n cb_full_tar = File.basename(cb_bundle)\n\n begin\n cb_version = extract_version(cb_full_tar)\n cb_name = extract_name(cb_full_tar)\n cb_single_tar = \"#{cb_name}_#{cb_version}.tar.gz\"\n cb_dir = \"#{@path}/#{cb_name}/#{cb_version}\"\n\n log.info \"Found cookbook bundle #{File.basename(cb_bundle)} in import dir (name: #{cb_name} version: #{cb_version}).\"\n\n if !File.exist?(\"#{cb_dir}/#{cb_full_tar}\") || !File.exist?(\"#{cb_dir}/#{cb_single_tar}\")\n log.info \"Importing cookbook bundle #{cb_full_tar}...\"\n\n FileUtils.mkdir_p cb_dir unless Dir.exist?(cb_dir)\n\n FileUtils.cp(cb_bundle, cb_dir)\n\n unpack_single_cbs(cb_dir, cb_full_tar)\n\n else\n log.warn \"Cookbook #{cb_name}@#{cb_version} already exists! WILL NOT OVERWRITE!\"\n log.warn \"Removing already imported cookbook from import dir...\"\n end\n\n FileUtils.rm(cb_bundle)\n\n rescue => ex\n log.error \"Failed to import cookbook pkg #{cb_full_tar}: #{ex.message}\"\n log.info \"Leaving cookbook pkg #{cb_full_tar} untouched.\"\n end\n end\n end", "title": "" }, { "docid": "0097601a007cea0826b32ce3ef4938c9", "score": "0.53527653", "text": "def import_many files\n # set @name\n import_single \"supportconfig\", \"supportconfig.txt\"\n # check for already imported files\n content = Content::Content.new self, @handle\n already = content._read :content, self.name\n id = nil\n if already\n id = already[\"_id\"]\n already = already[\"_source\"][\"files\"]\n else\n already = []\n end\n files.each do |entry|\n if already.include? entry\n puts \"Have #{entry} already, skipping\"\n next\n end\n next unless entry =~ /^(.*)\\.txt$/\n puts \"*** #{entry} <#{@handle.inspect}>\"\n if $1 == \"supportconfig\"\n raise \"'supportconfig.txt' is implicit\"\n end\n import_single $1, entry\n end\n unless @name\n raise \"Couldn't determine name !\"\n end\n if id\n content._update :content, id, { doc: { files: (files + already).uniq } }\n else\n content._write :content, files: files\n end\n end", "title": "" }, { "docid": "b8f83d8e413ccd36a45136364f9c81bb", "score": "0.5352191", "text": "def change_set_import(resource)\n Aws::Cfn.changeset(\n change_set_type: :IMPORT,\n resources_to_import: [ resource ],\n stack_name: stack_name,\n template_body: cfn_template_body,\n template_url: cfn_template_url,\n parameters: cfn_parameters_update,\n capabilities: cfn_capabilities,\n notification_arns: cfn_notification_arns,\n change_set_name: change_set_name,\n ).id\n rescue ::Aws::CloudFormation::Errors::ValidationError => e\n fail_task(e.message)\n end", "title": "" }, { "docid": "96bfcba19a4a1109e8444b19540a00df", "score": "0.533357", "text": "def set_import\n @import = Imports::Import.find(params[:id])\n end", "title": "" }, { "docid": "fd2d850c24d01c4a962f41ec501fe1a8", "score": "0.5327081", "text": "def import_courses sems\n sems = get_semesters(sems)\n sems.each {|s| sh \"ruby app/scrapers/courses_importer.rb #{s}\"}\nend", "title": "" }, { "docid": "42dc50772b365af3a1be8acfb1ef1d35", "score": "0.532542", "text": "def import!(*args)\n errors = nil\n subscriber = ActiveSupport::Notifications.subscribe('import_objects.chewy') do |*notification_args|\n errors = notification_args.last[:errors]\n end\n import(*args)\n raise Chewy::ImportFailed.new(self, errors) if errors.present?\n true\n ensure\n ActiveSupport::Notifications.unsubscribe(subscriber) if subscriber\n end", "title": "" }, { "docid": "e400cedcc29c0b64a9c85f2cbe41c638", "score": "0.5324347", "text": "def import\n files.each {|file|Song.new_by_filename(file)}\n end", "title": "" }, { "docid": "eff5dab8f3d4bcaee6bb3bcf578a1b88", "score": "0.5320433", "text": "def import(name, explicit = true)\n\t\t\t@imports << Import.new(name, explicit, @options.dup)\n\t\tend", "title": "" }, { "docid": "579f6d6c7d40cc69afa95e2e85b14d66", "score": "0.531945", "text": "def imports(name)\n client.list_imports(export_name: name).map(&:imports)\n rescue ::Aws::CloudFormation::Errors::ValidationError\n []\n rescue ::Aws::CloudFormation::Errors::Throttling => e # this call rate-limits aggressively\n warn(e.message)\n sleep 1\n retry\n end", "title": "" }, { "docid": "29bb37a856f0166e2a63c427dd2a9375", "score": "0.5312465", "text": "def import\n begin\n file = params[:file]\n CSV.foreach(file.path, headers: true) do |row|\n Stockproduct.create!(\n :brand => row['brand'],\n :name => row['model'],\n :description => row['description'],\n :ca_status => false,\n :us_status => false,\n :size_details => row['size_details'],\n :cad_msrp => row['cad_msrp'].to_i,\n :usd_msrp => row['usd_msrp'].to_i,\n :sku => row['sku']\n )\n end # end CSV.foreach\n redirect_to admin_stockproducts_url, notice: \"Products successfully imported.\"\n rescue\n redirect_to admin_stockproducts_new_import_url, alert: \"There was an error. Check your file and try again.\"\n end\n end", "title": "" }, { "docid": "dde7e12335e2f8b9909854cab3cf7847", "score": "0.53123605", "text": "def import! *args\n errors = nil\n subscriber = ActiveSupport::Notifications.subscribe('import_objects.chewy') do |*args|\n errors = args.last[:errors]\n end\n import *args\n ActiveSupport::Notifications.unsubscribe(subscriber)\n raise Chewy::FailedImport.new(self, errors) if errors.present?\n true\n end", "title": "" }, { "docid": "cde530d624fd5f318a3f8293ac8c4edb", "score": "0.5307224", "text": "def import_all_seed_files\n Mig.new.reset_pk_sequence\n\n ServCsvTool.new.import_uni_seeds('uni_act', 'cop_formated.csv')\n\n # ServCsvTool.new.import_uni_seeds('uni_act', '1_acts_top_150.csv')\n # ServCsvTool.new.import_uni_seeds('uni_act', '2_wards_500.csv')\n # ServCsvTool.new.import_uni_seeds('uni_act', '3_acts_cop.csv')\n # ServCsvTool.new.import_uni_seeds('uni_act', '4_acts_sfdc.csv')\n # ServCsvTool.new.import_uni_seeds('uni_act', '5_acts_scraped.csv')\n # ServCsvTool.new.import_uni_seeds('uni_act', '6_acts_geo_locations.csv')\n\n # ########## STANDARD SEED IMPORT BELOW ##########\n # ServCsvTool.new.import_standard_seeds('who', '8_whos.csv')\n # ServCsvTool.new.import_standard_seeds('brand', '9_brands.csv')\n # ServCsvTool.new.import_standard_seeds('term', '10_terms.csv')\n end", "title": "" }, { "docid": "31b0ddb4e4b2cc60f9ecc3c5c194e0d4", "score": "0.5302739", "text": "def rest__import\n rest_ok_response install_from_dtkn_helper(:service_module)\n end", "title": "" }, { "docid": "5d348f7b26a050641748b246bca8a097", "score": "0.52906513", "text": "def imported\n ahoy.track \"tools-imported\", nil\n end", "title": "" }, { "docid": "ac90670bab9b50fb2df2f1bbc4e73104", "score": "0.5288627", "text": "def import\n #Inventory.import_enable\n import = Import.new(file:(params[:file]))\n import.run!\n import.report.message\n redirect_to root_url, notice: \"imported and enabled import for all values not set by user.\"\n end", "title": "" }, { "docid": "37272c7d43dffbb5be9f6ea80c40a785", "score": "0.52866095", "text": "def import_lead\n end", "title": "" } ]
7342865ca3bd6d3dc674efec5982e3f8
GET /financials GET /financials.json
[ { "docid": "c7979de794df0ab2951895e6aa551602", "score": "0.0", "text": "def index\n respond_to do |format|\n format.html{ redirect_to socioeconomic_record_path + \"#tabs-financial\" }\n format.js{ render 'application/index' }\n format.pdf{}\n format.csv{ params[:length] = 500\n options = Hash.new\n options[:status_type] = params[:status_type]\n json = FinancialDatatable.new(view_context, options).as_json\n send_data Financial.to_csv(json[:data]), filename: \"Financial-#{Date.today}.csv\"\n }\n format.json{\n options = Hash.new\n options[:status_type] = params[:status_type]\n render json: FinancialDatatable.new(view_context,options)\n }\n end\n end", "title": "" } ]
[ { "docid": "f36f6e17ae25fb2d83bebc5ceab6e79b", "score": "0.8358205", "text": "def get_financials\n response = RestClient.get(\"https://api.iextrading.com/1.0/stock/#{self.ticker}/financials\")\n JSON.parse(response.body)\n end", "title": "" }, { "docid": "73a9b8a89d0ccc6aa3143ceb3b03ba51", "score": "0.69776493", "text": "def show\n @banking_financial = BankingFinancial.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @banking_financial }\n end\n end", "title": "" }, { "docid": "83918875495770cb3927ec288333189c", "score": "0.69051075", "text": "def index\n @financial_accounts = FinancialAccount.all\n end", "title": "" }, { "docid": "d14b9f595b6d94c04a1a8d07e4f89b9d", "score": "0.68963456", "text": "def index\n\n @daily_finances = DailyFinance.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @daily_finances }\n end\n end", "title": "" }, { "docid": "6c84323b21e6fb54e3f8ff7749ef9279", "score": "0.67789364", "text": "def index\n @financials = @pitch.financials\n end", "title": "" }, { "docid": "f5dd057c2c8ee0b163b6defbdb00ddc9", "score": "0.6763652", "text": "def index\n @sulabh_financials = SulabhFinancial.all\n end", "title": "" }, { "docid": "63f65c8f2061178f7ac30acaaabb535b", "score": "0.6664806", "text": "def index\n @financial_types = FinancialType.all\n end", "title": "" }, { "docid": "a390421536a7949ef9fd6d05c3384dd7", "score": "0.66540724", "text": "def index\n @financial_years = FinancialYear.all\n end", "title": "" }, { "docid": "590f38200eb637f26032c34c4f274c8c", "score": "0.66091186", "text": "def index\n @financial_institutions = FinancialInstitution.all\n\n render json: @financial_institutions\n end", "title": "" }, { "docid": "059ddf30ee0d515c770817ad48b7ed36", "score": "0.65199536", "text": "def index\n @financial_entries = FinancialEntry.paginate(:page => params[:page], :per_page => 30)\n end", "title": "" }, { "docid": "360c2228b6c88eade9d5b1a34b925de6", "score": "0.6466499", "text": "def set_financial\r\n @financial = Financial.find(params[:id])\r\n end", "title": "" }, { "docid": "614e7229d903dca2d68de898fa40af07", "score": "0.6461521", "text": "def show\n @finance = Finance.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @finance }\n end\n end", "title": "" }, { "docid": "8c2adb2ee18e603d7721aeda3ff1f4e2", "score": "0.64568484", "text": "def index\n @financial_reports = FinancialReport.all\n end", "title": "" }, { "docid": "258f5849e83e6d93379beb1f29b421aa", "score": "0.6446605", "text": "def set_financial\n @financial = Financial.find(params[:id])\n add_breadcrumb @financial, @financial\n rescue ActiveRecord::RecordNotFound\n render_404\n end", "title": "" }, { "docid": "a1323c372b91d29f5853dfbca8ba40a1", "score": "0.64270955", "text": "def index\n @stocks = Stock.includes(:financial_type).all\n end", "title": "" }, { "docid": "23319388611a5ff937c914cfaf58f7d1", "score": "0.64208907", "text": "def get_financial_details\n data = {}\n yc = YahooCompany.new @name\n data[\"financial\"] = yc.data\n puts \"ydone\"\n\n data\n end", "title": "" }, { "docid": "720611274992a217f45058c35ea65f8e", "score": "0.64109206", "text": "def show\n @daily_finance = DailyFinance.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @daily_finance }\n end\n end", "title": "" }, { "docid": "d938f90481292e1f3e0de77b338a64de", "score": "0.6394351", "text": "def index \n @actual_payment = actualPayment\n @financial_accounts = current_user.financial_accounts\n end", "title": "" }, { "docid": "e762235863dcedbd8e479d544f3d23c6", "score": "0.6360166", "text": "def create\n @financial = Financial.new(financial_params)\n\n respond_to do |format|\n if @financial.save\n format.html { redirect_to financials_url, notice: 'Financial was successfully created.' }\n # format.json { render :show, status: :created, location: @financial }\n else\n format.html { render :new }\n format.json { render json: @financial.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "266cf83b5068256e0f76ef2882cd4b10", "score": "0.6307747", "text": "def index\n @financial_transactions = FinancialTransaction.all.where(\"user_id =?\", current_user.id)\n end", "title": "" }, { "docid": "1c429f648724d0226343dcadae9a0ece", "score": "0.6268387", "text": "def getWithdrawalFees\n request \"/Payment/getWithdrawalFees.json\"\n end", "title": "" }, { "docid": "0cd254ea80be0cff5d46612fe2852b72", "score": "0.6260953", "text": "def index\n @financial_assistance_options = FinancialAssistanceOption.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @financial_assistance_options.map(&:attributes) }\n end\n end", "title": "" }, { "docid": "8d1d885fd1080475fba6afc1adcffece", "score": "0.6243323", "text": "def new\n @banking_financial = BankingFinancial.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @banking_financial }\n end\n end", "title": "" }, { "docid": "3e895a14cb78c2f613e8c7fea8d93c7c", "score": "0.6235881", "text": "def show\n render json: @financial_institution\n end", "title": "" }, { "docid": "df57d234392811f15ceff58e65b5e342", "score": "0.6229321", "text": "def index\n @fiscals = Fiscal.all\n end", "title": "" }, { "docid": "61a58d968eb305e5cae4e948d2e90d47", "score": "0.6226948", "text": "def index\n @holidays = Holiday.all\n render json: @holidays\n end", "title": "" }, { "docid": "32352d453201e974ac6eca3d5b0aeeb2", "score": "0.61856395", "text": "def index\n @funding_rounds = @company.funding_rounds\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @funding_rounds }\n end\n end", "title": "" }, { "docid": "c7151060488203294a47e7c3cf3c1d10", "score": "0.618283", "text": "def index\n @open_financial_accounts = FinancialAccount.where(status: \"OPEN\")\n @financial_accounts = if params[:q].blank?\n FinancialAccount\n .order(created_at: :desc)\n .includes(:parent_account)\n else\n FinancialAccount\n .search(params[:q])\n end.page(params[:page]).records\n end", "title": "" }, { "docid": "bcf5c1c3820c0f255de59207a6b18442", "score": "0.6170051", "text": "def index\n @loans = Loan.includes(:financial_type).all\n end", "title": "" }, { "docid": "066ed6a0cccc99405b55201025bfe68e", "score": "0.6146729", "text": "def get_fundamental_standardized_financials_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: FundamentalsApi.get_fundamental_standardized_financials ...\"\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling FundamentalsApi.get_fundamental_standardized_financials\"\n end\n # resource path\n local_var_path = \"/fundamentals/{id}/standardized_financials\".sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['ApiKeyAuth']\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 => 'ApiResponseStandardizedFinancials')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: FundamentalsApi#get_fundamental_standardized_financials\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "d1b4a6dfb0da8359fc0d2b6b14d76c23", "score": "0.6146465", "text": "def index\n @fundings = Funding.all\n end", "title": "" }, { "docid": "d1b4a6dfb0da8359fc0d2b6b14d76c23", "score": "0.6146465", "text": "def index\n @fundings = Funding.all\n end", "title": "" }, { "docid": "d1b4a6dfb0da8359fc0d2b6b14d76c23", "score": "0.6146465", "text": "def index\n @fundings = Funding.all\n end", "title": "" }, { "docid": "aef47086401f489182aa4f447de59fef", "score": "0.6145593", "text": "def index\n contracts = @@service.all\n\n respond_to do |format|\n format.html { render \"contracts/index\", :locals => {:contracts => contracts} }\n format.json { render json: contracts }\n end\n end", "title": "" }, { "docid": "baa35f56b353700ef254385def65c095", "score": "0.6119733", "text": "def index\n @financings = Financing.all\n end", "title": "" }, { "docid": "b43e8c83134d554dcc6d5864b4311b31", "score": "0.61135757", "text": "def index\n @holidays = Holiday.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @holidays }\n end\n end", "title": "" }, { "docid": "b43e8c83134d554dcc6d5864b4311b31", "score": "0.61135757", "text": "def index\n @holidays = Holiday.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @holidays }\n end\n end", "title": "" }, { "docid": "b43e8c83134d554dcc6d5864b4311b31", "score": "0.61135757", "text": "def index\n @holidays = Holiday.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @holidays }\n end\n end", "title": "" }, { "docid": "dbb0a4377e80b49e2d09fc8530fde815", "score": "0.61074173", "text": "def index\r\n @holidays = Holiday.all\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @holidays }\r\n end\r\n end", "title": "" }, { "docid": "89dc3b117bc719b8f695fa52670150f2", "score": "0.6102278", "text": "def index\n @budgets = Budget.all\n render json: @budgets\n end", "title": "" }, { "docid": "affe298cd4fc4bd8e475abc350b34bbb", "score": "0.60942376", "text": "def index *_\n @futures = users_futures\n\n render json: @futures\n end", "title": "" }, { "docid": "86045626b4f4d366ff84e19a49db4f95", "score": "0.6074252", "text": "def index\n @monthly_balances = MonthlyBalance.all\n\n render json: @monthly_balances\n end", "title": "" }, { "docid": "00d2154a145dd6e3c492b23273cb0729", "score": "0.60649514", "text": "def index\n @financial_transactions = FinancialTransactionFinder.search(initial_payment_date: params[:initial_payment_date],\n final_payment_date: params[:final_payment_date],\n transaction_type: params[:transaction_type],\n consolidated:params[:consolidated],page: params[:page])\n end", "title": "" }, { "docid": "54e59cff29d1b262b19e9fdaaf0a799a", "score": "0.6051652", "text": "def get_fundamental_reported_financials_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: FundamentalsApi.get_fundamental_reported_financials ...\"\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling FundamentalsApi.get_fundamental_reported_financials\"\n end\n # resource path\n local_var_path = \"/fundamentals/{id}/reported_financials\".sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['ApiKeyAuth']\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 => 'ApiResponseReportedFinancials')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: FundamentalsApi#get_fundamental_reported_financials\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "cc9164965c52c081e5cb87a7aa3a2307", "score": "0.6038653", "text": "def update\n respond_to do |format|\n if @financial.update(financial_params)\n format.html { redirect_to financials_url, notice: 'Financial was successfully updated.' }\n # format.json { render :show, status: :ok, location: @financial }\n else\n format.html { render :edit }\n format.json { render json: @financial.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4265b3c67829b409804705cad7ed6232", "score": "0.60379", "text": "def index\n @api_v1_budgets = Api::V1::Budget.all\n end", "title": "" }, { "docid": "48be83e1d8115da855edbc00f24d133b", "score": "0.60324335", "text": "def financial_statements_get\n @doc.page {\n if @current_user and not (@current_user.is_accountant? and (not @current_user.accountant_allow_read('can_see_finances') or not @current_user.allow_read('payments_manage') or not @current_user.accountant_allow_read('invoices_manage')))\n if @values[:date_from] and @values[:date_till]\n date_from = Time.at(@values[:date_from].to_i).to_date.to_s(:db)\n date_till = Time.at(@values[:date_till].to_i).to_date.to_s(:db)\n end\n date_from = Date.today.to_s(:db) if !date_from\n date_till = Time.now.tomorrow.to_s(:db) if !date_till\n if ['paid', 'unpaid', 'all'].include? @values[:status]\n status = @values[:status]\n else\n status = 'all'\n end\n if @current_user.usertype == 'user'\n user_id = @current_user.id\n ordinary_user = @current_user.is_user?\n elsif @values[:user_id] and @values[:user_id].to_i > 0\n user_id = @values[:user_id].to_i\n end\n if @current_user.is_admin? or @current_user.is_accountant?\n owner_id = 0\n else\n owner_id = @current_user.id\n end\n\n if !@current_user.is_user?\n coi = @current_user.usertype == 'accountant' ? 0 : @current_user.id\n user = User.where(:id => @values[:user_id], :owner_id => coi).first if @values[:user_id]\n else\n user = @current_user\n end\n\n if user or !@values[:user_id]\n\n financial_statements = {}\n financial_statements[\"invoices\"] = Invoice.financial_statements(owner_id, user_id, status, date_from, date_till, ordinary_user)\n financial_statements[\"credit_notes\"] = CreditNote.financial_statements(owner_id, user_id, status, date_from, date_till, ordinary_user)\n default_currency_name = Currency.get_default.name\n financial_statements[\"payments\"] = Payment.financial_statements(owner_id, user_id, status, date_from, date_till, ordinary_user, default_currency_name)\n\n @doc.financial_statement(\"currency\" => default_currency_name) {\n financial_statements.to_a.each { |type, statements|\n statements.to_a.each { |data|\n @doc.statement(\"type\" => type) {\n @doc.status(data.status)\n @doc.count(data.count)\n if type == 'payments' or type == 'credit_notes'\n @doc.price(nice_number(data.price))\n @doc.price_with_vat(nice_number(data.price_with_vat))\n else\n @doc.price(nice_number(data.price * count_exchange_rate(@current_user.currency.name, default_currency_name)))\n @doc.price_with_vat(nice_number(data.price_with_vat * count_exchange_rate(@current_user.currency.name, default_currency_name)))\n end\n }\n }\n }\n }\n else\n @doc.error(_('Dont_be_so_smart'))\n end\n else\n @doc.error(\"Bad login\")\n end\n }\n send_xml_data(@out_string, params[:test].to_i)\n end", "title": "" }, { "docid": "c6c333cd82d12dccab49676cd6818489", "score": "0.6030453", "text": "def index\n @fundations = Fundation.all\n end", "title": "" }, { "docid": "13875ed8f836fc2a87bf85e5b36565a0", "score": "0.60105854", "text": "def index\n @contracts = Contract.all\n render json: @contracts, status: :ok\n end", "title": "" }, { "docid": "391203c21cd2120ae33412f0fb89dbd5", "score": "0.5998198", "text": "def show\n @monthly_f_investment = MonthlyFInvestment.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @monthly_f_investment }\n end\n end", "title": "" }, { "docid": "7b96c22afe721cac3408edf4a041e348", "score": "0.599138", "text": "def set_financial\n @financial = Financial.find(params[:id])\n @current_obj = @financial\n end", "title": "" }, { "docid": "b1ac75bc4b69de0bf8d07fefaf005b70", "score": "0.59804654", "text": "def index\n @funds = Fund.all\n end", "title": "" }, { "docid": "b1ac75bc4b69de0bf8d07fefaf005b70", "score": "0.59804654", "text": "def index\n @funds = Fund.all\n end", "title": "" }, { "docid": "b1ac75bc4b69de0bf8d07fefaf005b70", "score": "0.59804654", "text": "def index\n @funds = Fund.all\n end", "title": "" }, { "docid": "5e8fda5dc5b0161f1a045aa2998b0934", "score": "0.5975936", "text": "def index\n @org_id = !params[:org_id].blank? ? params[:org_id] : session[:org_id]\n @org = Fdn::Organization.find @org_id\n\n @aae_financial_statements = Aae::FinancialStatement.where(\"ent_id=?\", @org.resource_id).order(\"year desc,month desc\").paginate(:per_page => 10, :page => params[:q_page])\n end", "title": "" }, { "docid": "a5c1303f5c472f85b95a00814c22da2f", "score": "0.5975187", "text": "def index\n @fecund_corals = FecundCoral.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fecund_corals }\n end\n end", "title": "" }, { "docid": "9724c237cb9075c32f24decd102a9ee2", "score": "0.5966511", "text": "def index\r\n @daily_deals = DailyDeal.all\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @daily_deals }\r\n end\r\n end", "title": "" }, { "docid": "befb9263440f7449d64b94e50a635f36", "score": "0.59659445", "text": "def index\n @finance_agreements = FinanceAgreement.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @finance_agreements }\n end\n end", "title": "" }, { "docid": "fbebdcdf9174afad3a50d2d68bbc7be2", "score": "0.5964904", "text": "def set_financial_year\n @financial_year = FinancialYear.find(params[:id])\n @financial_entries_cal = @financial_year.financial_entries.order(\"transaction_date desc\")\n @financial_entries = @financial_entries_cal.paginate(:page => params[:page], :per_page => 15)\n\n @monthly_spending = @financial_entries_cal.group_by_month(:transaction_date).sum(:obligation_incurred)\n @weekly_spending = @financial_entries_cal.group_by_week(:transaction_date).sum(:obligation_incurred)\n end", "title": "" }, { "docid": "63d729a7de69b64353e2754efb3f1a87", "score": "0.5952256", "text": "def index\n @financial_objects_incomes = manager.index(current_user)\n @pagy, @financial_objects_incomes = pagy(@financial_objects_incomes)\n end", "title": "" }, { "docid": "e1e4fbbcc513ca8763ab394a944493f4", "score": "0.5942303", "text": "def index\n @financial_insts = FinancialInst.for_user(current_user).order('name ASC')\n respond_to do |format|\n format.html { check_for_admin } # index.html.erb ## admin-only. stupid stupid stupid\n format.xml { render :layout => false } # index.xml.builder\n format.json { render :layout => false } # index.json.erb\n end\n end", "title": "" }, { "docid": "92976730998ed5aa15abc279e314d9d7", "score": "0.5938293", "text": "def show\n @query = params[:query]\n user_key = params[:api_key]\n if user_key == nil\n flash[:notice] = \"No api key provided\"\n else\n Crunchbase::API.key = user_key\n result = {}\n startup = Crunchbase::Organization.get(@query)\n funding_rounds = get_funding_rounds(@query, user_key)\n if startup == nil\n flash[:notice] = \"Company not found\"\n elsif funding_rounds == nil\n flash[:notice] = \"#{@query} has no funding history on Crunchbase\"\n else\n flash[:notice] = nil\n for item in funding_rounds\n path = item[\"path\"]\n funding_round = get_funding_round(path, user_key)\n series = funding_round[\"properties\"][\"series\"]\n value = funding_round[\"properties\"][\"money_raised_usd\"]\n sum_by_series(series, value, result)\n end\n result = result.sort\n @data = []\n @label = []\n for n in result\n @data << n[1]\n @label << n[0]\n end\n end\n end\n end", "title": "" }, { "docid": "b6aa1d642835a97b78fcb297d320570a", "score": "0.59325844", "text": "def index\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @euro_funds }\n end\n end", "title": "" }, { "docid": "9e886887f1c8eba2af49ec295e746d8a", "score": "0.59206605", "text": "def update\n respond_to do |format|\n if @financial_account.update(financial_account_params)\n format.json { render :show, status: :ok, location: @financial_account }\n else\n format.json { render json: @financial_account.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ff0047b8723e7b7c74e4fa622cd54714", "score": "0.59126836", "text": "def get_municipality_financials_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: MunicipalityApi.get_municipality_financials ...\"\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling MunicipalityApi.get_municipality_financials\"\n end\n # resource path\n local_var_path = \"/municipalities/{id}/financials\".sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'fiscal_year'] = opts[:'fiscal_year'] if !opts[:'fiscal_year'].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 = ['ApiKeyAuth']\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 => 'ApiResponseMunicipalitiyFinancials')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: MunicipalityApi#get_municipality_financials\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "eba8dedc382edc2b4d2c0683e491362f", "score": "0.5904621", "text": "def index\n @financial_objects_payment_methods = FinancialObjects::PaymentMethod.where(wallet_id: current_user.wallet_id)\n end", "title": "" }, { "docid": "62f9ca1d6d0b449f5eb5eb1aa0642134", "score": "0.5896916", "text": "def financial\n #~ @show_variance_thresholds = true\n #~ @note = RealEstateProperty.find(params[:id])\n common_financial_wres_swig(params,\"swig\")\n end", "title": "" }, { "docid": "8f7034a12093ee223ce746188a96f0be", "score": "0.588941", "text": "def index\n @annual_budgets = AnnualBudget.all\n end", "title": "" }, { "docid": "bcb8174ebbbd655d76582518c620b7b9", "score": "0.5889279", "text": "def index\n @curriculums = Curriculum.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @curriculums }\n end\n end", "title": "" }, { "docid": "6f38c2bdd8344db0776f87862e55ace4", "score": "0.5887457", "text": "def index\n @fees_and_commissions = FeesAndCommission.page(params[:page]).per(params[:per])\n\n render json: @fees_and_commissions\n end", "title": "" }, { "docid": "361e58e958064c148485005bd103200f", "score": "0.5882174", "text": "def index\n @fund_stocks = FundStock.all\n end", "title": "" }, { "docid": "bec394bbb05baf42b370ea8c5cb7e1fc", "score": "0.58815134", "text": "def index\n @foundation_calculators = FoundationCalculator.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @foundation_calculators }\n end\n end", "title": "" }, { "docid": "7b20740425be090e1cca456a25ec71ba", "score": "0.587108", "text": "def show\n if current_admin_user\n @finance = Finance.find(params[:id])\n else\n @finance = current_user.finances.find(params[:id])\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @finance }\n end\n end", "title": "" }, { "docid": "ab1289fa0a2c7af2938c7874e62d6cb0", "score": "0.58703536", "text": "def index\n @crypto_portfolios = CryptoPortfolio.all\n ## To Read and get data from the api and convert json to readable language \n require 'net/http'\n require 'json'\n @url = 'https://api.coinmarketcap.com/v1/ticker/'\n @uri = URI(@url)\n # Get the uri \n @response = Net::HTTP.get(@uri)\n #parse the json\n @lookup_crypto = JSON.parse(@response)\n\n @profit_loss ||= 0 #If profit loss is nill/ aka not set, set to 0\n end", "title": "" }, { "docid": "28d33b6e879913f67c6a5e78017d20f3", "score": "0.5869319", "text": "def index\n @commission_rates = CommissionRate.first\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @commission_rates }\n end\n end", "title": "" }, { "docid": "3b6c8d308545a76ebdce1d0e6106f80f", "score": "0.5866526", "text": "def index\n @company = current_user.companies.find(params[:company_id])\n @reportings = @company.balances.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reportings }\n end\n end", "title": "" }, { "docid": "50b22376bd38cbb9f54886b42ecf4d07", "score": "0.5863778", "text": "def index\n @contracts = Contract.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @contracts }\n end\n end", "title": "" }, { "docid": "78b36b466199d9a4dce60e7ff6b69b2b", "score": "0.5860096", "text": "def index\n @currencies = Currency.all\n\n render json: @currencies\n end", "title": "" }, { "docid": "556a1b00ce3e70c88109f09480681094", "score": "0.58595127", "text": "def index\n @industries = Industry.order('name ASC')\n @fundings = Funding.ltm_fundings(365)\n @seed_funding = @fundings.for_funding_round('seed')\n @angel_funding = @fundings.for_funding_round('angel')\n @a_funding = @fundings.for_funding_round('a')\n @b_funding = @fundings.for_funding_round('b')\n @c_funding = @fundings.for_funding_round('c')\n @d_funding = @fundings.for_funding_round('d')\n @e_funding = @fundings.for_funding_round('e')\n @f_funding = @fundings.for_funding_round('f')\n @g_funding = @fundings.for_funding_round('g')\n @venture_funding = @fundings.for_funding_round('venture_round')\n @private_equity_funding = @fundings.for_funding_round('private_equity')\n @debt_funding = @fundings.for_funding_round('debt_round')\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @industries }\n end\n end", "title": "" }, { "docid": "2fee5739efc2a2819caba1fd6503bb6a", "score": "0.5848336", "text": "def index\n @finais = Finai.all\n end", "title": "" }, { "docid": "0b985d602766810f336d79e9529c43d3", "score": "0.58469045", "text": "def show\n @funding = Funding.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @funding }\n end\n end", "title": "" }, { "docid": "8f7531f3ec7ea28a1f0bb856f62fa779", "score": "0.58444196", "text": "def index\n @stock_transfer_vouchers = @company.stock_transfer_vouchers.by_branch_id(@current_user.branch_id).by_date(@financial_year)\n @stock_wastage_vouchers = @company.stock_wastage_vouchers.by_branch_id(@current_user.branch_id).by_date(@financial_year)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => StockReceiptVoucherDatatable.new(view_context, @company, @current_user, @financial_year) }\n end\n end", "title": "" }, { "docid": "52f3b95b1b387116991731c611782a53", "score": "0.58412707", "text": "def index\n @folios = Folio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @folios }\n end\n end", "title": "" }, { "docid": "919cb6c3a8c875102333f204835d2f1b", "score": "0.5834998", "text": "def index\n @financialreports = Financialreport.all\n @Newfinancial = Financialreport.new\n end", "title": "" }, { "docid": "cba57682558c6185256567cecbf0abae", "score": "0.5828353", "text": "def index\n @financialinstitutions = Financialinstitution.all\n end", "title": "" }, { "docid": "f2fb2dd2dcd876e49c793805b1b24af9", "score": "0.5823393", "text": "def index\n @vendorfinances = Vendorfinance.all\n end", "title": "" }, { "docid": "a376a81c9e074a64a11bd78a1aec81f5", "score": "0.5823098", "text": "def index\n @periodicals = Periodical.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @periodicals }\n end\n end", "title": "" }, { "docid": "a2afbd505c1be2a014e24bffddb24adf", "score": "0.5821058", "text": "def index\n @sla_contracts = SlaContract.all\n respond_to do |format|\n format.html { render :index }\n format.json { render :json => @sla_contracts }\n end\n end", "title": "" }, { "docid": "754796f74bf1b3e3bdf0a757b3820e37", "score": "0.58193713", "text": "def index\n @funding_infos = FundingInfo.all\n end", "title": "" }, { "docid": "1c5496655afb4ae77eb53e33837ef717", "score": "0.58138955", "text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => SaccountingsDatatable.new(view_context, @company, @current_user, @financial_year)}\n end\n end", "title": "" }, { "docid": "f2f6ecd26b5cc452a2f7f31a50066d0a", "score": "0.58111423", "text": "def index\n @stocks = Stock.all\n json_response(@stocks)\n end", "title": "" }, { "docid": "21012eff9b106f73bbac4a2221e5e82c", "score": "0.58077693", "text": "def show\n @core_selo_fiscal = Core::SeloFiscal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @core_selo_fiscal }\n end\n end", "title": "" }, { "docid": "63f6fbc681f6c57e2fc8d93da8020287", "score": "0.58001584", "text": "def index\n @stocks = Existence.amount_and_pieces_by_fabric_id.paginate(:page => params[:page], per_page: 10)\n\n render json: { stocks: @stocks, total_pages: @stocks.total_pages, current_page: @stocks.current_page }\n end", "title": "" }, { "docid": "7d08482956cdaf08b64e085a9e281616", "score": "0.5793509", "text": "def index\n @holidays = Holiday.all\n\n respond_with(@holidays)\n end", "title": "" }, { "docid": "86199f180cefc5b298b2d1b7581a6aa1", "score": "0.57860464", "text": "def index\n @api_stadia = Api::Stadium.all\n render json: @api_stadia\n end", "title": "" }, { "docid": "c7b773664e5eac5d2f666f2283d31736", "score": "0.57858956", "text": "def index\n @holidaylocals = Holidaylocal.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @holidaylocals }\n end\n end", "title": "" }, { "docid": "f37e91f5a3c340b87c1727d03795e613", "score": "0.5777577", "text": "def index\n\t\tif params[:budget]\n\t\t\t@transactions = Budget.find(params[:budget]).transactions\n\t\telsif params[:time_period]\n\t\t\t@transactions = TimePeriod.find(params[:time_period]).transactions\n\t\telse\n\t\t\t@transactions = current_user.garin.current_period.transactions\n\t\tend\n\t\t@garin = current_user.garin\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json\n\t\tend\n end", "title": "" }, { "docid": "c0f4974644117f8f12aa4f05301f7aea", "score": "0.57627136", "text": "def index\n @money = Money.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @money }\n end\n end", "title": "" }, { "docid": "68e6e6845987d6992ab63b3eb3a892a8", "score": "0.5760651", "text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => AccountDatatable.new(view_context, @company, @current_user, @financial_year)}\n end\n end", "title": "" }, { "docid": "d9fe1421706445c01a101a260a25f1ee", "score": "0.57605904", "text": "def show\n @breadcrumb = 'read'\n @budget_period = BudgetPeriod.find(params[:id])\n @budgets = @budget_period.budgets.paginate(:page => params[:page], :per_page => per_page).order(:budget_no)\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @budget_period }\n end\n end", "title": "" }, { "docid": "3b06d8d166073a1eed09289fcd89edc5", "score": "0.57572544", "text": "def new\n @finance = Finance.new(params[:finance])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @finance }\n end\n end", "title": "" } ]
69beaa3e957d1fc356539d0314d703e1
Custom attribute writer method checking allowed values (enum).
[ { "docid": "6bf7e22280b8bc4396265dc2b8c393e0", "score": "0.0", "text": "def employee_comp_not_exceed=(employee_comp_not_exceed)\n validator = EnumAttributeValidator.new('String', [\"Billing\", \"Percent\", \"Amount\"])\n unless validator.valid?(employee_comp_not_exceed)\n fail ArgumentError, \"invalid value for 'employee_comp_not_exceed', must be one of #{validator.allowable_values}.\"\n end\n @employee_comp_not_exceed = employee_comp_not_exceed\n end", "title": "" } ]
[ { "docid": "af6d0e33773bc681443214ce777b13e1", "score": "0.7088127", "text": "def write_attribute_with_enum(attr, value)\n write_attribute_without_enum attr, converted_enum(attr, value)\n end", "title": "" }, { "docid": "85eec95603dc239e3d18923b2c672b31", "score": "0.64820594", "text": "def attr_enum(name, enum, options={}, &block)\n raise ArgumentError, 'enum' unless enum && enum.respond_to?(:values)\n\n options = {\n :enum => enum,\n :validate => true\n }.merge(options)\n\n required = options[:required] == true\n converter = block_given? ? block : Converters.converter_for(:enum, options)\n\n attr_reader_with_converter name, converter, options\n\n validates name,\n :allow_blank => !required,\n :allow_nil => !required,\n :inclusion => { :in => enum.values } if options[:validate]\n\n attr_writer name\n\n add_attr(name, :enum, converter, options)\n end", "title": "" }, { "docid": "1813a772b2cbcd958e1dc18a502929ae", "score": "0.6429773", "text": "def _attribute_enum?(attr)\n return false unless self.class.respond_to?(:defined_enums)\n self.class.defined_enums.with_indifferent_access.include?(attr)\n end", "title": "" }, { "docid": "acb82197ce967648e755848e4bedefaa", "score": "0.6227689", "text": "def nature_of_business=(nature_of_business)\n validator = EnumAttributeValidator.new('String', [\"personal\", \"agriculture_and_hunting\", \"forestry\", \"fishing\", \"agricultural_by_products\", \"coal_mining\", \"oil_mining\", \"iron_ore_mining\", \"other_metal_and_diamond_mining\", \"other_mineral_mining\", \"manufacturing_of_food_drink_tobacco\", \"manufacturing_of_textiles_leather_fur_furniture\", \"manufacture_of_wooden_products_furniture\", \"manufacture_of_paper_pulp_allied_products\", \"manufacture_of_chemicals_medical_petroleum_rubber_plastic_products\", \"manufacture_of_pottery_china_glass_stone\", \"manufacture_of_iron_steel_non_ferrous_metals_basic_industries\", \"manufacture_of_metal_products_electrical_and_scientific_engineering\", \"manufacture_of_jewelry_musical_instruments_toys\", \"electricity_gas_and_water\", \"construction\", \"wholesale_trade\", \"retail_trade\", \"catering_incl_hotels\", \"transport_storage\", \"communications\", \"finance_and_holding_companies\", \"insurance\", \"business_services\", \"real_estate_development_investment\", \"central_state_governments\", \"community_services_defence_police_prisons_etc\", \"social_services_education_health_care\", \"personal_services_leisure_services\", \"personal_services_domestic_laundry_repairs\", \"personal_services_embassies_international_organisations\"])\n unless validator.valid?(nature_of_business) || nature_of_business.empty?\n fail ArgumentError, \"invalid value for \\\"nature_of_business\\\", must be one of #{validator.allowable_values}.\"\n end\n @nature_of_business = nature_of_business\n end", "title": "" }, { "docid": "7bfae678a265eff1e17561c08eeaa7ee", "score": "0.61418885", "text": "def valid?\n type_validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])\n return false unless type_validator.valid?(@type)\n subtype_validator = EnumAttributeValidator.new('String', ['None', 'Across', 'Bottom', 'BottomLeft', 'BottomRight', 'Center', 'Clockwise', 'CounterClockwise', 'GradualAndCycleClockwise', 'GradualAndCycleCounterClockwise', 'Down', 'DownLeft', 'DownRight', 'FontAllCaps', 'FontBold', 'FontItalic', 'FontShadow', 'FontStrikethrough', 'FontUnderline', 'Gradual', 'Horizontal', 'HorizontalIn', 'HorizontalOut', 'In', 'InBottom', 'InCenter', 'InSlightly', 'Instant', 'Left', 'OrdinalMask', 'Out', 'OutBottom', 'OutCenter', 'OutSlightly', 'Right', 'Slightly', 'Top', 'TopLeft', 'TopRight', 'Up', 'UpLeft', 'UpRight', 'Vertical', 'VerticalIn', 'VerticalOut', 'Wheel1', 'Wheel2', 'Wheel3', 'Wheel4', 'Wheel8'])\n return false unless subtype_validator.valid?(@subtype)\n preset_class_type_validator = EnumAttributeValidator.new('String', ['Entrance', 'Exit', 'Emphasis', 'Path', 'MediaCall', 'OLEActionVerbs'])\n return false unless preset_class_type_validator.valid?(@preset_class_type)\n return false if @shape_index.nil?\n trigger_type_validator = EnumAttributeValidator.new('String', ['AfterPrevious', 'OnClick', 'WithPrevious'])\n return false unless trigger_type_validator.valid?(@trigger_type)\n restart_validator = EnumAttributeValidator.new('String', ['Always', 'WhenNotActive', 'Never', 'NotDefined'])\n return false unless restart_validator.valid?(@restart)\n after_animation_type_validator = EnumAttributeValidator.new('String', ['DoNotDim', 'Color', 'HideAfterAnimation', 'HideOnNextMouseClick'])\n return false unless after_animation_type_validator.valid?(@after_animation_type)\n true\n end", "title": "" }, { "docid": "9a4ca131cd09e0a484d4f7e59c03f493", "score": "0.5809922", "text": "def enum_attr?(name)\n return false unless @enum_attrs\n @enum_attrs.key?(name)\n end", "title": "" }, { "docid": "2ec49776d78d21ab22c5f6abf9205423", "score": "0.57507086", "text": "def classy_enum_attr(attribute, options={})\n enum = (options[:class_name] || options[:enum] || attribute).to_s.camelize.constantize\n allow_blank = options[:allow_blank] || false\n allow_nil = options[:allow_nil] || false\n default = ClassyEnum._normalize_default(options[:default], enum)\n\n # Add ActiveRecord validation to ensure it won't be saved unless it's an option\n validates_inclusion_of attribute,\n in: enum,\n allow_blank: allow_blank,\n allow_nil: allow_nil\n\n # Use a module so that the reader methods can be overridden in classes and\n # use super to get the enum value.\n mod = Module.new do\n\n # Define getter method that returns a ClassyEnum instance\n define_method attribute do\n enum.build(read_attribute(attribute), owner: self)\n end\n\n # Define setter method that accepts string, symbol, instance or class for member\n define_method \"#{attribute}=\" do |value|\n value = ClassyEnum._normalize_value(value, default, (allow_nil || allow_blank))\n super(value)\n end\n\n define_method :save_changed_attribute do |attr_name, arg|\n if attribute.to_s == attr_name.to_s && !attribute_changed?(attr_name)\n arg = enum.build(arg)\n current_value = clone_attribute_value(:read_attribute, attr_name)\n\n if arg != current_value\n if respond_to?(:set_attribute_was, true)\n set_attribute_was(attr_name, enum.build(arg, owner: self))\n else\n changed_attributes[attr_name] = enum.build(current_value, owner: self)\n end\n end\n else\n super(attr_name, arg)\n end\n end\n end\n\n include mod\n\n # Initialize the object with the default value if it is present\n # because this will let you store the default value in the\n # database and make it searchable.\n if default.present?\n after_initialize do\n value = read_attribute(attribute)\n\n if (value.blank? && !(allow_blank || allow_nil)) || (value.nil? && !allow_nil)\n send(\"#{attribute}=\", default)\n end\n end\n end\n\n end", "title": "" }, { "docid": "5e395e619219a91208346fffe6d60ab5", "score": "0.5743216", "text": "def is_enum_param(name)\n [\"bookmarkType\", \"order\", \"role\"].include?(name)\n end", "title": "" }, { "docid": "5d8eb84436220f806eb50c8a0bc66867", "score": "0.5736045", "text": "def valid?\n ENUM.include? @type.downcase.to_sym\n end", "title": "" }, { "docid": "01ae05766f20de61607b667fad9a6158", "score": "0.5708027", "text": "def type=(type)\n validator = EnumAttributeValidator.new('String', ['Appear', 'CurveUpDown', 'Ascend', 'Blast', 'Blinds', 'Blink', 'BoldFlash', 'BoldReveal', 'Boomerang', 'Bounce', 'Box', 'BrushOnColor', 'BrushOnUnderline', 'CenterRevolve', 'ChangeFillColor', 'ChangeFont', 'ChangeFontColor', 'ChangeFontSize', 'ChangeFontStyle', 'ChangeLineColor', 'Checkerboard', 'Circle', 'ColorBlend', 'ColorTypewriter', 'ColorWave', 'ComplementaryColor', 'ComplementaryColor2', 'Compress', 'ContrastingColor', 'Crawl', 'Credits', 'Custom', 'Darken', 'Desaturate', 'Descend', 'Diamond', 'Dissolve', 'EaseInOut', 'Expand', 'Fade', 'FadedSwivel', 'FadedZoom', 'FlashBulb', 'FlashOnce', 'Flicker', 'Flip', 'Float', 'Fly', 'Fold', 'Glide', 'GrowAndTurn', 'GrowShrink', 'GrowWithColor', 'Lighten', 'LightSpeed', 'MediaPause', 'MediaPlay', 'MediaStop', 'Path4PointStar', 'Path5PointStar', 'Path6PointStar', 'Path8PointStar', 'PathArcDown', 'PathArcLeft', 'PathArcRight', 'PathArcUp', 'PathBean', 'PathBounceLeft', 'PathBounceRight', 'PathBuzzsaw', 'PathCircle', 'PathCrescentMoon', 'PathCurvedSquare', 'PathCurvedX', 'PathCurvyLeft', 'PathCurvyRight', 'PathCurvyStar', 'PathDecayingWave', 'PathDiagonalDownRight', 'PathDiagonalUpRight', 'PathDiamond', 'PathDown', 'PathEqualTriangle', 'PathFigure8Four', 'PathFootball', 'PathFunnel', 'PathHeart', 'PathHeartbeat', 'PathHexagon', 'PathHorizontalFigure8', 'PathInvertedSquare', 'PathInvertedTriangle', 'PathLeft', 'PathLoopdeLoop', 'PathNeutron', 'PathOctagon', 'PathParallelogram', 'PathPeanut', 'PathPentagon', 'PathPlus', 'PathPointyStar', 'PathRight', 'PathRightTriangle', 'PathSCurve1', 'PathSCurve2', 'PathSineWave', 'PathSpiralLeft', 'PathSpiralRight', 'PathSpring', 'PathSquare', 'PathStairsDown', 'PathSwoosh', 'PathTeardrop', 'PathTrapezoid', 'PathTurnDown', 'PathTurnRight', 'PathTurnUp', 'PathTurnUpRight', 'PathUp', 'PathUser', 'PathVerticalFigure8', 'PathWave', 'PathZigzag', 'Peek', 'Pinwheel', 'Plus', 'RandomBars', 'RandomEffects', 'RiseUp', 'Shimmer', 'Sling', 'Spin', 'Spinner', 'Spiral', 'Split', 'Stretch', 'Strips', 'StyleEmphasis', 'Swish', 'Swivel', 'Teeter', 'Thread', 'Transparency', 'Unfold', 'VerticalGrow', 'Wave', 'Wedge', 'Wheel', 'Whip', 'Wipe', 'Magnify', 'Zoom', 'OLEObjectShow', 'OLEObjectEdit', 'OLEObjectOpen'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end", "title": "" }, { "docid": "32aca728dc2aa7b5684e66efae126019", "score": "0.57014966", "text": "def set_enum_attrs(subset)\n raise ArgumentError, \"attrs is not a proper subset of available values\" unless subset.all? { |attr| attrs.include? attr }\n @enum_attrs = subset\n end", "title": "" }, { "docid": "ef543a39cb61fc92dc80acd0cd8c67da", "score": "0.56777334", "text": "def country=(country)\n validator = EnumAttributeValidator.new('String', [\"ZZ\", \"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\"])\n unless validator.valid?(country)\n fail ArgumentError, \"invalid value for 'country', must be one of #{validator.allowable_values}.\"\n end\n @country = country\n end", "title": "" }, { "docid": "d5da2fed1c88e6216b3b7c424e2c0435", "score": "0.5601988", "text": "def check_option!(name, definition)\n case name\n when :values\n raise AttributorException, \"Allowed set of values requires an array. Got (#{definition})\" unless definition.is_a? ::Array\n when :default\n raise AttributorException, \"Default value doesn't have the correct attribute type. Got (#{definition.inspect})\" unless type.valid_type?(definition) || definition.is_a?(Proc)\n options[:default] = load(definition) unless definition.is_a?(Proc)\n when :description\n raise AttributorException, \"Description value must be a string. Got (#{definition})\" unless definition.is_a? ::String\n when :required\n raise AttributorException, 'Required must be a boolean' unless definition == true || definition == false\n raise AttributorException, 'Required cannot be enabled in combination with :default' if definition == true && options.key?(:default)\n when :required_if\n raise AttributorException, 'Required_if must be a String, a Hash definition or a Proc' unless definition.is_a?(::String) || definition.is_a?(::Hash) || definition.is_a?(::Proc)\n raise AttributorException, 'Required_if cannot be specified together with :required' if options[:required]\n when :example\n unless definition.is_a?(::Regexp) || definition.is_a?(::String) || definition.is_a?(::Array) || definition.is_a?(::Proc) || definition.nil? || type.valid_type?(definition)\n raise AttributorException, \"Invalid example type (got: #{definition.class.name}). It must always match the type of the attribute (except if passing Regex that is allowed for some types)\"\n end\n when :custom_data\n raise AttributorException, \"custom_data must be a Hash. Got (#{definition})\" unless definition.is_a?(::Hash)\n else\n return :unknown # unknown option\n end\n\n :ok # passes\n end", "title": "" }, { "docid": "2ff40e55efb8cb9a847f91dde056f8a1", "score": "0.55947953", "text": "def define_active_enum_write_method(attribute)\n class_eval <<-DEF\n def #{attribute}=(arg)\n if arg.is_a?(Symbol)\n super(self.class.active_enum_for(:#{attribute})[arg])\n else\n super\n end\n end\n DEF\n end", "title": "" }, { "docid": "2dd2524cbabda42bd3e3516243852b91", "score": "0.55464065", "text": "def check_enum(validation:, key:, schema:)\n return false if !validation[:required] && schema.nil? # Optional and not here, dont check\n return false unless validation[:values]\n return false if validation[:values].include?(schema)\n\n schema = 'nothing' if schema.nil?\n error! key, \"must be one of #{validation[:values].join(', ')}, but was #{schema}\"\n true\n end", "title": "" }, { "docid": "36b1f9f5ca30c5b954d7b2a8e70fd531", "score": "0.55371004", "text": "def should_allow_values_for(attribute, *good_values)\n get_options!(good_values)\n good_values.each do |value|\n matcher = allow_value(value).for(attribute)\n should matcher.description do\n assert_accepts matcher, subject\n end\n end\n end", "title": "" }, { "docid": "783341e607312dfeedf41ec376f6cc01", "score": "0.55344343", "text": "def validate_exclusion_of(attr); end", "title": "" }, { "docid": "e8eb54d3ebfe60d7acf8f1c923d63747", "score": "0.5528221", "text": "def valid_attribute_types\n\t\treturn self.must_attribute_types |\n\t\t self.may_attribute_types |\n\t\t self.operational_attribute_types\n\tend", "title": "" }, { "docid": "ba396369e0961def5f7c21ef8eaf53d2", "score": "0.5434983", "text": "def valid?\n status_validator = EnumAttributeValidator.new('String', [\"ACTIVE\", \"INACTIVE\"])\n return false unless status_validator.valid?(@status)\n country_validator = EnumAttributeValidator.new('String', [\"ZZ\", \"AD\", \"AE\", \"AF\", \"AG\", \"AI\", \"AL\", \"AM\", \"AO\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BI\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BV\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CC\", \"CD\", \"CF\", \"CG\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"EH\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GQ\", \"GR\", \"GS\", \"GT\", \"GU\", \"GW\", \"GY\", \"HK\", \"HM\", \"HN\", \"HR\", \"HT\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IO\", \"IQ\", \"IR\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KH\", \"KI\", \"KM\", \"KN\", \"KP\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"LY\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MS\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PN\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SD\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SO\", \"SR\", \"SS\", \"ST\", \"SV\", \"SX\", \"SY\", \"SZ\", \"TC\", \"TD\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TM\", \"TN\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VE\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"YE\", \"YT\", \"ZA\", \"ZM\", \"ZW\"])\n return false unless country_validator.valid?(@country)\n currency_validator = EnumAttributeValidator.new('String', [\"UNKNOWN_CURRENCY\", \"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\", \"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\", \"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYR\", \"BZD\", \"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\", \"CRC\", \"CUC\", \"CUP\", \"CVE\", \"CZK\", \"DJF\", \"DKK\", \"DOP\", \"DZD\", \"EGP\", \"ERN\", \"ETB\", \"EUR\", \"FJD\", \"FKP\", \"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\", \"HKD\", \"HNL\", \"HRK\", \"HTG\", \"HUF\", \"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\", \"JMD\", \"JOD\", \"JPY\", \"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\", \"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LTL\", \"LVL\", \"LYD\", \"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRO\", \"MUR\", \"MVR\", \"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\", \"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\", \"OMR\", \"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\", \"QAR\", \"RON\", \"RSD\", \"RUB\", \"RWF\", \"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLL\", \"SOS\", \"SRD\", \"SSP\", \"STD\", \"SVC\", \"SYP\", \"SZL\", \"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\", \"UAH\", \"UGX\", \"USD\", \"USN\", \"USS\", \"UYI\", \"UYU\", \"UZS\", \"VEF\", \"VND\", \"VUV\", \"WST\", \"XAF\", \"XAG\", \"XAU\", \"XBA\", \"XBB\", \"XBC\", \"XBD\", \"XCD\", \"XDR\", \"XOF\", \"XPD\", \"XPF\", \"XPT\", \"XTS\", \"XXX\", \"YER\", \"ZAR\", \"ZMK\", \"ZMW\", \"BTC\"])\n return false unless currency_validator.valid?(@currency)\n type_validator = EnumAttributeValidator.new('String', [\"PHYSICAL\", \"MOBILE\"])\n return false unless type_validator.valid?(@type)\n return true\n end", "title": "" }, { "docid": "5aa41aab2e0a4e7df65e6424415564b8", "score": "0.54312384", "text": "def update_allowed_values\n self.url_allowed = true if url_required\n self.description_allowed = true if description_required\n self.title_allowed = true if title_required\n\n TagSet::TAG_TYPES.each do |tag_type|\n required = eval(\"#{tag_type}_num_required\") || eval(\"self.#{tag_type}_num_required\") || 0\n allowed = eval(\"#{tag_type}_num_allowed\") || eval(\"self.#{tag_type}_num_allowed\") || 0\n if required > allowed\n eval(\"self.#{tag_type}_num_allowed = required\")\n end\n end\n end", "title": "" }, { "docid": "7ff664ed667045d39b3260cd6a0d3a40", "score": "0.5418137", "text": "def test_valid?\n assert_raise( RuntimeError ) { Tui::Model::Enum.new( 'lab1', { }, 1 ) }\n base = Tui::Model::Enum.new( 'lab1', { 'val1' => '1', 'val99' => '99' }, 'val99' )\n assert_false base.valid?( 1 )\n assert_true base.valid?( \"val1\" )\n ex = assert_raise( RuntimeError ) { base.value = 1; }\n assert_equal( 'Invalid value for model type Tui::Model::Enum!', ex.message )\n end", "title": "" }, { "docid": "56e896af4b3de46539f2a445a1f2ae82", "score": "0.5379602", "text": "def validate_may_attributes\n\t\thash = (self.entry || {} ).merge( @values )\n\t\tattributes = hash.keys.map( &:to_sym ).uniq\n\t\tvalid_attributes = self.valid_attribute_oids +\n\t\t\tself.operational_attribute_oids +\n\t\t\tIGNORED_OPERATIONAL_ATTRS\n\n\t\tself.log.debug \"Validating MAY attributes: %p against the list of valid OIDs: %p\" %\n\t\t\t[ attributes, valid_attributes ]\n\t\tunknown_attributes = attributes - valid_attributes\n\t\tunknown_attributes.each do |oid|\n\t\t\tself.errors.add( oid, \"is not allowed by entry's objectClasses\" )\n\t\tend\n\tend", "title": "" }, { "docid": "ac55752dd9cc4f485a916c46d7b41237", "score": "0.53794384", "text": "def allowed_attributes=(_arg0); end", "title": "" }, { "docid": "ac55752dd9cc4f485a916c46d7b41237", "score": "0.53794384", "text": "def allowed_attributes=(_arg0); end", "title": "" }, { "docid": "91c8cba712c18d00879c543b2686cf75", "score": "0.53653747", "text": "def validate_range(key, value, enum_values)\n values = value.instance_of?(Array) ? value : [value]\n values.each do |v|\n add_templated_error(key, \"'#{v}' is not a valid setting for '#{template.name_for(key)}'\") unless enum_values.include?(v)\n end\n end", "title": "" }, { "docid": "bdf28e68ba6dab72ee9b580bb965b3f3", "score": "0.53513694", "text": "def valid?\n return false if @class_id.nil?\n class_id_validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n return false unless class_id_validator.valid?(@class_id)\n return false if @object_type.nil?\n object_type_validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n return false unless object_type_validator.valid?(@object_type)\n true\n end", "title": "" }, { "docid": "eed235e3960d45d5aae2733376c26c7f", "score": "0.53364015", "text": "def allowed_values(value, pdef)\n if(pdef['AllowedValues'].include?(value))\n true\n else\n \"Not an allowed value: #{pdef['AllowedValues'].join(', ')}\"\n end\n end", "title": "" }, { "docid": "ccfe8738bfd90d4dd7cb62eaf02a0937", "score": "0.5330548", "text": "def allowed_to_write(name)\n # no point allowing attribute writes if we can't save them?\n if allowed_to_save\n name = name.to_s\n validation_methods = self.class.write_validations(name) \n if validation_methods.nil?\n # We haven't registered any filters on this attribute, so allow the write.\n true\n elsif validation_methods.check :accessor => accessor, :model => self\n # One of the authentication methods worked, so allow the write.\n true\n else\n # We had filters but none of them passed. Disallow write.\n false\n end\n else\n false\n end\n end", "title": "" }, { "docid": "aa9af6f302eab691811de43fd5119e4a", "score": "0.5324624", "text": "def status_enum=(status)\n write_attribute(:status, status)\n end", "title": "" }, { "docid": "aec1171a0bb0b9aa69a0d222b5e42061", "score": "0.53222466", "text": "def setting_attribute_is_allowed?(name, user)\n return false unless user.can_write?(self, name)\n (self.whitelisted_attributes && self.whitelisted_attributes.has_key?( name.to_sym)) ||\n (\n self.attribute_names.include?( name.to_s ) &&\n ( self.blacklisted_attributes.nil? ||\n ! self.blacklisted_attributes.has_key?( name.to_sym ) )\n )\n end", "title": "" }, { "docid": "8a0c85ab2f4e0dc8c9d541d1a9d672d9", "score": "0.5307476", "text": "def valid?\n return false if !super\n status_validator = EnumAttributeValidator.new('String', ['NotDefined', 'Active', 'Resolved', 'Closed'])\n return false unless status_validator.valid?(@status)\n true\n end", "title": "" }, { "docid": "cdad6e3a8b5642a185bca042edae26fd", "score": "0.53004855", "text": "def valid?\n MANDATORY_ATTRIBUTES[type].each{|a| return false unless self[a]}\n true\n end", "title": "" }, { "docid": "5ea5581623455c92a5407359d9e0d1b1", "score": "0.52841866", "text": "def valid?\n return false if !super\n return false if @style.nil?\n style_validator = EnumAttributeValidator.new('String', ['Unknown', 'Percent05', 'Percent10', 'Percent20', 'Percent25', 'Percent30', 'Percent40', 'Percent50', 'Percent60', 'Percent70', 'Percent75', 'Percent80', 'Percent90', 'DarkHorizontal', 'DarkVertical', 'DarkDownwardDiagonal', 'DarkUpwardDiagonal', 'SmallCheckerBoard', 'Trellis', 'LightHorizontal', 'LightVertical', 'LightDownwardDiagonal', 'LightUpwardDiagonal', 'SmallGrid', 'DottedDiamond', 'WideDownwardDiagonal', 'WideUpwardDiagonal', 'DashedUpwardDiagonal', 'DashedDownwardDiagonal', 'NarrowVertical', 'NarrowHorizontal', 'DashedVertical', 'DashedHorizontal', 'LargeConfetti', 'LargeGrid', 'HorizontalBrick', 'LargeCheckerBoard', 'SmallConfetti', 'Zigzag', 'SolidDiamond', 'DiagonalBrick', 'OutlinedDiamond', 'Plaid', 'Sphere', 'Weave', 'DottedGrid', 'Divot', 'Shingle', 'Wave', 'Horizontal', 'Vertical', 'Cross', 'DownwardDiagonal', 'UpwardDiagonal', 'DiagonalCross', 'NotDefined'])\n return false unless style_validator.valid?(@style)\n true\n end", "title": "" }, { "docid": "19056d6a35509fdd23a84fa3afae6658", "score": "0.52784383", "text": "def enum?(field)\n !!self.enums[field.to_sym]\n end", "title": "" }, { "docid": "90f91e2cc45b45578cf3bb665fb4c15e", "score": "0.52683413", "text": "def currency=(currency)\n validator = EnumAttributeValidator.new('String', [\"UNKNOWN_CURRENCY\", \"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\", \"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\", \"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYR\", \"BZD\", \"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\", \"CRC\", \"CUC\", \"CUP\", \"CVE\", \"CZK\", \"DJF\", \"DKK\", \"DOP\", \"DZD\", \"EGP\", \"ERN\", \"ETB\", \"EUR\", \"FJD\", \"FKP\", \"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\", \"HKD\", \"HNL\", \"HRK\", \"HTG\", \"HUF\", \"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\", \"JMD\", \"JOD\", \"JPY\", \"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\", \"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LTL\", \"LVL\", \"LYD\", \"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRO\", \"MUR\", \"MVR\", \"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\", \"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\", \"OMR\", \"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\", \"QAR\", \"RON\", \"RSD\", \"RUB\", \"RWF\", \"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLL\", \"SOS\", \"SRD\", \"SSP\", \"STD\", \"SVC\", \"SYP\", \"SZL\", \"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\", \"UAH\", \"UGX\", \"USD\", \"USN\", \"USS\", \"UYI\", \"UYU\", \"UZS\", \"VEF\", \"VND\", \"VUV\", \"WST\", \"XAF\", \"XAG\", \"XAU\", \"XBA\", \"XBB\", \"XBC\", \"XBD\", \"XCD\", \"XDR\", \"XOF\", \"XPD\", \"XPF\", \"XPT\", \"XTS\", \"XXX\", \"YER\", \"ZAR\", \"ZMK\", \"ZMW\", \"BTC\"])\n unless validator.valid?(currency)\n fail ArgumentError, \"invalid value for 'currency', must be one of #{validator.allowable_values}.\"\n end\n @currency = currency\n end", "title": "" }, { "docid": "14f5df7520af62af6b8b571a30ba190a", "score": "0.5265264", "text": "def enum_defined_for?(attribute)\n context = self.eh_params[:enum_contexts][attribute.to_s]\n !!(eh_params[:db_codes][context] && eh_params[:db_codes][context][attribute.to_s])\n # Returns true if the indicated attribute has an enum defined\n end", "title": "" }, { "docid": "2adac3b4896db42a0fd697678d494edc", "score": "0.525289", "text": "def object_type=(object_type)\n validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n unless validator.valid?(object_type)\n fail ArgumentError, \"invalid value for \\\"object_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @object_type = object_type\n end", "title": "" }, { "docid": "b32831f81f13e75188ef82c53b4cff4f", "score": "0.52094126", "text": "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"\", \"APIC\", \"DCNM\", \"UCSFI\", \"UCSFIISM\", \"IMC\", \"IMCM4\", \"IMCM5\", \"IMCRack\", \"UCSIOM\", \"HX\", \"HyperFlexAP\", \"IWE\", \"UCSD\", \"IntersightAppliance\", \"IntersightAssist\", \"PureStorageFlashArray\", \"UCSC890\", \"NetAppOntap\", \"NetAppActiveIqUnifiedManager\", \"EmcScaleIo\", \"EmcVmax\", \"EmcVplex\", \"EmcXtremIo\", \"VmwareVcenter\", \"MicrosoftHyperV\", \"AppDynamics\", \"Dynatrace\", \"NewRelic\", \"ServiceNow\", \"ReadHatOpenStack\", \"CloudFoundry\", \"MicrosoftAzureApplicationInsights\", \"OpenStack\", \"MicrosoftSqlServer\", \"Kubernetes\", \"AmazonWebService\", \"AmazonWebServiceBilling\", \"MicrosoftAzureServicePrincipal\", \"MicrosoftAzureEnterpriseAgreement\", \"DellCompellent\", \"HPE3Par\", \"RedHatEnterpriseVirtualization\", \"NutanixAcropolis\", \"HPEOneView\", \"ServiceEngine\", \"HitachiVirtualStoragePlatform\", \"IMCBlade\", \"TerraformCloud\", \"TerraformAgent\", \"CustomTarget\", \"AnsibleEndpoint\", \"HTTPEndpoint\", \"SSHEndpoint\", \"CiscoCatalyst\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for \\\"type\\\", must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end", "title": "" }, { "docid": "ee363055a838373695652b0b491da617", "score": "0.5189669", "text": "def compliance=(compliance)\n validator = EnumAttributeValidator.new('String', ['Pdf15', 'PdfA1b'])\n unless validator.valid?(compliance)\n fail ArgumentError, 'invalid value for \"compliance\", must be one of #{validator.allowable_values}.'\n end\n @compliance = compliance\n end", "title": "" }, { "docid": "357d6a8e13f5a706b484303ab9ee7cdb", "score": "0.5185224", "text": "def supports_polymorphic_enum_handling(attribute_name)\n self.eh_params[:polymorphic_attribute] = \"#{attribute_name}_type\".to_sym\n end", "title": "" }, { "docid": "78e5d949278093d255b3732d7aff694a", "score": "0.51700306", "text": "def should_deny_values(options)\n klass = self.name.gsub(/Test$/, '').constantize\n\n context \"#{klass}\" do\n options.each_pair do |attribute, values|\n [*values].each do |value|\n display_value = value.class == NilClass ? \"nil\" : \"\\\"#{value}\\\"\"\n \n should \"not allow #{attribute} to be #{display_value}\" do\n instance = get_instance_of(klass)\n instance.send(\"#{attribute}=\", value)\n assert !instance.valid?, \n \"Expected #{klass} to be invalid when #{attribute} is set to #{display_value}\"\n assert instance.errors.on(attribute.to_sym), \n \"Expected errors on #{attribute} when set to #{display_value}\"\n end\n end\n end\n end\n end", "title": "" }, { "docid": "e2e9afb173da2d957ea5f6da5e4dc86a", "score": "0.5146029", "text": "def enum?\n true\n end", "title": "" }, { "docid": "cab57c195d4c38b65eff62f6280e2382", "score": "0.51444733", "text": "def kind=(kind)\n validator = EnumAttributeValidator.new('String', [\"UNKNOWN\", \"USER_CREATED\", \"INTERNAL\"])\n unless validator.valid?(kind)\n fail ArgumentError, \"invalid value for \\\"kind\\\", must be one of #{validator.allowable_values}.\"\n end\n @kind = kind\n end", "title": "" }, { "docid": "a9a890b66030eba0877102e7863ecb9e", "score": "0.51369494", "text": "def validate_attribute_syntax\n\t\t@values.each do |attribute, values|\n\t\t\t[ values ].flatten.each do |value|\n\t\t\t\tbegin\n\t\t\t\t\tself.get_converted_attribute( attribute.to_sym, value )\n\t\t\t\trescue => err\n\t\t\t\t\tself.log.error \"validation for %p failed: %s: %s\" %\n\t\t\t\t\t\t[ attribute, err.class.name, err.message ]\n\t\t\t\t\tattrtype = self.find_attribute_type( attribute )\n\t\t\t\t\tself.errors.add( attribute, \"isn't a valid %s value\" %\n\t\t\t\t\t\t[ attrtype.syntax ? attrtype.syntax.desc : attrtype.syntax_oid ] )\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "bd91828da82acda673c62a1067987a25", "score": "0.5134045", "text": "def valid?\n return false if @name.nil?\n return false if @name.to_s.length > 25\n return false if @based_on.nil?\n based_on_validator = EnumAttributeValidator.new('String', [\"MyCalendar\", \"Customer\", \"AllHours\", \"Custom\"])\n return false unless based_on_validator.valid?(@based_on)\n return false if !@application_order.nil? && @application_order > 32767\n return false if !@application_order.nil? && @application_order < 1\n return false if !@respond_hours.nil? && @respond_hours > 999\n return false if !@respond_hours.nil? && @respond_hours < 0\n return false if !@respond_percent.nil? && @respond_percent > 99999\n return false if !@respond_percent.nil? && @respond_percent < 0\n return false if !@plan_within.nil? && @plan_within > 999\n return false if !@plan_within.nil? && @plan_within < 0\n return false if !@plan_within_percent.nil? && @plan_within_percent > 99999\n return false if !@plan_within_percent.nil? && @plan_within_percent < 0\n return false if !@resolution_hours.nil? && @resolution_hours > 999\n return false if !@resolution_hours.nil? && @resolution_hours < 0\n return false if !@resolution_percent.nil? && @resolution_percent > 99999\n return false if !@resolution_percent.nil? && @resolution_percent < 0\n return true\n end", "title": "" }, { "docid": "6f8fee872b3443305e1369595c783840", "score": "0.5133414", "text": "def valid?\n policy_validator = EnumAttributeValidator.new('Object', ['RMF', 'DIACAP', 'Reporting'])\n return false unless policy_validator.valid?(@policy)\n registration_type_validator = EnumAttributeValidator.new('Object', ['Assess and Authorize', 'Assess Only', 'Guest', 'Regular', 'Functional', 'Cloud Service Provider'])\n return false unless registration_type_validator.valid?(@registration_type)\n organization_name_validator = EnumAttributeValidator.new('Object', ['Army', 'Navy', 'Air Force', 'Marines', 'DoD', 'Defense Information Systems Agency'])\n return false unless organization_name_validator.valid?(@organization_name)\n system_type_validator = EnumAttributeValidator.new('Object', ['IS Major Application', 'IS Enclave', 'Platform IT', 'Platform IT System', 'Interconnection', 'AIS Application'])\n return false unless system_type_validator.valid?(@system_type)\n authorization_status_validator = EnumAttributeValidator.new('Object', ['Authority to Operate (ATO)', 'Interim Authority to Operate (IATO)', 'Interim Authority to Test (IATT)', 'Authority to Operate with Conditions (ATO) w/Conditions)', 'Denied Authority to Operate (DATO)', 'Not Yet Authorized', 'Unaccredited', 'Decommissioned'])\n return false unless authorization_status_validator.valid?(@authorization_status)\n confidentiality_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless confidentiality_validator.valid?(@confidentiality)\n integrity_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless integrity_validator.valid?(@integrity)\n availability_validator = EnumAttributeValidator.new('Object', ['High', 'Moderate', 'Low'])\n return false unless availability_validator.valid?(@availability)\n mac_validator = EnumAttributeValidator.new('Object', ['I', 'II', 'III'])\n return false unless mac_validator.valid?(@mac)\n dod_confidentiality_validator = EnumAttributeValidator.new('Object', ['Public', 'Sensitive', 'Classified'])\n return false unless dod_confidentiality_validator.valid?(@dod_confidentiality)\n true\n end", "title": "" }, { "docid": "43deed946b4deaa7a6dd5a6e2b77a417", "score": "0.5130944", "text": "def enum?\n false\n end", "title": "" }, { "docid": "8f63719c80c3ed5cc2b4d9d3eaf29db9", "score": "0.51203525", "text": "def unassignable_value_for(attr)\n case attr.type\n when :integer\n attr.assignable_values.max + 1\n when :string\n assignable_value_for(attr) + '-unassignable'\n else\n raise \"Assignable values for :#{attr.type} attributes not supported\"\n end\n end", "title": "" }, { "docid": "c47d0ef8ae645c81ce97b33bf3c93f37", "score": "0.5117331", "text": "def define_value_methods!\n self.accepted_values.each do |(name, bit)|\n self.meta_class.class_eval <<-FLAG_METHODS\n\n def #{name}\n ((@value || 0) & #{bit}) != 0\n end\n alias :#{name}? :#{name}\n\n def #{name}=(new_value)\n boolean = self.to_boolean(new_value)\n current = self.#{name}\n if boolean ^ current\n self.value = ((@value || 0) ^ #{bit})\n end\n self.#{name}\n end\n\n FLAG_METHODS\n end\n end", "title": "" }, { "docid": "33054e077cd8262c72df41ae9bf69d31", "score": "0.5108703", "text": "def replace_enumerations_in_hash(attrs, allow_multiple = true) #:nodoc:\n attrs.each do |attr, value|\n if options = enumerator_options_for(attr, value, allow_multiple)\n attrs.delete(attr)\n attrs.merge!(options)\n end\n end\n end", "title": "" }, { "docid": "014d5d1896a36c56888e9112fe53938a", "score": "0.5108653", "text": "def update_enum_attribute(database_id:, collection_id:, key:, elements:, required:, default:)\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}'\n .gsub('{databaseId}', database_id)\n .gsub('{collectionId}', collection_id)\n .gsub('{key}', key)\n\n if database_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"databaseId\"')\n end\n\n if collection_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"collectionId\"')\n end\n\n if key.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"key\"')\n end\n\n if elements.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"elements\"')\n end\n\n if required.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"required\"')\n end\n\n if default.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"default\"')\n end\n\n params = {\n elements: elements,\n required: required,\n default: default,\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::AttributeEnum\n )\n end", "title": "" }, { "docid": "dcc177b2012612550b8eeea52e57d111", "score": "0.5106191", "text": "def as_enum\n # Should look like:\n # enum attribute_name: [\"one\", \"two\"]\n\n if is_enum?\n if (enum_options = properties[:enum_options]).present?\n enum_options_as_hash = Frontier::HashSingleLineDecorator.new array_as_hash(enum_options)\n \"enum #{name}: {#{enum_options_as_hash}}\"\n else\n raise(ArgumentError, \"No enum_options provided for attribute: #{name}\")\n end\n else\n raise(ArgumentError, \"Attempting to display field #{name} as enum, but is #{type}\")\n end\n end", "title": "" }, { "docid": "7a09e0c90e0709a14b9b262e30c704ec", "score": "0.50937504", "text": "def validate_marital_status(val)\n unless @valid_marital_statuses.include?(val)\n raise \"Invalid value: #{val}\"\n end\n end", "title": "" }, { "docid": "7a09e0c90e0709a14b9b262e30c704ec", "score": "0.50937504", "text": "def validate_marital_status(val)\n unless @valid_marital_statuses.include?(val)\n raise \"Invalid value: #{val}\"\n end\n end", "title": "" }, { "docid": "9aec55858498c37905bd05d874f4013a", "score": "0.50840217", "text": "def enumeration?\n @is_enumeration ||= @xml.xpath('./xs:restriction/xs:enumeration', {'xs' => 'http://www.w3.org/2001/XMLSchema'}).length > 0\n end", "title": "" }, { "docid": "e9ef4781273662f843a0de3cf5619270", "score": "0.5082524", "text": "def pa_esigibilita=(pa_esigibilita)\n validator = EnumAttributeValidator.new('String', ['I', 'D', 'S', 'N'])\n unless validator.valid?(pa_esigibilita)\n fail ArgumentError, 'invalid value for \"pa_esigibilita\", must be one of #{validator.allowable_values}.'\n end\n @pa_esigibilita = pa_esigibilita\n end", "title": "" }, { "docid": "1d802e367bf697117a3a55c60eeb6489", "score": "0.5074987", "text": "def timeliness_validation_for(attr_names, type)\n super\n attr_names.each { |attr_name| define_timeliness_write_method(attr_name) }\n end", "title": "" }, { "docid": "5656f6d73a1098f99089c6c24ec8d9c0", "score": "0.50655115", "text": "def type=(type)\n validator = EnumAttributeValidator.new('String', ['Once', 'Hourly', 'Daily', 'Weekly', 'Monthly', 'Yearly'])\n unless validator.valid?(type)\n fail ArgumentError, 'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end", "title": "" }, { "docid": "bb0813227909c9a93a20ea4f58c7d324", "score": "0.5064211", "text": "def validate_allowed(record)\n unknown = provided(record) - allowed\n\n return if unknown.empty?\n\n record.errors.add(\n options[:attribute],\n \"contains unknown options: #{unknown.join(', ')}\"\n )\n end", "title": "" }, { "docid": "90108605ef4ed6d8dd357504a3d86f54", "score": "0.505987", "text": "def valid?\n source_validator = EnumAttributeValidator.new('Integer', [\"1\", \"2\"])\n return false unless source_validator.valid?(@source)\n return true\n end", "title": "" }, { "docid": "57afa6b65a77e5651a5dd7df65e1a85b", "score": "0.50555235", "text": "def valid?(value)\n return false if self == Enum\n return true if value.equal?(LAZY_VALUE)\n self.values.include?(value.to_s)\n end", "title": "" }, { "docid": "1010cbb86278818e332e15d7d4bc4c76", "score": "0.50513357", "text": "def smee=(smee)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"enabled\", \"disabled\"])\n unless validator.valid?(smee)\n fail ArgumentError, \"invalid value for \\\"smee\\\", must be one of #{validator.allowable_values}.\"\n end\n @smee = smee\n end", "title": "" }, { "docid": "722e6e7f5ce2cd67fab1d88be88866d5", "score": "0.5044483", "text": "def allowed_status\n errors.add(:string, 'must be pending, accepted or declined.') unless %w[pending accepted declined].any?(status)\n end", "title": "" }, { "docid": "a2db5fa50322ba3291dd926657f9b0aa", "score": "0.5041556", "text": "def define_active_enum_write_method_multiple(attribute, column)\n class_eval <<-DEF\n def #{attribute}=(args)\n self.#{column} = args.map do |arg|\n self.class.active_enum_get_id_for_#{attribute}(arg)\n end\n end\n DEF\n end", "title": "" }, { "docid": "effe91b664b00a6a858ca04d5b14f871", "score": "0.5036054", "text": "def valid?\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', [\"alert\", \"notification\"])\n return false unless type_validator.valid?(@type)\n priority_validator = EnumAttributeValidator.new('String', [\"P1\", \"P2\", \"P3\", \"P4\", \"P5\"])\n return false unless priority_validator.valid?(@priority)\n return true\n end", "title": "" }, { "docid": "2ccb0fcc20c4ef57cec863b86b897901", "score": "0.5031193", "text": "def has_enums?\n !!eh_params[:has_enums]\n end", "title": "" }, { "docid": "71747f04f529172711346720e6407040", "score": "0.5023556", "text": "def type=(type)\n validator = EnumAttributeValidator.new('String', ['active', 'notActive', 'unknown'])\n unless validator.valid?(type)\n fail ArgumentError, %Q'invalid value for \"type\", must be one of #{validator.allowable_values}.'\n end\n @type = type\n end", "title": "" }, { "docid": "64abebe2a7f2c7c8df10faf6872ab0ea", "score": "0.5019361", "text": "def level=(level)\n validator = EnumAttributeValidator.new('String', [\"Unknown\", \"Inline\", \"Block\", \"Row\", \"Cell\"])\n if level.to_i == 0\n unless validator.valid?(level)\n raise ArgumentError, \"invalid value for 'level', must be one of #{validator.allowable_values}.\"\n end\n @level = level\n else\n @level = validator.allowable_values[level.to_i]\n end\n end", "title": "" }, { "docid": "08ecd7399d75cb525d1f0248ff26f611", "score": "0.49934402", "text": "def mode=(mode)\n validator = EnumAttributeValidator.new('String', [\"default\", \"custom\"])\n unless validator.valid?(mode)\n fail ArgumentError, \"invalid value for 'mode', must be one of #{validator.allowable_values}.\"\n end\n @mode = mode\n end", "title": "" }, { "docid": "d90cfe7e7db391b50ff95a10e3f29df6", "score": "0.4989093", "text": "def valid?\n type_validator = EnumAttributeValidator.new('String', ['active', 'notActive', 'unknown'])\n return false unless type_validator.valid?(@type)\n true\n end", "title": "" }, { "docid": "a105bf81c47e159a3ffe3ec67c805125", "score": "0.49836317", "text": "def allowed_access_levels\n validator = lambda do |field|\n level = public_send(field) || ENABLED # rubocop:disable GitlabSecurity/PublicSend\n not_allowed = level > ENABLED\n self.errors.add(field, \"cannot have public visibility level\") if not_allowed\n end\n\n (FEATURES - %i(pages)).each {|f| validator.call(\"#{f}_access_level\")}\n end", "title": "" }, { "docid": "bdc594896da6fcb92215fb8b4674b848", "score": "0.49754748", "text": "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"Paragraph\", \"Character\", \"Table\", \"List\"])\n if type.to_i == 0\n unless validator.valid?(type)\n raise ArgumentError, \"invalid value for 'type', must be one of #{validator.allowable_values}.\"\n end\n @type = type\n else\n @type = validator.allowable_values[type.to_i]\n end\n end", "title": "" }, { "docid": "db7ec93090129556f97c7773041a5f9e", "score": "0.49738207", "text": "def legal_entity_type=(legal_entity_type)\n validator = EnumAttributeValidator.new('String', [\"sole_proprietorship\", \"partnership\", \"privately_owned_company\", \"publicly_owned_company\", \"government_owned_entity\", \"trust\", \"ngo\", \"club_and_society\", \"go\", \"other\", \"financial_institution\", \"mto\"])\n unless validator.valid?(legal_entity_type) || legal_entity_type.empty?\n fail ArgumentError, \"invalid value for \\\"legal_entity_type\\\", must be one of #{validator.allowable_values}.\"\n end\n @legal_entity_type = legal_entity_type\n end", "title": "" }, { "docid": "697794f778b4c83e62037bbf18b45a6d", "score": "0.49702868", "text": "def all_attributes_exists_with_enumerations?(attribute_names)\n exists = all_attributes_exists_without_enumerations?(attribute_names)\n exists ||= attribute_names.all? do |name|\n column_methods_hash.include?(name.to_sym) || reflect_on_enumeration(name)\n end\n end", "title": "" }, { "docid": "5550cfd7e462ceb2ad5ac6a8409014e1", "score": "0.49647367", "text": "def valid_setters\n methods = ScheduledActivity.instance_methods\n @valid_setters ||= methods.select do |m|\n methods.include?(:\"#{m}=\")\n end\n end", "title": "" }, { "docid": "7bc12c4f0fdd8e72556c0ea19b7d9d88", "score": "0.49602023", "text": "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"Weekly\", \"BiWeekly\", \"SemiMonthly\", \"Monthly\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for 'type', must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end", "title": "" }, { "docid": "7c5cd1575d655ce2d39655732d247985", "score": "0.4959052", "text": "def valid?\n return false if @type.nil?\n type_validator = EnumAttributeValidator.new('String', [\"ITEM\", \"CATEGORY\", \"ITEM_VARIATION\", \"TAX\", \"DISCOUNT\", \"MODIFIER_LIST\", \"MODIFIER\"])\n return false unless type_validator.valid?(@type)\n return false if @id.nil?\n return false if @id.to_s.length < 1\n return true\n end", "title": "" }, { "docid": "872faf9c46b19bab793b2856a9998ce7", "score": "0.49577102", "text": "def valid?\n return false if @value.nil?\n change_mode_validator = EnumAttributeValidator.new('String', [\"immediate\", \"delayed\"])\n return false unless change_mode_validator.valid?(@change_mode)\n invoicing_type_validator = EnumAttributeValidator.new('String', [\"Immediate\", \"Aggregated\"])\n return false unless invoicing_type_validator.valid?(@invoicing_type)\n return true\n end", "title": "" }, { "docid": "07aba547e1f80fa59ec608437c716765", "score": "0.49549797", "text": "def valid?\n type_validator = EnumAttributeValidator.new('String', [\"person\", \"business\"])\n return false unless type_validator.valid?(@type)\n return false if @country.nil?\n return false if @street.nil?\n return false if @postal_code.nil?\n return false if @city.nil?\n return false if @email.nil?\n return false if @ip.nil?\n identification_type_validator = EnumAttributeValidator.new('String', [\"DL\", \"PP\", \"ID\", \"OT\"])\n return false unless identification_type_validator.valid?(@identification_type)\n legal_entity_type_validator = EnumAttributeValidator.new('String', [\"sole_proprietorship\", \"partnership\", \"privately_owned_company\", \"publicly_owned_company\", \"government_owned_entity\", \"trust\", \"ngo\", \"club_and_society\", \"go\", \"other\", \"financial_institution\", \"mto\"])\n return false unless legal_entity_type_validator.valid?(@legal_entity_type)\n nature_of_business_validator = EnumAttributeValidator.new('String', [\"personal\", \"agriculture_and_hunting\", \"forestry\", \"fishing\", \"agricultural_by_products\", \"coal_mining\", \"oil_mining\", \"iron_ore_mining\", \"other_metal_and_diamond_mining\", \"other_mineral_mining\", \"manufacturing_of_food_drink_tobacco\", \"manufacturing_of_textiles_leather_fur_furniture\", \"manufacture_of_wooden_products_furniture\", \"manufacture_of_paper_pulp_allied_products\", \"manufacture_of_chemicals_medical_petroleum_rubber_plastic_products\", \"manufacture_of_pottery_china_glass_stone\", \"manufacture_of_iron_steel_non_ferrous_metals_basic_industries\", \"manufacture_of_metal_products_electrical_and_scientific_engineering\", \"manufacture_of_jewelry_musical_instruments_toys\", \"electricity_gas_and_water\", \"construction\", \"wholesale_trade\", \"retail_trade\", \"catering_incl_hotels\", \"transport_storage\", \"communications\", \"finance_and_holding_companies\", \"insurance\", \"business_services\", \"real_estate_development_investment\", \"central_state_governments\", \"community_services_defence_police_prisons_etc\", \"social_services_education_health_care\", \"personal_services_leisure_services\", \"personal_services_domestic_laundry_repairs\", \"personal_services_embassies_international_organisations\"])\n return false unless nature_of_business_validator.valid?(@nature_of_business)\n return false if @documents.nil?\n gender_validator = EnumAttributeValidator.new('String', [\"M\", \"F\", \"O\"])\n return false unless gender_validator.valid?(@gender)\n true\n end", "title": "" }, { "docid": "ffb7bab889e65bc5ead31cd91f4661e8", "score": "0.49535498", "text": "def class_id=(class_id)\n validator = EnumAttributeValidator.new('String', [\"aaa.AuditRecord\", \"aaa.RetentionConfig\", \"aaa.RetentionPolicy\", \"access.Policy\", \"adapter.ConfigPolicy\", \"adapter.ExtEthInterface\", \"adapter.HostEthInterface\", \"adapter.HostFcInterface\", \"adapter.HostIscsiInterface\", \"adapter.Unit\", \"adapter.UnitExpander\", \"appliance.AppStatus\", \"appliance.AutoRmaPolicy\", \"appliance.Backup\", \"appliance.BackupPolicy\", \"appliance.CertificateSetting\", \"appliance.DataExportPolicy\", \"appliance.DeviceCertificate\", \"appliance.DeviceClaim\", \"appliance.DeviceUpgradePolicy\", \"appliance.DiagSetting\", \"appliance.ExternalSyslogSetting\", \"appliance.FileGateway\", \"appliance.FileSystemStatus\", \"appliance.GroupStatus\", \"appliance.ImageBundle\", \"appliance.NodeInfo\", \"appliance.NodeStatus\", \"appliance.ReleaseNote\", \"appliance.RemoteFileImport\", \"appliance.Restore\", \"appliance.SetupInfo\", \"appliance.SystemInfo\", \"appliance.SystemStatus\", \"appliance.Upgrade\", \"appliance.UpgradePolicy\", \"asset.ClusterMember\", \"asset.Deployment\", \"asset.DeploymentDevice\", \"asset.DeviceClaim\", \"asset.DeviceConfiguration\", \"asset.DeviceConnectorManager\", \"asset.DeviceContractInformation\", \"asset.DeviceRegistration\", \"asset.Subscription\", \"asset.SubscriptionAccount\", \"asset.SubscriptionDeviceContractInformation\", \"asset.Target\", \"bios.BootDevice\", \"bios.BootMode\", \"bios.Policy\", \"bios.SystemBootOrder\", \"bios.TokenSettings\", \"bios.Unit\", \"bios.VfSelectMemoryRasConfiguration\", \"boot.CddDevice\", \"boot.DeviceBootMode\", \"boot.DeviceBootSecurity\", \"boot.HddDevice\", \"boot.IscsiDevice\", \"boot.NvmeDevice\", \"boot.PchStorageDevice\", \"boot.PrecisionPolicy\", \"boot.PxeDevice\", \"boot.SanDevice\", \"boot.SdDevice\", \"boot.UefiShellDevice\", \"boot.UsbDevice\", \"boot.VmediaDevice\", \"bulk.Export\", \"bulk.ExportedItem\", \"bulk.MoCloner\", \"bulk.MoMerger\", \"bulk.Request\", \"bulk.SubRequestObj\", \"capability.AdapterUnitDescriptor\", \"capability.Catalog\", \"capability.ChassisDescriptor\", \"capability.ChassisManufacturingDef\", \"capability.CimcFirmwareDescriptor\", \"capability.EquipmentPhysicalDef\", \"capability.EquipmentSlotArray\", \"capability.FanModuleDescriptor\", \"capability.FanModuleManufacturingDef\", \"capability.IoCardCapabilityDef\", \"capability.IoCardDescriptor\", \"capability.IoCardManufacturingDef\", \"capability.PortGroupAggregationDef\", \"capability.PsuDescriptor\", \"capability.PsuManufacturingDef\", \"capability.ServerSchemaDescriptor\", \"capability.SiocModuleCapabilityDef\", \"capability.SiocModuleDescriptor\", \"capability.SiocModuleManufacturingDef\", \"capability.SwitchCapability\", \"capability.SwitchDescriptor\", \"capability.SwitchManufacturingDef\", \"certificatemanagement.Policy\", \"chassis.ConfigChangeDetail\", \"chassis.ConfigImport\", \"chassis.ConfigResult\", \"chassis.ConfigResultEntry\", \"chassis.IomProfile\", \"chassis.Profile\", \"cloud.AwsBillingUnit\", \"cloud.AwsKeyPair\", \"cloud.AwsNetworkInterface\", \"cloud.AwsOrganizationalUnit\", \"cloud.AwsSecurityGroup\", \"cloud.AwsSubnet\", \"cloud.AwsVirtualMachine\", \"cloud.AwsVolume\", \"cloud.AwsVpc\", \"cloud.CollectInventory\", \"cloud.Regions\", \"cloud.SkuContainerType\", \"cloud.SkuDatabaseType\", \"cloud.SkuInstanceType\", \"cloud.SkuNetworkType\", \"cloud.SkuRegionRateCards\", \"cloud.SkuVolumeType\", \"cloud.TfcAgentpool\", \"cloud.TfcOrganization\", \"cloud.TfcWorkspace\", \"comm.HttpProxyPolicy\", \"compute.BiosPostPolicy\", \"compute.Blade\", \"compute.BladeIdentity\", \"compute.Board\", \"compute.Mapping\", \"compute.PhysicalSummary\", \"compute.RackUnit\", \"compute.RackUnitIdentity\", \"compute.ServerPowerPolicy\", \"compute.ServerSetting\", \"compute.Vmedia\", \"cond.Alarm\", \"cond.AlarmAggregation\", \"cond.HclStatus\", \"cond.HclStatusDetail\", \"cond.HclStatusJob\", \"connectorpack.ConnectorPackUpgrade\", \"connectorpack.UpgradeImpact\", \"convergedinfra.HealthCheckDefinition\", \"convergedinfra.HealthCheckExecution\", \"convergedinfra.Pod\", \"crd.CustomResource\", \"deviceconnector.Policy\", \"equipment.Chassis\", \"equipment.ChassisIdentity\", \"equipment.ChassisOperation\", \"equipment.DeviceSummary\", \"equipment.ExpanderModule\", \"equipment.Fan\", \"equipment.FanControl\", \"equipment.FanModule\", \"equipment.Fex\", \"equipment.FexIdentity\", \"equipment.FexOperation\", \"equipment.Fru\", \"equipment.IdentitySummary\", \"equipment.IoCard\", \"equipment.IoCardOperation\", \"equipment.IoExpander\", \"equipment.LocatorLed\", \"equipment.Psu\", \"equipment.PsuControl\", \"equipment.RackEnclosure\", \"equipment.RackEnclosureSlot\", \"equipment.SharedIoModule\", \"equipment.SwitchCard\", \"equipment.SystemIoController\", \"equipment.Tpm\", \"equipment.Transceiver\", \"ether.HostPort\", \"ether.NetworkPort\", \"ether.PhysicalPort\", \"ether.PortChannel\", \"externalsite.Authorization\", \"fabric.AppliancePcRole\", \"fabric.ApplianceRole\", \"fabric.ConfigChangeDetail\", \"fabric.ConfigResult\", \"fabric.ConfigResultEntry\", \"fabric.ElementIdentity\", \"fabric.EstimateImpact\", \"fabric.EthNetworkControlPolicy\", \"fabric.EthNetworkGroupPolicy\", \"fabric.EthNetworkPolicy\", \"fabric.FcNetworkPolicy\", \"fabric.FcUplinkPcRole\", \"fabric.FcUplinkRole\", \"fabric.FcoeUplinkPcRole\", \"fabric.FcoeUplinkRole\", \"fabric.FlowControlPolicy\", \"fabric.LinkAggregationPolicy\", \"fabric.LinkControlPolicy\", \"fabric.MulticastPolicy\", \"fabric.PcMember\", \"fabric.PcOperation\", \"fabric.PortMode\", \"fabric.PortOperation\", \"fabric.PortPolicy\", \"fabric.ServerRole\", \"fabric.SwitchClusterProfile\", \"fabric.SwitchControlPolicy\", \"fabric.SwitchProfile\", \"fabric.SystemQosPolicy\", \"fabric.UplinkPcRole\", \"fabric.UplinkRole\", \"fabric.Vlan\", \"fabric.Vsan\", \"fault.Instance\", \"fc.PhysicalPort\", \"fc.PortChannel\", \"fcpool.FcBlock\", \"fcpool.Lease\", \"fcpool.Pool\", \"fcpool.PoolMember\", \"fcpool.Universe\", \"feedback.FeedbackPost\", \"firmware.BiosDescriptor\", \"firmware.BoardControllerDescriptor\", \"firmware.ChassisUpgrade\", \"firmware.CimcDescriptor\", \"firmware.DimmDescriptor\", \"firmware.Distributable\", \"firmware.DistributableMeta\", \"firmware.DriveDescriptor\", \"firmware.DriverDistributable\", \"firmware.Eula\", \"firmware.FirmwareSummary\", \"firmware.GpuDescriptor\", \"firmware.HbaDescriptor\", \"firmware.IomDescriptor\", \"firmware.MswitchDescriptor\", \"firmware.NxosDescriptor\", \"firmware.PcieDescriptor\", \"firmware.PsuDescriptor\", \"firmware.RunningFirmware\", \"firmware.SasExpanderDescriptor\", \"firmware.ServerConfigurationUtilityDistributable\", \"firmware.StorageControllerDescriptor\", \"firmware.SwitchUpgrade\", \"firmware.UnsupportedVersionUpgrade\", \"firmware.Upgrade\", \"firmware.UpgradeImpact\", \"firmware.UpgradeImpactStatus\", \"firmware.UpgradeStatus\", \"forecast.Catalog\", \"forecast.Definition\", \"forecast.Instance\", \"graphics.Card\", \"graphics.Controller\", \"hcl.CompatibilityStatus\", \"hcl.DriverImage\", \"hcl.ExemptedCatalog\", \"hcl.HyperflexSoftwareCompatibilityInfo\", \"hcl.OperatingSystem\", \"hcl.OperatingSystemVendor\", \"hcl.SupportedDriverName\", \"hyperflex.Alarm\", \"hyperflex.AppCatalog\", \"hyperflex.AutoSupportPolicy\", \"hyperflex.BackupCluster\", \"hyperflex.CapabilityInfo\", \"hyperflex.CiscoHypervisorManager\", \"hyperflex.Cluster\", \"hyperflex.ClusterBackupPolicy\", \"hyperflex.ClusterBackupPolicyDeployment\", \"hyperflex.ClusterBackupPolicyInventory\", \"hyperflex.ClusterHealthCheckExecutionSnapshot\", \"hyperflex.ClusterNetworkPolicy\", \"hyperflex.ClusterProfile\", \"hyperflex.ClusterReplicationNetworkPolicy\", \"hyperflex.ClusterReplicationNetworkPolicyDeployment\", \"hyperflex.ClusterStoragePolicy\", \"hyperflex.ConfigResult\", \"hyperflex.ConfigResultEntry\", \"hyperflex.DataProtectionPeer\", \"hyperflex.DatastoreStatistic\", \"hyperflex.DevicePackageDownloadState\", \"hyperflex.Drive\", \"hyperflex.ExtFcStoragePolicy\", \"hyperflex.ExtIscsiStoragePolicy\", \"hyperflex.FeatureLimitExternal\", \"hyperflex.FeatureLimitInternal\", \"hyperflex.Health\", \"hyperflex.HealthCheckDefinition\", \"hyperflex.HealthCheckExecution\", \"hyperflex.HealthCheckExecutionSnapshot\", \"hyperflex.HealthCheckPackageChecksum\", \"hyperflex.HxapCluster\", \"hyperflex.HxapDatacenter\", \"hyperflex.HxapDvUplink\", \"hyperflex.HxapDvswitch\", \"hyperflex.HxapHost\", \"hyperflex.HxapHostInterface\", \"hyperflex.HxapHostVswitch\", \"hyperflex.HxapNetwork\", \"hyperflex.HxapVirtualDisk\", \"hyperflex.HxapVirtualMachine\", \"hyperflex.HxapVirtualMachineNetworkInterface\", \"hyperflex.HxdpVersion\", \"hyperflex.License\", \"hyperflex.LocalCredentialPolicy\", \"hyperflex.Node\", \"hyperflex.NodeConfigPolicy\", \"hyperflex.NodeProfile\", \"hyperflex.ProtectedCluster\", \"hyperflex.ProxySettingPolicy\", \"hyperflex.ServerFirmwareVersion\", \"hyperflex.ServerFirmwareVersionEntry\", \"hyperflex.ServerModel\", \"hyperflex.ServiceAuthToken\", \"hyperflex.SoftwareDistributionComponent\", \"hyperflex.SoftwareDistributionEntry\", \"hyperflex.SoftwareDistributionVersion\", \"hyperflex.SoftwareVersionPolicy\", \"hyperflex.StorageContainer\", \"hyperflex.SysConfigPolicy\", \"hyperflex.UcsmConfigPolicy\", \"hyperflex.VcenterConfigPolicy\", \"hyperflex.VmBackupInfo\", \"hyperflex.VmImportOperation\", \"hyperflex.VmRestoreOperation\", \"hyperflex.VmSnapshotInfo\", \"hyperflex.Volume\", \"hyperflex.WitnessConfiguration\", \"iaas.ConnectorPack\", \"iaas.DeviceStatus\", \"iaas.DiagnosticMessages\", \"iaas.LicenseInfo\", \"iaas.MostRunTasks\", \"iaas.ServiceRequest\", \"iaas.UcsdInfo\", \"iaas.UcsdManagedInfra\", \"iaas.UcsdMessages\", \"iam.Account\", \"iam.AccountExperience\", \"iam.ApiKey\", \"iam.AppRegistration\", \"iam.BannerMessage\", \"iam.Certificate\", \"iam.CertificateRequest\", \"iam.DomainGroup\", \"iam.EndPointPrivilege\", \"iam.EndPointRole\", \"iam.EndPointUser\", \"iam.EndPointUserPolicy\", \"iam.EndPointUserRole\", \"iam.Idp\", \"iam.IdpReference\", \"iam.IpAccessManagement\", \"iam.IpAddress\", \"iam.LdapGroup\", \"iam.LdapPolicy\", \"iam.LdapProvider\", \"iam.LocalUserPassword\", \"iam.LocalUserPasswordPolicy\", \"iam.OAuthToken\", \"iam.Permission\", \"iam.PrivateKeySpec\", \"iam.Privilege\", \"iam.PrivilegeSet\", \"iam.Qualifier\", \"iam.ResourceLimits\", \"iam.ResourcePermission\", \"iam.ResourceRoles\", \"iam.Role\", \"iam.SecurityHolder\", \"iam.ServiceProvider\", \"iam.Session\", \"iam.SessionLimits\", \"iam.System\", \"iam.TrustPoint\", \"iam.User\", \"iam.UserGroup\", \"iam.UserPreference\", \"inventory.DeviceInfo\", \"inventory.DnMoBinding\", \"inventory.GenericInventory\", \"inventory.GenericInventoryHolder\", \"inventory.Request\", \"ipmioverlan.Policy\", \"ippool.BlockLease\", \"ippool.IpLease\", \"ippool.Pool\", \"ippool.PoolMember\", \"ippool.ShadowBlock\", \"ippool.ShadowPool\", \"ippool.Universe\", \"iqnpool.Block\", \"iqnpool.Lease\", \"iqnpool.Pool\", \"iqnpool.PoolMember\", \"iqnpool.Universe\", \"iwotenant.TenantStatus\", \"kubernetes.AciCniApic\", \"kubernetes.AciCniProfile\", \"kubernetes.AciCniTenantClusterAllocation\", \"kubernetes.AddonDefinition\", \"kubernetes.AddonPolicy\", \"kubernetes.AddonRepository\", \"kubernetes.BaremetalNodeProfile\", \"kubernetes.Catalog\", \"kubernetes.Cluster\", \"kubernetes.ClusterAddonProfile\", \"kubernetes.ClusterProfile\", \"kubernetes.ConfigResult\", \"kubernetes.ConfigResultEntry\", \"kubernetes.ContainerRuntimePolicy\", \"kubernetes.DaemonSet\", \"kubernetes.Deployment\", \"kubernetes.Ingress\", \"kubernetes.NetworkPolicy\", \"kubernetes.Node\", \"kubernetes.NodeGroupProfile\", \"kubernetes.Pod\", \"kubernetes.Service\", \"kubernetes.StatefulSet\", \"kubernetes.SysConfigPolicy\", \"kubernetes.TrustedRegistriesPolicy\", \"kubernetes.Version\", \"kubernetes.VersionPolicy\", \"kubernetes.VirtualMachineInfraConfigPolicy\", \"kubernetes.VirtualMachineInfrastructureProvider\", \"kubernetes.VirtualMachineInstanceType\", \"kubernetes.VirtualMachineNodeProfile\", \"kvm.Policy\", \"kvm.Session\", \"kvm.Tunnel\", \"license.AccountLicenseData\", \"license.CustomerOp\", \"license.IwoCustomerOp\", \"license.IwoLicenseCount\", \"license.LicenseInfo\", \"license.LicenseReservationOp\", \"license.SmartlicenseToken\", \"ls.ServiceProfile\", \"macpool.IdBlock\", \"macpool.Lease\", \"macpool.Pool\", \"macpool.PoolMember\", \"macpool.Universe\", \"management.Controller\", \"management.Entity\", \"management.Interface\", \"memory.Array\", \"memory.PersistentMemoryConfigResult\", \"memory.PersistentMemoryConfiguration\", \"memory.PersistentMemoryNamespace\", \"memory.PersistentMemoryNamespaceConfigResult\", \"memory.PersistentMemoryPolicy\", \"memory.PersistentMemoryRegion\", \"memory.PersistentMemoryUnit\", \"memory.Unit\", \"meta.Definition\", \"network.Element\", \"network.ElementSummary\", \"network.FcZoneInfo\", \"network.VlanPortInfo\", \"networkconfig.Policy\", \"niaapi.ApicCcoPost\", \"niaapi.ApicFieldNotice\", \"niaapi.ApicHweol\", \"niaapi.ApicLatestMaintainedRelease\", \"niaapi.ApicReleaseRecommend\", \"niaapi.ApicSweol\", \"niaapi.DcnmCcoPost\", \"niaapi.DcnmFieldNotice\", \"niaapi.DcnmHweol\", \"niaapi.DcnmLatestMaintainedRelease\", \"niaapi.DcnmReleaseRecommend\", \"niaapi.DcnmSweol\", \"niaapi.FileDownloader\", \"niaapi.NiaMetadata\", \"niaapi.NibFileDownloader\", \"niaapi.NibMetadata\", \"niaapi.VersionRegex\", \"niatelemetry.AaaLdapProviderDetails\", \"niatelemetry.AaaRadiusProviderDetails\", \"niatelemetry.AaaTacacsProviderDetails\", \"niatelemetry.ApicAppPluginDetails\", \"niatelemetry.ApicCoreFileDetails\", \"niatelemetry.ApicDbgexpRsExportDest\", \"niatelemetry.ApicDbgexpRsTsScheduler\", \"niatelemetry.ApicFanDetails\", \"niatelemetry.ApicFexDetails\", \"niatelemetry.ApicFlashDetails\", \"niatelemetry.ApicNtpAuth\", \"niatelemetry.ApicPsuDetails\", \"niatelemetry.ApicRealmDetails\", \"niatelemetry.ApicSnmpClientGrpDetails\", \"niatelemetry.ApicSnmpCommunityAccessDetails\", \"niatelemetry.ApicSnmpCommunityDetails\", \"niatelemetry.ApicSnmpTrapDetails\", \"niatelemetry.ApicSnmpTrapFwdServerDetails\", \"niatelemetry.ApicSnmpVersionThreeDetails\", \"niatelemetry.ApicSysLogGrp\", \"niatelemetry.ApicSysLogSrc\", \"niatelemetry.ApicTransceiverDetails\", \"niatelemetry.ApicUiPageCounts\", \"niatelemetry.AppDetails\", \"niatelemetry.CommonPolicies\", \"niatelemetry.DcnmFanDetails\", \"niatelemetry.DcnmFexDetails\", \"niatelemetry.DcnmModuleDetails\", \"niatelemetry.DcnmPsuDetails\", \"niatelemetry.DcnmTransceiverDetails\", \"niatelemetry.Epg\", \"niatelemetry.FabricModuleDetails\", \"niatelemetry.FabricPodProfile\", \"niatelemetry.FabricPodSs\", \"niatelemetry.Fault\", \"niatelemetry.HttpsAclContractDetails\", \"niatelemetry.HttpsAclContractFilterMap\", \"niatelemetry.HttpsAclEpgContractMap\", \"niatelemetry.HttpsAclEpgDetails\", \"niatelemetry.HttpsAclFilterDetails\", \"niatelemetry.Lc\", \"niatelemetry.MsoContractDetails\", \"niatelemetry.MsoEpgDetails\", \"niatelemetry.MsoSchemaDetails\", \"niatelemetry.MsoSiteDetails\", \"niatelemetry.MsoTenantDetails\", \"niatelemetry.NexusDashboardControllerDetails\", \"niatelemetry.NexusDashboardDetails\", \"niatelemetry.NexusDashboardMemoryDetails\", \"niatelemetry.NexusDashboards\", \"niatelemetry.NiaFeatureUsage\", \"niatelemetry.NiaInventory\", \"niatelemetry.NiaInventoryDcnm\", \"niatelemetry.NiaInventoryFabric\", \"niatelemetry.NiaLicenseState\", \"niatelemetry.PasswordStrengthCheck\", \"niatelemetry.PodCommPolicies\", \"niatelemetry.PodSnmpPolicies\", \"niatelemetry.PodTimeServerPolicies\", \"niatelemetry.SiteInventory\", \"niatelemetry.SnmpSrc\", \"niatelemetry.SshVersionTwo\", \"niatelemetry.SupervisorModuleDetails\", \"niatelemetry.SyslogRemoteDest\", \"niatelemetry.SyslogSysMsg\", \"niatelemetry.SyslogSysMsgFacFilter\", \"niatelemetry.SystemControllerDetails\", \"niatelemetry.Tenant\", \"notification.AccountSubscription\", \"ntp.Policy\", \"oprs.Deployment\", \"oprs.SyncTargetListMessage\", \"organization.Organization\", \"os.BulkInstallInfo\", \"os.Catalog\", \"os.ConfigurationFile\", \"os.Distribution\", \"os.Install\", \"os.OsSupport\", \"os.SupportedVersion\", \"os.TemplateFile\", \"os.ValidInstallTarget\", \"pci.CoprocessorCard\", \"pci.Device\", \"pci.Link\", \"pci.Switch\", \"port.Group\", \"port.MacBinding\", \"port.SubGroup\", \"power.ControlState\", \"power.Policy\", \"processor.Unit\", \"rack.UnitPersonality\", \"recommendation.CapacityRunway\", \"recommendation.PhysicalItem\", \"recovery.BackupConfigPolicy\", \"recovery.BackupProfile\", \"recovery.ConfigResult\", \"recovery.ConfigResultEntry\", \"recovery.OnDemandBackup\", \"recovery.Restore\", \"recovery.ScheduleConfigPolicy\", \"resource.Group\", \"resource.GroupMember\", \"resource.LicenseResourceCount\", \"resource.Membership\", \"resource.MembershipHolder\", \"resource.Reservation\", \"resourcepool.Lease\", \"resourcepool.LeaseResource\", \"resourcepool.Pool\", \"resourcepool.PoolMember\", \"resourcepool.Universe\", \"rproxy.ReverseProxy\", \"sdcard.Policy\", \"sdwan.Profile\", \"sdwan.RouterNode\", \"sdwan.RouterPolicy\", \"sdwan.VmanageAccountPolicy\", \"search.SearchItem\", \"search.TagItem\", \"security.Unit\", \"server.ConfigChangeDetail\", \"server.ConfigImport\", \"server.ConfigResult\", \"server.ConfigResultEntry\", \"server.Profile\", \"server.ProfileTemplate\", \"smtp.Policy\", \"snmp.Policy\", \"software.ApplianceDistributable\", \"software.DownloadHistory\", \"software.HclMeta\", \"software.HyperflexBundleDistributable\", \"software.HyperflexDistributable\", \"software.ReleaseMeta\", \"software.SolutionDistributable\", \"software.UcsdBundleDistributable\", \"software.UcsdDistributable\", \"softwarerepository.Authorization\", \"softwarerepository.CachedImage\", \"softwarerepository.Catalog\", \"softwarerepository.CategoryMapper\", \"softwarerepository.CategoryMapperModel\", \"softwarerepository.CategorySupportConstraint\", \"softwarerepository.DownloadSpec\", \"softwarerepository.OperatingSystemFile\", \"softwarerepository.Release\", \"sol.Policy\", \"ssh.Policy\", \"storage.Controller\", \"storage.DiskGroup\", \"storage.DiskSlot\", \"storage.DriveGroup\", \"storage.Enclosure\", \"storage.EnclosureDisk\", \"storage.EnclosureDiskSlotEp\", \"storage.FlexFlashController\", \"storage.FlexFlashControllerProps\", \"storage.FlexFlashPhysicalDrive\", \"storage.FlexFlashVirtualDrive\", \"storage.FlexUtilController\", \"storage.FlexUtilPhysicalDrive\", \"storage.FlexUtilVirtualDrive\", \"storage.HitachiArray\", \"storage.HitachiController\", \"storage.HitachiDisk\", \"storage.HitachiHost\", \"storage.HitachiHostLun\", \"storage.HitachiParityGroup\", \"storage.HitachiPool\", \"storage.HitachiPort\", \"storage.HitachiVolume\", \"storage.HyperFlexStorageContainer\", \"storage.HyperFlexVolume\", \"storage.Item\", \"storage.NetAppAggregate\", \"storage.NetAppBaseDisk\", \"storage.NetAppCluster\", \"storage.NetAppEthernetPort\", \"storage.NetAppExportPolicy\", \"storage.NetAppFcInterface\", \"storage.NetAppFcPort\", \"storage.NetAppInitiatorGroup\", \"storage.NetAppIpInterface\", \"storage.NetAppLicense\", \"storage.NetAppLun\", \"storage.NetAppLunMap\", \"storage.NetAppNode\", \"storage.NetAppNtpServer\", \"storage.NetAppSensor\", \"storage.NetAppStorageVm\", \"storage.NetAppVolume\", \"storage.NetAppVolumeSnapshot\", \"storage.PhysicalDisk\", \"storage.PhysicalDiskExtension\", \"storage.PhysicalDiskUsage\", \"storage.PureArray\", \"storage.PureController\", \"storage.PureDisk\", \"storage.PureHost\", \"storage.PureHostGroup\", \"storage.PureHostLun\", \"storage.PurePort\", \"storage.PureProtectionGroup\", \"storage.PureProtectionGroupSnapshot\", \"storage.PureReplicationSchedule\", \"storage.PureSnapshotSchedule\", \"storage.PureVolume\", \"storage.PureVolumeSnapshot\", \"storage.SasExpander\", \"storage.SasPort\", \"storage.Span\", \"storage.StoragePolicy\", \"storage.VdMemberEp\", \"storage.VirtualDrive\", \"storage.VirtualDriveContainer\", \"storage.VirtualDriveExtension\", \"storage.VirtualDriveIdentity\", \"syslog.Policy\", \"tam.AdvisoryCount\", \"tam.AdvisoryDefinition\", \"tam.AdvisoryInfo\", \"tam.AdvisoryInstance\", \"tam.SecurityAdvisory\", \"task.HitachiScopedInventory\", \"task.HxapScopedInventory\", \"task.NetAppScopedInventory\", \"task.PublicCloudScopedInventory\", \"task.PureScopedInventory\", \"task.ServerScopedInventory\", \"techsupportmanagement.CollectionControlPolicy\", \"techsupportmanagement.Download\", \"techsupportmanagement.TechSupportBundle\", \"techsupportmanagement.TechSupportStatus\", \"terminal.AuditLog\", \"terraform.Executor\", \"thermal.Policy\", \"top.System\", \"ucsd.BackupInfo\", \"uuidpool.Block\", \"uuidpool.Pool\", \"uuidpool.PoolMember\", \"uuidpool.Universe\", \"uuidpool.UuidLease\", \"virtualization.Host\", \"virtualization.VirtualDisk\", \"virtualization.VirtualMachine\", \"virtualization.VirtualNetwork\", \"virtualization.VmwareCluster\", \"virtualization.VmwareDatacenter\", \"virtualization.VmwareDatastore\", \"virtualization.VmwareDatastoreCluster\", \"virtualization.VmwareDistributedNetwork\", \"virtualization.VmwareDistributedSwitch\", \"virtualization.VmwareFolder\", \"virtualization.VmwareHost\", \"virtualization.VmwareKernelNetwork\", \"virtualization.VmwareNetwork\", \"virtualization.VmwarePhysicalNetworkInterface\", \"virtualization.VmwareUplinkPort\", \"virtualization.VmwareVcenter\", \"virtualization.VmwareVirtualDisk\", \"virtualization.VmwareVirtualMachine\", \"virtualization.VmwareVirtualMachineSnapshot\", \"virtualization.VmwareVirtualNetworkInterface\", \"virtualization.VmwareVirtualSwitch\", \"vmedia.Policy\", \"vmrc.Console\", \"vnc.Console\", \"vnic.EthAdapterPolicy\", \"vnic.EthIf\", \"vnic.EthNetworkPolicy\", \"vnic.EthQosPolicy\", \"vnic.FcAdapterPolicy\", \"vnic.FcIf\", \"vnic.FcNetworkPolicy\", \"vnic.FcQosPolicy\", \"vnic.IscsiAdapterPolicy\", \"vnic.IscsiBootPolicy\", \"vnic.IscsiStaticTargetPolicy\", \"vnic.LanConnectivityPolicy\", \"vnic.LcpStatus\", \"vnic.SanConnectivityPolicy\", \"vnic.ScpStatus\", \"vrf.Vrf\", \"workflow.BatchApiExecutor\", \"workflow.BuildTaskMeta\", \"workflow.BuildTaskMetaOwner\", \"workflow.Catalog\", \"workflow.CustomDataTypeDefinition\", \"workflow.ErrorResponseHandler\", \"workflow.PendingDynamicWorkflowInfo\", \"workflow.RollbackWorkflow\", \"workflow.SolutionActionDefinition\", \"workflow.SolutionActionInstance\", \"workflow.SolutionDefinition\", \"workflow.SolutionInstance\", \"workflow.SolutionOutput\", \"workflow.TaskDebugLog\", \"workflow.TaskDefinition\", \"workflow.TaskInfo\", \"workflow.TaskMetadata\", \"workflow.TaskNotification\", \"workflow.TemplateEvaluation\", \"workflow.TemplateFunctionMeta\", \"workflow.WorkflowDefinition\", \"workflow.WorkflowInfo\", \"workflow.WorkflowMeta\", \"workflow.WorkflowMetadata\", \"workflow.WorkflowNotification\"])\n unless validator.valid?(class_id)\n fail ArgumentError, \"invalid value for \\\"class_id\\\", must be one of #{validator.allowable_values}.\"\n end\n @class_id = class_id\n end", "title": "" }, { "docid": "ea85dd52b9b8366fadbfcb7e5d20dc81", "score": "0.49489576", "text": "def assert_white_list_setter(clazz, attr, value, whitelist_clazz)\n instance = clazz.new(attr => value)\n assert_kind_of whitelist_clazz, instance.send(attr)\n assert_equal value, instance.send(attr).value\n end", "title": "" }, { "docid": "2f29ce80bdde4039c3e6e09e7065b758", "score": "0.49489233", "text": "def allow_value_matcher; end", "title": "" }, { "docid": "54a6e53067c5137493d22cfc311acff1", "score": "0.4943718", "text": "def raise_invalid(value)\n if value.is_a?(Numeric)\n raise EnumError, \"#{value.inspect} is out of bounds of #{self.class.name}\"\n else\n raise EnumError, \"#{value.inspect} is not valid for #{self.class.name}\"\n end\n end", "title": "" }, { "docid": "3f83c6bb12252459c8cab8f157ff4b40", "score": "0.494183", "text": "def valid_parameter_for_conditional_formatting\n [\n :type,\n :format,\n :criteria,\n :value,\n :minimum,\n :maximum,\n :min_type,\n :mid_type,\n :max_type,\n :min_value,\n :mid_value,\n :max_value,\n :min_color,\n :mid_color,\n :max_color,\n :bar_color\n ]\n end", "title": "" }, { "docid": "537db0e6878268286aa25feacbc118b1", "score": "0.494042", "text": "def valid_parameter_for_conditional_formatting\n %i[\n type\n format\n criteria\n value\n minimum\n maximum\n stop_if_true\n min_type\n mid_type\n max_type\n min_value\n mid_value\n max_value\n min_color\n mid_color\n max_color\n bar_color\n bar_negative_color\n bar_negative_color_same\n bar_solid\n bar_border_color\n bar_negative_border_color\n bar_negative_border_color_same\n bar_no_border\n bar_direction\n bar_axis_position\n bar_axis_color\n bar_only\n icon_style\n reverse_icons\n icons_only\n icons\n data_bar_2010\n ]\n end", "title": "" }, { "docid": "feba2e0ba2012033bbc14d7e55bbe5b2", "score": "0.4935984", "text": "def oil_types=(vals = [])\n if vals.is_a?(Array)\n OilTypes.collect {|t| t[1]}.each do |type|\n if vals.member?(type)\n send(type+\"=\",true)\n else\n send(type+\"=\",false)\n end\n end\n end\n end", "title": "" }, { "docid": "349cdb080e936568e6d7b58ab17c53fc", "score": "0.49353147", "text": "def validate_enum_name(name)\n name.gsub(/[-\\s]/, \"_\").sub(/^\\d/, '_\\0')\n end", "title": "" }, { "docid": "a44f0cac9e04b7efdbfa6a1a6f8e6f5e", "score": "0.4934332", "text": "def sr_iov=(sr_iov)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"enabled\", \"disabled\"])\n unless validator.valid?(sr_iov)\n fail ArgumentError, \"invalid value for \\\"sr_iov\\\", must be one of #{validator.allowable_values}.\"\n end\n @sr_iov = sr_iov\n end", "title": "" }, { "docid": "d348bda62f7d1c5da3aef3ebdc5d1d21", "score": "0.49269903", "text": "def appearance=(appearance)\n validator = EnumAttributeValidator.new('String', [\"Default\", \"BoundingBox\", \"Tags\", \"Hidden\"])\n if appearance.to_i == 0\n unless validator.valid?(appearance)\n raise ArgumentError, \"invalid value for 'appearance', must be one of #{validator.allowable_values}.\"\n end\n @appearance = appearance\n else\n @appearance = validator.allowable_values[appearance.to_i]\n end\n end", "title": "" }, { "docid": "80f642d84aedd2cb6e23aad692aa12b6", "score": "0.49202663", "text": "def validate_entities!(enum)\n unless enum.respond_to?(:each)\n raise Errors::InternalError, 'Validation cannot be performed on non-enumerable objects'\n end\n enum.each(&:valid!)\n enum\n rescue ::Occi::Core::Errors::MandatoryArgumentError, ::Occi::Core::Errors::ValidationError => ex\n logger.error \"Validation failed: #{ex.class} #{ex.message}\"\n raise Errors::ValidationError, ex.message\n end", "title": "" }, { "docid": "9d97b70affd13483396e64e3169601de", "score": "0.49195725", "text": "def attr_bool_writer *symbols\n attr_writer *symbols\n end", "title": "" }, { "docid": "83bb196aae84618223a833a2f4414f54", "score": "0.49171844", "text": "def valid?\n frequency_validator = EnumAttributeValidator.new('String', [\"daily\", \"weekly\", \"monthly\", \"quarterly\", \"yearly\"])\n return false unless frequency_validator.valid?(@frequency)\n return true\n end", "title": "" }, { "docid": "289cec42e6e5444bf080c96454e04e2c", "score": "0.49135497", "text": "def valid_attributes\n {\n name: \"Unlimited\",\n award_title_name: \"10k Unlimited\",\n scoring_class: \"Freestyle\"\n }\n end", "title": "" }, { "docid": "9bac31f737fd3a5c6f8fd0d665119684", "score": "0.49132174", "text": "def should_allow_values(options)\n klass = self.name.gsub(/Test$/, '').constantize\n\n context \"#{klass}\" do\n options.each_pair do |attribute, values|\n [*values].each do |value|\n display_value = value.class == NilClass ? \"nil\" : \"\\\"#{value}\\\"\"\n \n should \"allow #{attribute} to be #{display_value}\" do\n instance = get_instance_of(klass)\n instance.send(\"#{attribute}=\", value)\n assert_nil instance.errors.on(attribute), \n \"Expected no errors when #{attribute} is set to #{display_value}, \n instead found error \\\"#{instance.errors.on(attribute)}\\\".\"\n end\n end\n end\n end\n end", "title": "" }, { "docid": "73b095cb85d0ab2e93546a1b1f0f70cd", "score": "0.4910008", "text": "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_number_value(\"offsetInDays\", @offset_in_days)\n writer.write_enum_value(\"timeBasedAttribute\", @time_based_attribute)\n end", "title": "" }, { "docid": "ed60861731f7b9c328b984f99b6deb78", "score": "0.49098906", "text": "def gr_append_check? obj\n return false if obj.class!=self.class\n return false if !respond_to(\"each\")\n myEnum=to_enum\n objEnum=obj.to_enum\n while true\n begin\n myEle=myEnum.next\n rescue\n return true\n end\n begin\n objEle=objEnum.next\n rescue\n return false\n end\n return false if myEle!=objEle\n end\n return true\n end", "title": "" }, { "docid": "7b1d15949960dcdeaf4849ddcf1a0813", "score": "0.49096495", "text": "def validate( value )\n raise ReadOnlyException.new(self) unless settable?\n @definition.type.validate(value)\n end", "title": "" }, { "docid": "1b075bdb9fe5094da68383aeaef930e8", "score": "0.49090025", "text": "def valid?\n only_display_validator = EnumAttributeValidator.new('String', [\"DoNotDisplay\", \"Closed30Days\", \"Closed60Days\", \"Closed90Days\", \"Closed120Days\", \"AllClosed\"])\n return false unless only_display_validator.valid?(@only_display)\n return true\n end", "title": "" }, { "docid": "5deb2669b8e93acd0cc40a766dd6d010", "score": "0.49080157", "text": "def patrol_scrub=(patrol_scrub)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"disabled\", \"Enable at End of POST\", \"enabled\"])\n unless validator.valid?(patrol_scrub)\n fail ArgumentError, \"invalid value for \\\"patrol_scrub\\\", must be one of #{validator.allowable_values}.\"\n end\n @patrol_scrub = patrol_scrub\n end", "title": "" }, { "docid": "8353bceba43a8998eaa26e35462c05d7", "score": "0.49024847", "text": "def _class=(_class)\n validator = EnumAttributeValidator.new('String', [\"Other\", \"Absolute\", \"Possessory\", \"Qualified\", \"Good\"])\n unless validator.valid?(_class)\n fail ArgumentError, \"invalid value for '_class', must be one of #{validator.allowable_values}.\"\n end\n @_class = _class\n end", "title": "" }, { "docid": "55fd3d1aaa61add7608c52634c60c28a", "score": "0.49014568", "text": "def valid?\n return false if !super\n quartile_method_validator = EnumAttributeValidator.new('String', ['Exclusive', 'Inclusive'])\n return false unless quartile_method_validator.valid?(@quartile_method)\n true\n end", "title": "" } ]
46327d2a2a4602d42b527c75f622d2ae
TODO: reimplement let as a macro def test_let assert_evals_to 2, "(let ((n 2)) n)" assert_evals_to 5, "(let ((n 2) (m 3)) (+ n m))" end def test_shadowed_vars_dont_stay_in_scope assert_evals_to Cons.new(:a.sym, :b.sym), "(let ((f (let ((x (quote a))) (lambda (y) (cons x y))))) (let ((x (quote nota))) (f (quote b))))" end
[ { "docid": "db90dde3fb0728fe5a264b6146bd8480", "score": "0.5398007", "text": "def test_nested_function_calls_dont_affect_caller\n eval! \"(define fib (lambda (x)\n\t (if (< x 3)\n\t\t 1\n (+ (fib (- x 1)) (fib (- x 2))))))\"\n\n assert BusScheme.in_scope?(:fib.sym)\n assert_equal 1, BusScheme[:fib.sym].call(cons(2))\n assert_equal 5, BusScheme[:fib.sym].call(cons(5))\n assert_evals_to 5, \"(fib 5)\"\n end", "title": "" } ]
[ { "docid": "9e951043dd64b9b62194cf181d1151c8", "score": "0.65063477", "text": "def test_check_var_sym\n @process.let('A', [5])\n assert_equal 5, @process.replace('A')\n end", "title": "" }, { "docid": "c1070bf515aa27c04afb63ace5752b38", "score": "0.64038557", "text": "def test_can_mix_shadowed_variables_and_outer_bound_vars\n result = interpret 'a=1;b=2;c=3;f=->(a, b) { [:a, :b, :c]};%f(9,8)'\n assert_eq result, [9,8,3]\n end", "title": "" }, { "docid": "9ec47236e45c303cbded8c3866455ee5", "score": "0.6200623", "text": "def test_let_var_invalid_rpn\n val = @rpn.check_var \"LET a 30 30 40 +\"\n assert_equal val, [3, \"Line 0: Stack has 2 elements after evaluation\"]\n end", "title": "" }, { "docid": "494dbaea034de1e94095b0faedcaee41", "score": "0.6189501", "text": "def test_let_invalid_var\n e1 = Minitest::Mock::new 'evaluator 1'\n e1.expect(:evaluate, [15, 'valid'], [15])\n assert_equal 5, @process.let('K19K', [15])\n end", "title": "" }, { "docid": "ce87df78f868bda105c4b4410c9612d7", "score": "0.6144637", "text": "def compile_let(scope, varlist, *args)\n let(scope, *varlist) do |ls|\n compile_do(ls, *args)\n end\n return Value.new([:subexpr])\n end", "title": "" }, { "docid": "fffd74ee5f99c2c7e996c45aee2b9a64", "score": "0.6055381", "text": "def test_let\n\n pdef = Ruote.process_definition do\n set 'v:var' => 'val'\n echo \"out:${v:var}\"\n let do\n set 'v:var' => 'val1'\n echo \"in:${v:var}\"\n end\n echo \"out:${v:var}\"\n end\n\n #noisy\n\n assert_trace %w[ out:val in:val1 out:val ], pdef\n end", "title": "" }, { "docid": "4b5d8bbcfd7edbb10681cefd3e3d2ccf", "score": "0.60530543", "text": "def test_let_invalid_expr\n e1 = Minitest::Mock::new 'evaluator 1'\n e1.expect(:evaluate, [2, nil], ['+'])\n assert_equal 2, @process.let('b', ['+'])\n end", "title": "" }, { "docid": "cd2b14095600593fbc1ccb218e134093", "score": "0.5966944", "text": "def make(let_expression); end", "title": "" }, { "docid": "cd2b14095600593fbc1ccb218e134093", "score": "0.5966944", "text": "def make(let_expression); end", "title": "" }, { "docid": "aa5e5701814a7c90e6a0ea72486bec78", "score": "0.5958471", "text": "def test_let_valid\n e1 = Minitest::Mock::new 'evaluator 1'\n e1.expect(:evaluate, [5, 'valid'], [5])\n assert_equal 0, @process.let('b', [5])\n end", "title": "" }, { "docid": "00a88d46e5ff0f94b23fd8ad7d7103b5", "score": "0.59244674", "text": "def let let_clauses = {}, &block\n Scope.new(block.binding, let_clauses).instance_eval(&block)\n end", "title": "" }, { "docid": "00a88d46e5ff0f94b23fd8ad7d7103b5", "score": "0.59244674", "text": "def let let_clauses = {}, &block\n Scope.new(block.binding, let_clauses).instance_eval(&block)\n end", "title": "" }, { "docid": "ad8e012e5eab978ff962767b33beeedd", "score": "0.58116436", "text": "def rewrite_let_env(exp)\n exp.depth_first(:defm) do |e|\n args = Set[*e[2].collect{|a| a.kind_of?(Array) ? a[0] : a}]\n\n # Count number of \"regular\" arguments (non \"rest\", non \"block\")\n # FIXME: There are cleaner ways, but in the interest of\n # self-hosting, I'll do this for now.\n ac = 0\n e[2].each{|a| ac += 1 if ! a.kind_of?(Array)}\n\n scopes = [args.dup] # We don't want \"args\" above to get updated \n\n ri = -1\n r = e[2][ri]\n # FIXME: compiler bug; rest does not correctly get initialized to\n # nil in the control flows where it's not assigned.\n rest = nil\n if r\n if r[-1] != :rest\n ri -= 1\n r = e[2][ri]\n end\n if r && r[-1] == :rest\n rest = r[0]\n end\n if rest\n # FIXME: This is a hacky workaround\n if rest != :__copysplat\n r[0] = :__splat\n end\n end\n end\n\n # We use this to assign registers\n freq = Hash.new(0)\n\n vars,env= find_vars(e[3],scopes,Set.new, freq)\n\n env << :__closure__\n\n # For \"preturn\". see Compiler#compile_preturn\n aenv = [:__stackframe__] + env.to_a\n env << :__stackframe__\n\n body = e[3]\n prologue = nil\n vars -= args.to_a\n seen = false\n if env.size > 0\n seen = rewrite_env_vars(body, aenv)\n\n notargs = env - args - [:__closure__]\n\n # FIXME: Due to compiler bug\n ex = e\n extra_assigns = (env - notargs).to_a.collect do |a|\n ai = aenv.index(a)\n # FIXME: \"ex\" instead of \"e\" due to compiler bug.\n E[ex.position, :assign, E[ex.position,:index, :__env__, ai], a]\n end\n prologue = [E[:sexp, E[:assign, :__env__, E[:call, :__alloc_env, aenv.size]]]]\n if !extra_assigns.empty?\n prologue.concat(extra_assigns)\n end\n if body.empty?\n body = [:nil]\n end\n end\n\n # FIXME: seen |= ... and seen = seen | ... both failed to compile.\n if rewrite_lambda(body)\n seen = true\n end\n\n if seen\n vars << :__env__\n vars << :__tmp_proc # Used in rewrite_lambda. Same caveats as for __env_\n end\n\n if rest && rest != :__copysplat\n vars << rest.to_sym\n # FIXME: @bug Removing the E[] below causes segmentation fault\n rest_func =\n [E[:sexp,\n # Corrected to take into account statically provided arguments.\n [:assign, rest.to_sym, [:__splat_to_Array, :__splat, [:sub, :numargs, ac]]]\n ]]\n else\n rest_func = nil\n end\n\n e[3] = []\n if rest_func\n e[3].concat(rest_func)\n end\n\n if seen && prologue # seen && prologue\n e[3].concat(prologue)\n end\n\n e[3].concat(body)\n\n # FIXME: Compiler bug: Changing the below to \"if !vars.empty?\" causes seg fault.\n empty = vars.empty?\n if empty == false\n e[3] = E[e.position,:let, vars, *e[3]]\n # We store the variables by descending frequency for future use in register\n # allocation.\n # FIXME: Compiler bug: -v fails.\n e[3].extra[:varfreq] = freq.sort_by {|k,v| 0 - v }.collect{|a| a.first }\n else\n e[3] = E[e.position, :do, *e[3]]\n end\n\n :skip\n end\n end", "title": "" }, { "docid": "6f882812f7084eb9a104a54028174812", "score": "0.5802396", "text": "def test_let_var_invalid_get\n @rpn.check_var \"LET a 1 2\"\n val = @rpn.get_var \"a\"\n assert_equal val, [1, \"Line 0: Variable a is not initialized\"]\n end", "title": "" }, { "docid": "cb45865bd4e2f8817fe4cd5e5776a3ba", "score": "0.57884437", "text": "def test_var_val_exists\n @process.let('a', [5])\n assert_equal 5, @process.var_val('a')\n end", "title": "" }, { "docid": "d6db0bdc01def731155579d7be79445c", "score": "0.57146174", "text": "def let(*args)\n args = Array.new(*args)\n x = cons(_let, args)\n require(x, (args.size > 1), 'macro or arguments undefined')\n bindings, body = args[0], args[1]\n bindings.each { |b|\n require(b, (b.is_a?(Array) && b.size == 2 && b[0].is_a?(Symbol)),\n 'illegal binding list')\n }\n vars, vals = zip(*bindings)\n return [[_lambda, list(vars)] + map(expand, body)] + map(expand, vals)\n end", "title": "" }, { "docid": "d240bf32d689b6e6e28f737d147f2357", "score": "0.57004476", "text": "def test_let_op_valid_expression\n value = @rpn.let_op(['a', '1'])\n assert_equal value, 1\n value = @rpn.let_op(['a', '1', '1', '+'])\n assert_equal value, 2\n end", "title": "" }, { "docid": "4db551df3f82d5cdf3a3cb65dda9d07e", "score": "0.5673079", "text": "def test_define_variable_no_operator_rpn\r\n input = [\"LET\", \"a\", \"1\", \"1\"]\r\n assert_output(\"Line 0: 2 elements in stack after evaluation\\n\") {@arg_checker.define_variable(input)}\r\n assert_equal Hash.new, @arg_checker.map\r\n end", "title": "" }, { "docid": "8c7a8de9f3b78f668084fa4015a1587b", "score": "0.56566656", "text": "def test_let_var_rpn\n \tval = @rpn.check_var \"LET a 30 30 +\"\n \tassert_equal val, true\n end", "title": "" }, { "docid": "1b9f254b08bab9ef2e3bfbcb44efd684", "score": "0.5652928", "text": "def test_define_variable_laboon\r\n input = [\"LET\", \"laboon\", \"1\"]\r\n assert_output(\"Line 0: Could not evaluate expression\\n\") {@arg_checker.define_variable(input)}\r\n assert_equal Hash.new, @arg_checker.map\r\n end", "title": "" }, { "docid": "b3db4c562e7f6b85db4904899b45e7b5", "score": "0.5650256", "text": "def variable_binding\n name = WORDS.sample + rand(100).to_s\n value = rand(10_000)\n assert_exec [\"set\".k, name.k, value], name\n assert_exec [\"+\".k, name.k, 0], value\n end", "title": "" }, { "docid": "e0adf3b2d658fffa62e29d9dc64ae4fc", "score": "0.5638603", "text": "def test_define_variable_no_rpn\r\n input = [\"LET\", \"a\"]\r\n assert_output(\"Line 0: Could not evaluate expression\\n\") {@arg_checker.define_variable(input)}\r\n assert_equal Hash.new, @arg_checker.map\r\n end", "title": "" }, { "docid": "a8e57ea58f5e4b95a2b2b4f5add3869b", "score": "0.56212455", "text": "def test_mix_of_closures_locals_and_parameters\n result = interpret 'y=10;fn=->(x) { z=4; :x * :y + :z };%fn(3)'\n assert_eq result, 34\n end", "title": "" }, { "docid": "66a68c6fa598b1271588d827341d291f", "score": "0.5587699", "text": "def let\n @let ||= rule(Stone::AST::Let).sep('let').sep('(').ast(let_args).sep(')')\n end", "title": "" }, { "docid": "6b77376905e5077791ff576c4fc98c01", "score": "0.5543115", "text": "def let\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 3 )\n return_value = LetReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n char_literal6 = nil\n string_literal7 = nil\n char_literal8 = nil\n __VAR9__ = nil\n char_literal11 = nil\n char_literal12 = nil\n char_literal14 = nil\n char_literal15 = nil\n expr10 = nil\n expr13 = nil\n\n tree_for_char_literal6 = nil\n tree_for_string_literal7 = nil\n tree_for_char_literal8 = nil\n tree_for_VAR9 = nil\n tree_for_char_literal11 = nil\n tree_for_char_literal12 = nil\n tree_for_char_literal14 = nil\n tree_for_char_literal15 = nil\n stream_VAR = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token VAR\" )\n stream_T__12 = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token T__12\" )\n stream_T__11 = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token T__11\" )\n stream_T__13 = ANTLR3::AST::RewriteRuleTokenStream.new( @adaptor, \"token T__13\" )\n stream_expr = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule expr\" )\n begin\n # at line 25:7: '(' 'let' '(' VAR expr ')' '(' expr ')' ')'\n char_literal6 = match( T__11, TOKENS_FOLLOWING_T__11_IN_let_110 )\n stream_T__11.add( char_literal6 )\n string_literal7 = match( T__12, TOKENS_FOLLOWING_T__12_IN_let_112 )\n stream_T__12.add( string_literal7 )\n char_literal8 = match( T__11, TOKENS_FOLLOWING_T__11_IN_let_114 )\n stream_T__11.add( char_literal8 )\n __VAR9__ = match( VAR, TOKENS_FOLLOWING_VAR_IN_let_116 )\n stream_VAR.add( __VAR9__ )\n @state.following.push( TOKENS_FOLLOWING_expr_IN_let_118 )\n expr10 = expr\n @state.following.pop\n stream_expr.add( expr10.tree )\n char_literal11 = match( T__13, TOKENS_FOLLOWING_T__13_IN_let_120 )\n stream_T__13.add( char_literal11 )\n char_literal12 = match( T__11, TOKENS_FOLLOWING_T__11_IN_let_122 )\n stream_T__11.add( char_literal12 )\n @state.following.push( TOKENS_FOLLOWING_expr_IN_let_124 )\n expr13 = expr\n @state.following.pop\n stream_expr.add( expr13.tree )\n char_literal14 = match( T__13, TOKENS_FOLLOWING_T__13_IN_let_126 )\n stream_T__13.add( char_literal14 )\n char_literal15 = match( T__13, TOKENS_FOLLOWING_T__13_IN_let_128 )\n stream_T__13.add( char_literal15 )\n # AST Rewrite\n # elements: expr, VAR\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \n\n return_value.tree = root_0\n stream_return_value = return_value ? subtree_stream( \"rule return_value\", return_value.tree ) : subtree_stream( \"token return_value\" )\n\n root_0 = @adaptor.create_flat_list\n # 25:51: -> ^( LET VAR ( expr )+ )\n # at line 25:54: ^( LET VAR ( expr )+ )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( @adaptor.create_from_type( LET, \"LET\" ), root_1 )\n\n @adaptor.add_child( root_1, stream_VAR.next_node )\n # at line 25:64: ( expr )+\n stream_expr.has_next? or raise ANTLR3::RewriteEarlyExit\n\n while stream_expr.has_next?\n @adaptor.add_child( root_1, stream_expr.next_tree )\n\n end\n stream_expr.reset\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n return_value.tree = root_0\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 3 )\n\n end\n \n return return_value\n end", "title": "" }, { "docid": "69a84872622553ddbedab121f81f7dbf", "score": "0.54901373", "text": "def let(*args, &prc)\n locals = Hash.new\n bind = prc.binding\n each_variables(bind) do |var, val|\n locals[var] = val\n end\n prc.call(*args)\nrescue Interrupt, ScriptError, NameError, StandardError\n Kernel.raise\nensure\n @locals = locals\n locals.each_key do |name|\n eval(\"#{name} = @locals[#{name.inspect}]\", bind)\n end\n remove_instance_variable(\"@locals\")\nend", "title": "" }, { "docid": "67b835927e5ef05187c9a945ef624bfd", "score": "0.5485744", "text": "def test_let_var_another_var\n @rpn.check_var \"LET a 30\"\n @rpn.check_var \"LET b a\"\n val = @rpn.get_var('b')\n assert_equal val.value, '30'\n end", "title": "" }, { "docid": "f7698383199161e9f04dea75a0f068d8", "score": "0.5435632", "text": "def let(*name_and_value_list, &block)\n (name_and_value_list.size % 2) == 0 or\n raise(ArgumentError, \"Invalid count of arguments.\")\n\n letexpr = \"(let (\"\n until name_and_value_list.empty?\n name = El4r.name_rb2el(name_and_value_list.shift.to_s)\n value = el4r_ruby2lisp(name_and_value_list.shift)\n letexpr << \"(#{name} #{value}) \"\n end\n letexpr << \") (funcall #{el4r_rubyproc_to_lambda(&block)}))\"\n el4r_lisp_eval(letexpr)\n end", "title": "" }, { "docid": "6ceab97a5950b4ccbba4965e0a23b4dd", "score": "0.5399943", "text": "def test_closures_work_from_within_another_closure\n result = interpret 'm=->(x) { ->() { :x + 1 } };y=%m(2);%y()'\n assert_eq result, 3\n end", "title": "" }, { "docid": "8397614448b03875c87b0db3b39aad61", "score": "0.5392943", "text": "def test_local_basic\n lst = compile( \"foo = 1 ; foo\")\n assert_equal ScopeStatement , lst.class\n assert_equal LocalVariable , lst.statements[1].class\n end", "title": "" }, { "docid": "f0c19d04d997802a8032ebd6f8f9a58a", "score": "0.537076", "text": "def compile_let_statement\n element \"letStatement\" do\n\n token = get \"let\"\n output token\n\n # varName\n token = get\n parse_identifier token\n\n # should be \"[\" or \"=\"\n token = peek\n\n # ('[' expression ']')?\n if token.val == \"[\"\n token = get \"[\"\n output token\n\n compile_expression\n\n token = get \"]\"\n output token\n\n token = peek\n end\n\n if token.val == \"=\"\n token = get \"=\"\n output token\n end\n\n compile_expression\n\n token = get \";\"\n output token\n\n end\n end", "title": "" }, { "docid": "d42996f0c2f2edafa9cd0b449497d0bd", "score": "0.53675926", "text": "def test_functions_have_local_scope_for_local_variables\n result = interpret 'defn foo() { c=12};foo();:c'\n assert_eq result, Undefined\n end", "title": "" }, { "docid": "9d9e9d664f9f14a1b56f2a53d725aec9", "score": "0.5308272", "text": "def let(gen, &block)\n Class.new do\n def initialize(g,b,c); @gen = g; @block = b; @context = c end\n def __generate__(size)\n base = RQC.generate_value(@gen, size)\n @block.call(base)\n end\n def inspect\n \"let[#{@context}](#{@gen.inspect})\"\n end\n end.new(gen, block, caller)\n end", "title": "" }, { "docid": "b70232e7e2b199e392c70a31d0c20a7e", "score": "0.52812725", "text": "def test_set_variables_2\n\t\ttester = TheRepl.new()\n\t\tassert_output(\"Line 27: operator LET applied to empty stack\\n\", nil) { tester.set_variables(['a'], 27, false) }\n\t\tassert_nil tester.set_variables(['a'], 27, false)\n\tend", "title": "" }, { "docid": "4b18bc735677a4eda33d602ea467daf5", "score": "0.5275372", "text": "def compile_let\n @commands << '<letStatement>'\n\n # 'let' varName\n next_token\n next_token\n\n # ('[' expression ']')?\n if @tokens[@index].match(/\\[/)\n next_token\n compile_expression\n next_token\n end\n\n # '=' expression ';'\n next_token\n compile_expression\n next_token\n @commands << '</letStatement>'\n end", "title": "" }, { "docid": "aa4173c362c8ef32fd3dce22c73ac677", "score": "0.5274914", "text": "def test_define_variable_empty_stack_rpn\r\n input = [\"LET\", \"a\", \"1\", \"+\"]\r\n assert_output(\"Line 0: Operator + applied to empty stack\\n\") {@arg_checker.define_variable(input)}\r\n assert_equal Hash.new, @arg_checker.map\r\n end", "title": "" }, { "docid": "f0d7e5603a9f97e9842402c70b9f08d2", "score": "0.52380633", "text": "def compile_let(form, lexical_vars, in_tail_pos)\n var, expr, body = destructure_form(form, 3)\n unless var.kind_of? Symbol\n raise Kl::Error, 'first argument to let must be a symbol'\n end\n\n extended_vars = add_var(lexical_vars, var)\n bound_var = extended_vars[var]\n # The bound expression is evaluated in the original lexical scope\n bound_expr = compile(expr, lexical_vars, false)\n let_body = compile(body, extended_vars, in_tail_pos)\n\n \"(#{bound_var} = #{bound_expr}; #{let_body})\"\n end", "title": "" }, { "docid": "a9278333e06c08538d5bebd18f8daffc", "score": "0.5211763", "text": "def test_binding_assignment_does_cause_ruby_stack_overflow\n interpret 'b=binding();:b'\n end", "title": "" }, { "docid": "5ef72408e18864b10395e9b6a23f4177", "score": "0.519367", "text": "def find_vars(e, scopes, env, freq, in_lambda = false, in_assign = false)\n return [],env, false if !e\n e = [e] if !e.is_a?(Array)\n e.each do |n|\n if n.is_a?(Array)\n if n[0] == :assign\n vars1, env1 = find_vars(n[1], scopes + [Set.new],env, freq, in_lambda, true)\n vars2, env2 = find_vars(n[2..-1], scopes + [Set.new],env, freq, in_lambda)\n env = env1 + env2\n vars = vars1+vars2\n vars.each {|v| push_var(scopes,env,v) if !is_special_name?(v) }\n elsif n[0] == :lambda || n[0] == :proc\n vars, env2= find_vars(n[2], scopes + [Set.new],env, freq, true)\n\n # Clean out proc/lambda arguments from the %s(let ..) and the environment we're building\n vars -= n[1] if n[1]\n env2 -= n[1] if n[1]\n env += env2\n\n n[2] = E[n.position,:let, vars, *n[2]] if n[2]\n else\n if n[0] == :callm\n vars, env = find_vars(n[1], scopes, env, freq, in_lambda)\n\n if n[3]\n nodes = n[3]\n nodes = [nodes] if !nodes.is_a?(Array)\n nodes.each do |n2|\n vars2, env2 = find_vars([n2], scopes+[Set.new], env, freq, in_lambda)\n vars += vars2\n env += env2\n end\n end\n\n # If a block is provided, we need to find variables there too\n if n[4]\n vars3, env3 = find_vars([n[4]], scopes, env, freq, in_lambda)\n vars += vars3\n env += env3\n end\n elsif n[0] == :call\n vars, env = find_vars(n[1], scopes, env, freq, in_lambda)\n if n[2]\n nodes = n[2]\n nodes = [nodes] if !nodes.is_a?(Array)\n nodes.each do |n2|\n vars2, env2 = find_vars(n2, scopes+[Set.new], env, freq, in_lambda)\n vars += vars2\n env += env2\n end\n end\n\n if n[3]\n vars2, env2 = find_vars([n[3]], scopes, env, freq, in_lambda)\n vars += vars2\n env += env2\n end\n else\n vars, env = find_vars(n[1..-1], scopes, env, freq, in_lambda)\n end\n\n vars.each {|v| push_var(scopes,env,v); }\n end\n elsif n.is_a?(Symbol)\n sc = in_scopes(scopes[0..-2],n)\n freq[n] += 1 if !is_special_name?(n)\n if sc.size == 0\n push_var(scopes,env,n) if in_assign && !is_special_name?(n)\n elsif in_lambda\n sc.first.delete(n)\n env << n\n end\n end\n end\n\n ## FIXME: putting the below on one line breaks.\n last_scope = scopes[-1]\n a = last_scope.to_a\n return a, env\n # return scopes[-1].to_a, env\n end", "title": "" }, { "docid": "e070a41f81f723ea724b47c65e2e9e30", "score": "0.5172513", "text": "def test_check_var_let\n assert_equal 'also ok', @process.check_var_names('F')\n end", "title": "" }, { "docid": "dafdfb04892adf24dd0e179885874527", "score": "0.51674926", "text": "def test_can_save_block_and_ten_retrieve_and_execute_it_later\n assert_eq interpret( 'var1=:{5+3}; 4*3; %var1'), 8\n end", "title": "" }, { "docid": "6e46b15a8d8afc96904e853d3a355e0f", "score": "0.51667887", "text": "def assign_test_bot_lets!(options)\n lets = if options.kind_of?(Hash) && options[:normalized]\n options\n else\n self.class.normalize_test_bot_options!(options)\n end\n\n # Clear any previously defined memoized values\n @_memoized = nil # This clears the minitest let! syntax memoized values\n\n # Using the minitest spec let(:foo) { 'bar' } syntax\n lets.each do |key, value|\n if value.kind_of?(Hash) && !value.kind_of?(HashWithIndifferentAccess)\n self.class.let(key) { HashWithIndifferentAccess.new(value) }\n else\n self.class.let(key) { value }\n end\n end\n\n lets\n end", "title": "" }, { "docid": "ac12bc4ceb077e50938aac454fe9b246", "score": "0.514012", "text": "def test_let_syntax_err_check_value_missing\r\n assert_output(/Value missing/){ let_syntax_err_check 'a'.split, 1}\r\n end", "title": "" }, { "docid": "c4aa9e56ad35e4c5c43fe5b22a01b602", "score": "0.5138882", "text": "def test_define_variable_valid\r\n input = [\"LET\", \"A\", \"1\", \"1\", \"+\"]\r\n assert_output(\"2\\n\") {@arg_checker.define_variable(input)}\r\n assert_equal 2, @arg_checker.map[\"A\"]\r\n end", "title": "" }, { "docid": "efe8f89521bf60886b40e48a1c3b19a1", "score": "0.51322263", "text": "def test_local_vars_and_scopes\n foo = 123\n axes(\"123 + x\") {foo + x}\n end", "title": "" }, { "docid": "8b103192170cfc1eb146adf29123391e", "score": "0.5131183", "text": "def compile_let_statement\n write_tag '<letStatement>'\n consume(TokenType::LET)\n var_name_token = consume(TokenType::IDENTIFIER)\n # Array assignment\n # let arr[index] = expr, *(arr+index) = expr\n #\n if check?('[')\n consume('[')\n @vm_writer.write_push(@subroutine_symbol_table.segment_of(var_name_token.lexeme),\n @subroutine_symbol_table.index_of(var_name_token.lexeme))\n compile_expression\n @vm_writer.write_arithmetic('add')\n consume(']')\n consume('=')\n compile_expression\n @vm_writer.write_pop('temp', 0)\n @vm_writer.write_pop('pointer', 1) # Set THAT = stack.pop\n @vm_writer.write_push('temp', 0)\n @vm_writer.write_pop('that', 0)\n else\n # let varName = expr;\n consume('=')\n compile_expression\n @vm_writer.write_pop(@subroutine_symbol_table.segment_of(var_name_token.lexeme),\n @subroutine_symbol_table.index_of(var_name_token.lexeme))\n end\n\n consume(';')\n write_tag '</letStatement>'\n end", "title": "" }, { "docid": "d5dd4897a112ba1a59306cc4548f3711", "score": "0.5113324", "text": "def test_execute_keywords_let_valid_var_name\r\n @rpn_repl.error['bool'] = false\r\n @rpn_repl.operands = []\r\n syntax = 'let p 9 10 *'.split\r\n @rpn_repl.execute_keywords syntax.drop(1), syntax[0]\r\n assert_equal @rpn_repl.variables['P'], 90\r\n assert_equal @rpn_repl.error['bool'], false\r\n end", "title": "" }, { "docid": "40b5c24e20af22218289b1503dfb4e98", "score": "0.50900733", "text": "def test_let_valid_syntax\r\n @rpn_repl.error['bool'] = false\r\n syntax = 'p 90'.split\r\n @rpn_repl.let syntax\r\n assert_equal @rpn_repl.variables['P'], 90\r\n assert_equal @rpn_repl.error['bool'], false\r\n end", "title": "" }, { "docid": "dcc69b4b414e3dde9db3f7b959b28b1d", "score": "0.5069015", "text": "def eval_let(exp, env)\n names, values, body = extract_let_exp(exp)\n new_exp = [[:lambda, names, body], *values]\n _eval(new_exp, env)\n end", "title": "" }, { "docid": "81dcf4e7455b6490fad7ca43dc28a03f", "score": "0.50659055", "text": "def test_let_lambda\n\n pdef = Ruote.define do\n\n define 'a' do\n echo 'global_a'\n end\n\n let do\n define 'a' do\n echo 'a'\n end\n define 'b' do\n echo 'b'\n end\n subprocess '${the_case}'\n end\n\n subprocess 'a'\n end\n\n wfid = @dashboard.launch(pdef, 'the_case' => 'a')\n @dashboard.wait_for(wfid)\n assert_equal %w[ a global_a ], @tracer.to_a\n\n @tracer.clear\n\n wfid = @dashboard.launch(pdef, 'the_case' => 'b')\n @dashboard.wait_for(wfid)\n assert_equal %w[ b global_a ], @tracer.to_a\n end", "title": "" }, { "docid": "a11bb0f22a377ac273d99e1a808ba5a2", "score": "0.5059754", "text": "def test_validation_heterogeneous_sets()\n sb = @dfp.new_statement_builder do |b|\n b.with_bind_variable('var_name', [1,2,'3'])\n end\n assert_raise(RuntimeError) { sb.to_statement() }\n end", "title": "" }, { "docid": "6fa0d4e9c09816291f05c3d906c6c145", "score": "0.50460804", "text": "def test_block_can_be_called_after_and_with_2_ampersands\n assert_false interpret( 'twobits=100 / 4; :twobits == 25 && {true; var=false }; :var')\n end", "title": "" }, { "docid": "532a94f86e323bea2a0c4cdde4617b21", "score": "0.5032001", "text": "def test_double_scope\n # make sure my assumptions are correct about the\n # classes being tested\n assert 1.respond_to?(:zero?)\n assert_equal false, '1'.respond_to?(:zero?)\n \n # make sure that the array elements are being reversed\n str = ['0','2','3']\n assert_equal [0,2,3], str.reach.to_i.retract\n assert_equal [true, false, false], str.reach.to_i.zero?.retract\n end", "title": "" }, { "docid": "5fa83417907c54ae50990b8a9a7db43d", "score": "0.5028611", "text": "def test_let_err_check\r\n assert_output(/Variable name missing/){ let_err_check '', 1 }\r\n end", "title": "" }, { "docid": "2bced577cefec89fc1213329be54bc0a", "score": "0.5008472", "text": "def let! name, &block\n let name, &block\n before name.to_sym\n end", "title": "" }, { "docid": "0def57520d7b4af9be63c9a6e304e4f8", "score": "0.5004443", "text": "def test_set_evaluation_3\n\t\ttester = TheRepl.new()\n\t\ttester.set_variables(['a', '97'], 1, false)\n\t\tassert_equal [\"97\"], tester.set_evaluation('a', [], 1, false)\n\tend", "title": "" }, { "docid": "df6d2c81dc0db4a89e4d8dbf0d710096", "score": "0.4981583", "text": "def test_lambda_can_set_closed_over_term\n result = interpret 'x=9;m=->() { x=10 };%m();:x'\n assert_eq result, 10\n end", "title": "" }, { "docid": "d2e9406619154d04d6c84bb584dc7d03", "score": "0.49805078", "text": "def test_define_variable_nil\r\n input = [\"LET\"]\r\n assert_output(\"Line 0: Could not evaluate expression\\n\") {@arg_checker.define_variable(input)}\r\n assert_equal Hash.new, @arg_checker.map\r\n end", "title": "" }, { "docid": "f62a7050a40ca0f18ee28f0072725b76", "score": "0.49670592", "text": "def test_parallel_assignments_with_too_few_variables\n first_name, last_name = [\"Cher\"]\n assert_equal \"Cher\", first_name\n assert_equal nil, last_name\n end", "title": "" }, { "docid": "4945e0048c71372de2ea53991f4e65a3", "score": "0.49545518", "text": "def test_define_variable_question_mark\r\n input = [\"LET\", \"?\", \"1\"]\r\n assert_output(\"Line 0: Could not evaluate expression\\n\") {@arg_checker.define_variable(input)}\r\n assert_equal Hash.new, @arg_checker.map\r\n end", "title": "" }, { "docid": "74627b7cc8305a70e00958865d4c3279", "score": "0.49519768", "text": "def test_process_defn\n @meth = \"#x\"\n\n sexp = s(:defn, :x,\n s(:args, :y),\n s(:scope,\n s(:block,\n s(:lit, 42))))\n\n assert_process sexp, 0.275, :magic_number => 0.275\n end", "title": "" }, { "docid": "5ddf138f6578e2875fde199da1cc4e7a", "score": "0.49343297", "text": "def test_anon_function_nine_args_to_sexp\n assert_sexp(\n [[:var,\n [[:assign, [:name, 'foo'],\n [:func_expr, nil, ('a'..'i').to_a, []]\n ]]\n ]],\n @parser.parse(\"var foo = function(#{('a'..'i').to_a.join(',')}) { }\"))\n assert_ecma(\"var foo = function(#{('a'..'i').to_a.join(', ')}) { };\",\n @parser.parse(\"var foo = function(#{('a'..'i').to_a.join(',')}) { }\"))\n end", "title": "" }, { "docid": "a6d9d2c99412d526a94bab99a214755e", "score": "0.49120873", "text": "def compileLet(tokens)\n puts \"compiling Let\"\n ptr = 0\n\n debugger\n @xml.tag!(tokens[ptr].tag, \" #{tokens[ptr].token} \")\n ptr = ptr+1\n\n if tokens[ptr].tag == :identifier then\n @xml.tag!(tokens[ptr].tag, \" #{tokens[ptr].token} \")\n\n varName = tokens[ptr].token\n ptr = ptr+1\n\n end\n\n if tokens[ptr].token == \"[\" then\n @xml.tag!(tokens[ptr].tag, \" #{tokens[ptr].token} \")\n ptr = ptr+1\n\n\n @xml.expression {\n\tptr = ptr + compileExpression(tokens[ptr...tokens.size])\n }\n\n @xml.tag!(tokens[ptr].tag, \" #{tokens[ptr].token} \")\n ptr = ptr+1\n end\n\n if tokens[ptr].token == \"=\" then\n @xml.tag!(tokens[ptr].tag, \" #{tokens[ptr].token} \")\n ptr = ptr+1\n end\n\n\n puts \"#{tokens[ptr].inspect}\"\n\n# debugger\n @xml.expression{\n ptr = ptr + compileExpression(tokens[ptr...tokens.size])\n }\n\n if @subroutine_called then\n @vm.writePop(@symbolTable.kindOf(varName), @symbolTable.indexOf(varName))\n end\n\n if tokens[ptr].token == \";\" then\n @xml.tag!(tokens[ptr].tag, \" #{tokens[ptr].token} \")\n ptr = ptr+1\n end\n\n puts \"finished Let\"\n return ptr\n end", "title": "" }, { "docid": "103cbaf0b406c19761f6304aacb3c5b8", "score": "0.49066564", "text": "def test_sub_and_add_and_lit\n lit = Lit.new(12)\n lit2 = Lit.new(8)\n lit3 = Lit.new(5)\n lit4 = Lit.new(3)\n sub = Sub.new(lit, lit2)\n add = Add.new(lit3,sub)\n add2 = Add.new(add,lit4)\n assert_equal 12, add2.eval\n end", "title": "" }, { "docid": "364569233065579698e3d48530ab9563", "score": "0.48911232", "text": "def test_should_result_in_empty_stack\n assert_eval true, [\n [\"lit\", true], [\"jtrue\", 4], [\"lit\", true], [\"jtrue\", 2], [\"lit\", true],\n [\"jtrue\", 2], [\"lit\", true],\n ]\n end", "title": "" }, { "docid": "7d5a3257c31ad90de34e90018962bbd8", "score": "0.48648256", "text": "def let_op(tokens)\n variable_name = tokens.shift\n # if the stack is empty here return an error\n return Error.new('Operator LET applied to empty stack', 2) if tokens.empty?\n # if the variable is a valid var name, pass the rpn expression\n # to calculate and set it equal to its return value\n if var?(variable_name)\n value = calculate(tokens)\n @variables.set_variable(variable_name, value) unless value.is_a?(Error)\n value\n else\n Error.new('Invalid variable name', 5)\n end\n end", "title": "" }, { "docid": "5885c2bdf1460e06a3f6bf8280748811", "score": "0.48498374", "text": "def test_validity_valid\n @process.let('C', [15])\n assert_equal [15, 5, '+'], @process.check_validity(['C', '5', '+'])\n end", "title": "" }, { "docid": "a6f2b6e2dce864fc667961a1217cf15a", "score": "0.4849225", "text": "def test_print_expression_2\n\t\ttester = TheRepl.new()\n\t\tassert_output(\"Line 19: Variable t has not been initialized\\n\") { tester.print_expression(['t', '10', '+'], 19, false) }\n\tend", "title": "" }, { "docid": "c2549a7c61777966686af332641b6e72", "score": "0.48446798", "text": "def test_text_block_using_variable\n @method.write_expression \"a = 5\", 5\n @method.write_expression \"b = 0\", 0\n @method.write_expression \"a.times do\\nb += a\\nend\", 5 #result is number of times \n @method.write_expression \"b\", 25\n expected = <<-EOF\n def test_1\n a = 5\n b = 0\n a.times do\n b += a\n end\n assert_equal(25, b)\n end\n\n EOF\n assert_equal expected, @method.text\n end", "title": "" }, { "docid": "9a4e28e3d315e70e671b52d792613e4f", "score": "0.4836703", "text": "def test_trap_block_args\n rf = RubyReflector.new\n assert{ rf.captured_block_vars.nil? }\n rf.absorb_block_args ['assert do']\n assert{ rf.captured_block_vars.nil? }\n rf.absorb_block_args ['assert do', 'end']\n assert{ rf.captured_block_vars.nil? }\n rf.absorb_block_args ['assert do |yo|']\n assert{ rf.captured_block_vars == 'yo' }\n rf.absorb_block_args ['assert do', '|yo|']\n assert{ rf.captured_block_vars == 'yo' }\n end", "title": "" }, { "docid": "6545fbcc8cccb47978f527f4dd323b48", "score": "0.48280302", "text": "def test_block_as_set(_t)\n test_block_as_set_ast_in = ((_t).equal?(ASTNULL)) ? nil : _t\n n_alts = 0\n r = @grammar.get_locally_defined_rule(@current_rule_name)\n begin\n # for error handling\n __t125 = _t\n tmp83_ast_in = _t\n match(_t, BLOCK)\n _t = _t.get_first_child\n _cnt129 = 0\n begin\n if ((_t).nil?)\n _t = ASTNULL\n end\n if (((_t.get_type).equal?(ALT)))\n __t127 = _t\n tmp84_ast_in = _t\n match(_t, ALT)\n _t = _t.get_first_child\n if ((_t).nil?)\n _t = ASTNULL\n end\n case (_t.get_type)\n when BACKTRACK_SEMPRED\n tmp85_ast_in = _t\n match(_t, BACKTRACK_SEMPRED)\n _t = _t.get_next_sibling\n when BLOCK, CHAR_RANGE, STRING_LITERAL, CHAR_LITERAL, TOKEN_REF, NOT\n else\n raise NoViableAltException.new(_t)\n end\n test_set_element(_t)\n _t = self.attr__ret_tree\n n_alts += 1\n tmp86_ast_in = _t\n match(_t, EOA)\n _t = _t.get_next_sibling\n _t = __t127\n _t = _t.get_next_sibling\n if (!(!r.has_rewrite(@outer_alt_num)))\n raise SemanticException.new(\"!r.hasRewrite(outerAltNum)\")\n end\n else\n if (_cnt129 >= 1)\n break\n else\n raise NoViableAltException.new(_t)\n end\n end\n _cnt129 += 1\n end while (true)\n tmp87_ast_in = _t\n match(_t, EOB)\n _t = _t.get_next_sibling\n _t = __t125\n _t = _t.get_next_sibling\n if (!(n_alts > 1))\n raise SemanticException.new(\"nAlts>1\")\n end\n rescue RecognitionException => re\n raise re\n end\n self.attr__ret_tree = _t\n end", "title": "" }, { "docid": "f855f49ea08d33f75a97dc40dd13e8f6", "score": "0.4825462", "text": "def test_variable_check_true_1\n\t\ttester = TheRepl.new()\n\t\tassert_equal true, tester.check_variables(['ask', 'for', 'a', 'dog'])\n\tend", "title": "" }, { "docid": "2b978368304c88b75b925c695d091bc7", "score": "0.4815999", "text": "def assignment_after_var(node = @prog)\n retry_flag = true\n while retry_flag\n retry_flag = false\n node.traverse(nil) {|parent, st|\n if st.kind_of? ECMA262::StVar and parent.kind_of? ECMA262::SourceElements\n catch(:break){\n idx = parent.index(st) + 1\n while true\n st2 = parent[idx]\n if st2.kind_of? ECMA262::StEmpty or (st2.kind_of? ECMA262::StFunc and st2.decl?)\n idx +=1\n next\n elsif st2.kind_of? ECMA262::StExp and st2.exp.kind_of? ECMA262::ExpAssign\n if rewrite_var(st, st2.exp.val, st2.exp.val2)\n parent.replace(st2, ECMA262::StEmpty.new())\n retry_flag = true\n else\n throw :break\n end\n idx += 1\n next\n elsif st2.kind_of? ECMA262::StFor and st2.exp1.kind_of? ECMA262::ExpAssign\n if rewrite_var(st, st2.exp1.val, st2.exp1.val2)\n st2.replace(st2.exp1, nil)\n retry_flag = true\n else\n throw :break\n end\n throw :break\n elsif st2.kind_of? ECMA262::StExp and st2.exp.kind_of? ECMA262::ExpComma\n exp_parent = st2\n exp = st2.exp\n\n while exp.val.kind_of? ECMA262::ExpComma\n exp_parent = exp\n exp = exp.val\n end\n\n if exp.val.kind_of? ECMA262::ExpAssign\n if rewrite_var(st, exp.val.val, exp.val.val2)\n exp_parent.replace(exp, exp.val2)\n retry_flag = true\n else\n throw :break\n end\n else\n throw :break\n end\n else\n throw :break\n end\n end\n }\n end\n }\n end\n self\n end", "title": "" }, { "docid": "5e227c9dbfb4bd71bce7868f4d1d770d", "score": "0.48090106", "text": "def reduce_short_let_form(_production, _range, _tokens, theChildren)\n SkmBindingBlock.new(:let, theChildren[3], theChildren[5])\n end", "title": "" }, { "docid": "49dfd679e57bb733853417f29d684710", "score": "0.4784336", "text": "def test_variable_check_corner_2\n\t\ttester = TheRepl.new()\n\t\tassert_nil tester.check_variables([])\n\tend", "title": "" }, { "docid": "1e672efc485ed13c1e99372977b37875", "score": "0.47792798", "text": "def prepare_let_blocks(base)\n base.class_eval do\n let(:robot) { Robot.new(registry) }\n let(:source) { Source.new(user: user) }\n let(:user) { User.create(\"1\", name: \"Test User\") }\n let(:replies) { [] }\n end\n end", "title": "" }, { "docid": "5e80341c72571e0c7b85f998f3e464f2", "score": "0.47776902", "text": "def test_sub_and_lit_right\n lit = Lit.new(30)\n lit2 = Lit.new(7)\n sub1 = Sub.new(lit, lit2)\n sub2 = Sub.new(sub1, lit2)\n assert_equal 16, sub2.eval\n end", "title": "" }, { "docid": "5f23ca3a0028a652a64429c616dca43d", "score": "0.47715804", "text": "def test_valid_get_var\n token_stack = TokenStack.new\n token_stack.variables['a'] = 3\n assert_equal(token_stack.get_var('a'), 3)\n end", "title": "" }, { "docid": "766e619592f35eec939048efa04ff86e", "score": "0.47702667", "text": "def assert_differences(expression_array, message = nil, &block)\n b = block.send(:binding)\n before = expression_array.map { |expr| eval(expr[0], b) }\n\n yield\n\n expression_array.each_with_index do |pair, i|\n e = pair[0]\n difference = pair[1]\n error = \"#{e.inspect} didn't change by #{difference}\"\n error = \"#{message}\\n#{error}\" if message\n assert_equal(before[i] + difference, eval(e, b), error)\n end\nend", "title": "" }, { "docid": "d857766b6488b244abdcacdf8323292a", "score": "0.47696275", "text": "def test_do_math_unitialized_variable\r\n input = [\"a\", \"1\", \"+\"]\r\n val = 0\r\n assert_output(\"Line 0: Variable a is not initialized\\n\") {val = @arg_checker.do_math(input)}\r\n assert_equal [], val\r\n end", "title": "" }, { "docid": "8f42e36e2c3be01c64f969952c092931", "score": "0.47664905", "text": "def mess_with_vars(one, two, three)\n one = two\n # a new object with name one is created\n # one and two are pointing at the same object with the value of \"two\"\n two = three\n # a new object called two was created - so no longer bound to one\n # the value is set to \"three\" in this case\n three = one\n # a new object is created called three\n # it's pointed at the same object and value as one, which has\n # the value \"two\"\n\n # because all three statements are using an assignment method,\n # this means that none of the statement modified the objects used as\n # parameters of the method\nend", "title": "" }, { "docid": "188d365f55ba8c623d78859e3be182e2", "score": "0.47636497", "text": "def test_rewrite_resbody\n @insert = s(:resbody,\n s(:array, s(:const, :SyntaxError)),\n s(:block, s(:lasgn, :e1, s(:gvar, :$!)), s(:lit, 2)),\n s(:resbody,\n s(:array, s(:const, :Exception)),\n s(:block, s(:lasgn, :e2, s(:gvar, :$!)), s(:lit, 3))))\n\n @expect = s(:resbody,\n s(:array, s(:const, :SyntaxError), s(:lasgn, :e1, s(:gvar, :$!))),\n s(:block, s(:lit, 2)),\n s(:resbody,\n s(:array, s(:const, :Exception), s(:lasgn, :e2, s(:gvar, :$!))),\n s(:block, s(:lit, 3))))\n\n doit\n end", "title": "" }, { "docid": "ed2724b2646974d60acb658df7b9f1b4", "score": "0.47607136", "text": "def test_variable_check_true_2\n\t\ttester = TheRepl.new()\n\t\tassert_equal true, tester.check_variables(['b', 'cause', 'turkey'])\n\tend", "title": "" }, { "docid": "2cded559a7cd2335f4e24831ef6f1609", "score": "0.4756708", "text": "def let_access(*arguments, &block)\n let(:let_read, arguments, block)\n let(:let_write, arguments, block)\n end", "title": "" }, { "docid": "406d6fd433e667b1d0428b303969d999", "score": "0.47418675", "text": "def expr\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 2 )\n return_value = ExprReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n number2 = nil\n var3 = nil\n minus4 = nil\n let5 = nil\n\n\n begin\n # at line 19:6: ( number | var | minus | let )\n alt_2 = 4\n case look_2 = @input.peek( 1 )\n when NUM then alt_2 = 1\n when VAR then alt_2 = 2\n when T__11 then look_2_3 = @input.peek( 2 )\n\n if ( look_2_3 == T__14 )\n alt_2 = 3\n elsif ( look_2_3 == T__12 )\n alt_2 = 4\n else\n raise NoViableAlternative( \"\", 2, 3 )\n end\n else\n raise NoViableAlternative( \"\", 2, 0 )\n end\n case alt_2\n when 1\n root_0 = @adaptor.create_flat_list\n\n\n # at line 19:8: number\n @state.following.push( TOKENS_FOLLOWING_number_IN_expr_81 )\n number2 = number\n @state.following.pop\n @adaptor.add_child( root_0, number2.tree )\n\n when 2\n root_0 = @adaptor.create_flat_list\n\n\n # at line 20:3: var\n @state.following.push( TOKENS_FOLLOWING_var_IN_expr_87 )\n var3 = var\n @state.following.pop\n @adaptor.add_child( root_0, var3.tree )\n\n when 3\n root_0 = @adaptor.create_flat_list\n\n\n # at line 21:3: minus\n @state.following.push( TOKENS_FOLLOWING_minus_IN_expr_93 )\n minus4 = minus\n @state.following.pop\n @adaptor.add_child( root_0, minus4.tree )\n\n when 4\n root_0 = @adaptor.create_flat_list\n\n\n # at line 22:3: let\n @state.following.push( TOKENS_FOLLOWING_let_IN_expr_99 )\n let5 = let\n @state.following.pop\n @adaptor.add_child( root_0, let5.tree )\n\n end# - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 2 )\n\n end\n \n return return_value\n end", "title": "" }, { "docid": "3203d0597df1ad07c7fb860f3b2100bf", "score": "0.47353905", "text": "def test_multiple_settings_of_bind_variable()\n sb = @dfp.new_statement_builder\n sb.with_bind_variable('var_name', 123)\n sb.with_bind_variable('var_name', 'abc')\n values = [{:key => 'var_name',\n :value => {:xsi_type => 'TextValue', :value => 'abc'}}]\n assert_equal(values, sb.to_statement()[:values])\n end", "title": "" }, { "docid": "47c4c98e2775a21040c252e8e6d427be", "score": "0.47287714", "text": "def test_variable_check_corner_1\n\t\ttester = TheRepl.new()\n\t\tassert_nil tester.check_variables([1, 2, 3])\n\tend", "title": "" }, { "docid": "d51ece1a54068243d53ae3d2c69da975", "score": "0.47168115", "text": "def test_set_variables_3\n\t\ttester = TheRepl.new()\n\t\tassert_equal 19, tester.set_variables(['a', '9', '10', '+'], 1, false)\n\tend", "title": "" }, { "docid": "bfc400df722c2b7973e687831c621470", "score": "0.47113696", "text": "def evaluate(exp, env, function_definitions)\n # exp: A current node of AST\n # env: An environment (explained later)\n case exp[0]\n\n\n when \"method_call\"\n if exp[3].nil? || exp[3].empty?\n evaluate(exp[1], env, function_definitions).send(exp[2])\n else\n evaluate(exp[1], env, function_definitions).send(exp[2], *exp[3..-1].map{|e| evaluate(e, env, function_definitions)})\n end\n when \"class\"\n klass = Class.new\n _funcs = {}\n _env = {}\n klass.define_method(\"method_missing\") do |method_name, *args|\n evaluate([\"func_call\", method_name.to_s, *args.map{|a| [\"lit\", a]}], _env, _funcs)\n end\n evaluate(exp[2], _env, _funcs)\n $classes[exp[1]] = klass\n when \"const_ref\"\n $classes[exp[1]]\n\n# \n## Problem 1: Arithmetics\n#\n\n when \"lit\"\n exp[1] # return the immediate value as is\n\n when \"+\"\n evaluate(exp[1], env, function_definitions) + evaluate(exp[2], env, function_definitions)\n when \"-\"\n evaluate(exp[1], env, function_definitions) - evaluate(exp[2], env, function_definitions)\n when \"*\"\n evaluate(exp[1], env, function_definitions) * evaluate(exp[2], env, function_definitions)\n when \"%\"\n evaluate(exp[1], env, function_definitions) % evaluate(exp[2], env, function_definitions)\n when \"/\"\n evaluate(exp[1], env, function_definitions) / evaluate(exp[2], env, function_definitions)\n\n \n#\n## Problem 2: Statements and variables\n#\n\n when \"stmts\"\n i = 1\n while exp[i]\n last = evaluate(exp[i], env, function_definitions)\n i = i + 1\n end\n last\n when \"var_ref\"\n env[exp[1]]\n when \"var_assign\"\n env[exp[1]] = evaluate(exp[2], env, function_definitions)\n\n#\n## Problem 3: Branchs and loops\n#\n when \">\"\n evaluate(exp[1], env, function_definitions) > evaluate(exp[2], env, function_definitions)\n when \"<\"\n evaluate(exp[1], env, function_definitions) < evaluate(exp[2], env, function_definitions)\n when \"==\"\n evaluate(exp[1], env, function_definitions) == evaluate(exp[2], env, function_definitions)\n\n\n when \"if\"\n if evaluate(exp[1], env, function_definitions)\n evaluate(exp[2], env, function_definitions)\n else\n evaluate(exp[3], env, function_definitions)\n end\n\n when \"while\"\n while evaluate(exp[1], env, function_definitions)\n evaluate(exp[2], env, function_definitions)\n end\n\n#\n## Problem 4: Function calls\n#\n\n when \"func_call\"\n # Lookup the function definition by the given function name.\n func = function_definitions[exp[1]]\n\n if func == nil\n # We couldn't find a user-defined function definition;\n # it should be a builtin function.\n # Dispatch upon the given function name, and do paticular tasks.\n case exp[1]\n when \"p\"\n # MinRuby's `p` method is implemented by Ruby's `p` method.\n p(evaluate(exp[2], env, function_definitions))\n # ... Problem 4\n when \"Integer\"\n Integer(evaluate(exp[2], env, function_definitions))\n when \"fizzbuzz\"\n num = evaluate(exp[2], env, function_definitions)\n if num % 3 == 0 && num % 5 == 0\n \"FizzBuzz\"\n elsif num % 3 == 0\n \"Fizz\"\n elsif num % 5 == 0 \n \"Buzz\"\n else\n num\n end\n when \"require\"\n require(evaluate(exp[2], env, function_definitions))\n when \"minruby_parse\"\n minruby_parse(evaluate(exp[2], env, function_definitions))\n when \"minruby_load\"\n minruby_load()\n else\n pp exp\n raise(\"unknown builtin function\")\n end\n else\n\n\n#\n## Problem 5: Function definition\n#\n\n # (You may want to implement \"func_def\" first.)\n #\n # Here, we could find a user-defined function definition.\n # The variable `func` should be a value that was stored at \"func_def\":\n # parameter list and AST of function body.\n #\n # Function calls evaluates the AST of function body within a new scope.\n # You know, you cannot access a varible out of function.\n # Therefore, you need to create a new environment, and evaluate the\n # function body under the environment.\n #\n # Note, you can access formal parameters (*1) in function body.\n # So, the new environment must be initialized with each parameter.\n #\n # (*1) formal parameter: a variable as found in the function definition.\n # For example, `a`, `b`, and `c` are the formal parameters of\n # `def foo(a, b, c)`.\n _env = {}\n i = 0\n while func[0][i]\n _env[func[0][i]] = evaluate(exp[2 + i], env, function_definitions)\n i = i + 1\n end\n evaluate(func[1], _env, function_definitions)\n end\n\n when \"func_def\"\n # Function definition.\n #\n # Add a new function definition to function definition list.\n # The AST of \"func_def\" contains function name, parameter list, and the\n # child AST of function body.\n # All you need is store them into $function_definitions.\n #\n # Advice: $function_definitions[???] = ???\n i = 0\n _exp = []\n while exp[i + 2]\n _exp[i] = exp[i + 2]\n i = i + 1\n end\n function_definitions[exp[1]] = _exp\n # raise(NotImplementedError) # Problem 5\n\n\n#\n## Problem 6: Arrays and Hashes\n#\n # You don't need advices anymore, do you?\n when \"ary_new\"\n a = []\n i = 0\n while exp[i + 1]\n a[i] = evaluate(exp[i + 1], env, function_definitions)\n i = i + 1\n end\n a\n when \"ary_ref\"\n evaluate(exp[1], env, function_definitions)[evaluate(exp[2], env, function_definitions)]\n when \"ary_assign\"\n evaluate(exp[1], env, function_definitions)[evaluate(exp[2], env, function_definitions)] = evaluate(exp[3], env, function_definitions)\n when \"hash_new\"\n h = {}\n i = 0\n while exp[i + 1]\n key = evaluate(exp[i + 1], env, function_definitions)\n i = i + 1\n value = evaluate(exp[i + 1], env, function_definitions)\n i = i + 1\n h[key] = value\n end\n h\n else\n p(\"error\")\n pp(exp)\n raise(\"unknown node\")\n end\nend", "title": "" }, { "docid": "77b30029e29c281397277f9a168b2179", "score": "0.4710415", "text": "def prepare_let_blocks(base)\n base.class_eval do\n let(:robot) { Robot.new(registry) }\n let(:source) { Source.new(user: user) }\n let(:user) { User.create(\"1\", name: \"Test User\") }\n end\n end", "title": "" }, { "docid": "bd8cad59e43ac4f03e2cc05b1deb2b19", "score": "0.470993", "text": "def test_self_equals_deref_on_asignment\n assert_equal 7, compile(\"@foo = 7; self.foo\")\n end", "title": "" }, { "docid": "37810095b74435b06c46d70176c7b4c7", "score": "0.47090474", "text": "def slet name, &block\n let!(name) { instance_eval(&block) }\n subject { self.send(name) }\nend", "title": "" }, { "docid": "7a2a14ce5dfe757d3cf6999410af83c5", "score": "0.47078493", "text": "def test_squares\n assert_equal(\n [0, 1, 4, 9, 16, 25, 36, 49, 64, 81],\n c{ x ** 2 }.for{ x }.in(0...10)\n )\n end", "title": "" }, { "docid": "5a4c4f4040654735226a0dd137e1fe35", "score": "0.4707594", "text": "def test_sub_and_lit_left\n lit = Lit.new(8)\n lit2 = Lit.new(50)\n sub1 = Sub.new(lit2,lit)\n sub2 = Sub.new(lit2,sub1)\n assert_equal 8, sub2.eval\n end", "title": "" }, { "docid": "324473daa26ebfbb75b43227cc3a4b30", "score": "0.47072387", "text": "def test_check_eval_errors_1\n\t\ttester = TheRepl.new()\n\t\tassert_output(\"Line 4856: 4 elements in stack after evaluation\\n\") { tester.check_for_eval_errors(['1','2','3','4'], false, 4856) }\n\t\tassert_nil tester.check_for_eval_errors(['1','2','3','4'], false, 4856)\n\tend", "title": "" }, { "docid": "2d61a56eaa61882a3790c8bb6e70ea19", "score": "0.47051814", "text": "def add_globals env\n operators = [:+, :-, :*, :/, :>, :<, :>=, :<=]\n operators.each { |op| env[op.to_s] = lambda { |x,y| x.send op, y } }\n env.update( { 'equal?' => lambda { |x,y| x.equal? y},\n '=' => lambda { |x,y| x.equal? y },\n 'length' => lambda { |x| x.length },\n 'cons' => lambda { |elem, arr| arr.unshift elem },\n 'car' => lambda { |arr| arr.first },\n 'cdr' => lambda { |arr| arr.drop 1 },\n 'append' => lambda { |x, y| x + y },\n 'list' => lambda { |*x| Array.new x },\n 'list?' => lambda { |x| x.instance_of? Array },\n 'null?' => lambda { |x| x == [] },\n 'symbol?' => lambda { |x| x.instance_of? String } } )\n env\nend", "title": "" }, { "docid": "0327d87bb972136203963f51a781b9c7", "score": "0.4704119", "text": "def test_assign_is_true_for_a_symbol_with_assignment_on_the_end\n assert_equal( true, :one=.assign? )\n end", "title": "" }, { "docid": "ff205c440e0b1b2522c65a8fdc64dfe7", "score": "0.470389", "text": "def test_basic_global_scope\n action = \"$Symbols::names.add($id.text);\"\n expecting = \"((Symbols_scope)Symbols_stack.peek()).names.add((id!=null?id.getText():null));\"\n equeue = ErrorQueue.new\n ErrorManager.set_error_listener(equeue)\n g = Grammar.new(\"grammar t;\\n\" + \"scope Symbols {\\n\" + \" int n;\\n\" + \" List names;\\n\" + \"}\\n\" + \"a scope Symbols; : (id=ID ';' {\" + action + \"} )+\\n\" + \" ;\\n\" + \"ID : 'a';\\n\")\n antlr = new_tool\n generator = CodeGenerator.new(antlr, g, \"Java\")\n g.set_code_generator(generator)\n generator.gen_recognizer # forces load of templates\n translator = ActionTranslator.new(generator, \"a\", Antlr::CommonToken.new(ANTLRParser::ACTION, action), 1)\n raw_translation = translator.translate\n templates = StringTemplateGroup.new(\".\", AngleBracketTemplateLexer)\n action_st = StringTemplate.new(templates, raw_translation)\n found = action_st.to_s\n assert_equals(expecting, found)\n assert_equals(\"unexpected errors: \" + RJava.cast_to_string(equeue), 0, equeue.attr_errors.size)\n end", "title": "" }, { "docid": "ab25431b2cfedacb1a36f68ca541a0a0", "score": "0.4687564", "text": "def test_do_math_valid_variable\r\n @arg_checker.map[\"A\"] = 1\r\n input = [\"a\"]\r\n val=0\r\n assert_output(\"\") {val = @arg_checker.do_math(input)}\r\n assert_equal [1], @arg_checker.stack\r\n end", "title": "" }, { "docid": "3332aab9db2ce8d9fe27c04d2ff57933", "score": "0.4681964", "text": "def test_can_pass_out_inner_binding_from_function\n result = interpret 'defn foo(x) { binding()};b=foo(2);:b[x:]'\n assert_eq result, 2\n end", "title": "" } ]
3092b2fba60219aed7d59e27e262b205
Update a content partial content
[ { "docid": "2d6f36f6171c8dfeb89ee89659158968", "score": "0.8087959", "text": "def update_content_partial(id, data)\n put \"content_partials/#{id}\", data\n end", "title": "" } ]
[ { "docid": "d389fdc05adb9fc3f75812370c2a156f", "score": "0.74769706", "text": "def update_content(*args); end", "title": "" }, { "docid": "ac2acd13b2802d31218098a8b4de689b", "score": "0.7391196", "text": "def component_content_update\n obj_content = if params[:obj_content][:id].blank?\n ComponentContent.new\n else\n obj_content = ComponentContent.find_by_content_page_id_and_area_and_version(params[:obj_content][:content_page_id],params[:obj_content][:area],1)\n end\n b_success = obj_content.update_attributes(params[:obj_content])\n render :partial=>\"content/components/#{obj_content.component}/component_content\"\n end", "title": "" }, { "docid": "a91a8bc4e0b91301a55c757bcc1dd7fb", "score": "0.73516595", "text": "def update\n @content = Oktopartial::Content.find(params[:id])\n\n respond_to do |format|\n if @content.update_attributes(params[:content])\n flash[:notice] = 'Oktopartial::Content was successfully updated.'\n format.html { redirect_to(:action => :show, :id => @content.id) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @content.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a9db71b3ec38bdb56bf6c744fe9ee93f", "score": "0.7175184", "text": "def html_content_update\n obj_content = if params[:obj_content][:id].blank?\n HtmlContent.new(:language=>content_language)\n else\n obj_content = HtmlContent.find_or_initialize_by_content_page_id_and_area_and_language_and_version(params[:obj_content][:content_page_id],params[:obj_content][:area],content_language,1)\n end\n b_success = obj_content.update_attributes(params[:obj_content])\n render :text=>obj_content.content\n end", "title": "" }, { "docid": "2135dffca01d6aa12dcf9faed06b10ac", "score": "0.7019281", "text": "def update_content(new_content)\n #TODO VALIDATIONS\n # MAKE IT PRIVATE!\n # if new_content is not \"x\", \"r\",\"b\",\"B\"... then can't update\n set_content(new_content)\n end", "title": "" }, { "docid": "8bafefbdb23af2f7d6e25752eacf1660", "score": "0.69709337", "text": "def update!(**args)\n @content = args[:content] if args.key?(:content)\n end", "title": "" }, { "docid": "62262ba01616f5c24bd2593612f494f0", "score": "0.6844821", "text": "def update(contents)\n\n\t\t\t\t\t\t\t\t\n\n\n\tend", "title": "" }, { "docid": "0ebf35de7d4eb1ff2415c04589dd7057", "score": "0.6828252", "text": "def update\n @page.content = params[:content][:page_content][:value]\n @page.save!\n render :text => \"\"\n end", "title": "" }, { "docid": "72b9364c218848d466fb9acc8aaad91f", "score": "0.67841357", "text": "def update\n if params[:id] == 'multiple'\n @content_elements.each do |content_element|\n content_element.position = params[:content_element].index(content_element.id.to_s)\n content_element.save\n end\n render :nothing => true and return\n end\n if @content_element.update_attributes(params[:content_element])\n render :partial => 'show_' + @content_element.class.name.underscore.split('_').last, :object => @content_element\n else\n render :partial => 'edit_' + @content_element.class.name.underscore.split('_').last, :object => @content_element, :status => 409\n end\n end", "title": "" }, { "docid": "eed1e6cb98d6ac340319e4c79f84ef2f", "score": "0.6762514", "text": "def user_info\n render :update do |page| \n page.replace_html 'content' , :partial => 'user_info'\n end \n end", "title": "" }, { "docid": "d7d71c5980b46e4fb9d5af4cbfee110f", "score": "0.6739441", "text": "def modify\n @content = Content.find(params[:id])\n\n end", "title": "" }, { "docid": "bb43ebe8a91752d35be3eed19787dc9b", "score": "0.67174697", "text": "def update\n respond_to do |format|\n if @content.update(content_params)\n format.html { redirect_to contents_path, notice: \"Schlagwort #{@content.tag} wurde erfolgreich aktualisiert.\" }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @content.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "910b7b3c8953107dee1a7c83febeee52", "score": "0.66642016", "text": "def update\n case @element.content_type\n when 'TitleContent'\n @element.content.update(title_content_params)\n when 'TextContent'\n @element.content.update(text_content_params)\n when 'ImageContent'\n @element.content.update(image_content_params)\n when 'NavContent'\n #Placeholder for NavContent\n end\n\n respond_to do |format|\n case @element.content_type\n when 'TitleContent'\n if @element.content.update(title_content_params)\n bust_cache_on_update(@element)\n format.json { render action: 'show', status: :ok, location: api_page_element_url(params[:page_id], @element) }\n else\n format.json { render json: @element.errors, status: :unprocessable_entity }\n end\n when 'TextContent'\n if @element.content.update(text_content_params)\n bust_cache_on_update(@element)\n format.json { render action: 'show', status: :ok, location: api_page_element_url(params[:page_id], @element) }\n else\n format.json { render json: @element.errors, status: :unprocessable_entity }\n end\n when 'ImageContent'\n if @element.content.update(image_content_params)\n bust_cache_on_update(@element)\n format.json { render action: 'show', status: :ok, location: api_page_element_url(params[:page_id], @element) }\n else\n format.json { render json: @element.errors, status: :unprocessable_entity }\n end\n when 'NavContent'\n #Placeholder for updating NavContent\n else\n if @element.update(element_params)\n bust_cache_on_update(@element)\n format.json { head :no_content }\n else\n format.json { render json: @element.errors, status: :unprocessable_entity }\n end\n end\n\n\n end\n end", "title": "" }, { "docid": "e754f0f42150bf269207332e9dedbe54", "score": "0.6663604", "text": "def update_content name, content\n\n @content << {name: name, namespace: nil, attributes: [], content: [content].flatten}\n\n unless @main_element.nil?\n @main_element.update_content @name, self\n end\n\n end", "title": "" }, { "docid": "befc27ea9ee806db886d82916a537ca7", "score": "0.66623646", "text": "def mercury_update_about\n content = EditableContent.find_by name: 'about'\n content.content = params[:content][:about_content][:value]\n content.save!\n render text: ''\n end", "title": "" }, { "docid": "8c02780b0f0df3eaa847975cb96b4438", "score": "0.6637598", "text": "def update_with!(content, additional_headers = {}, &block)\n self.content = content\n update!(additional_headers, &block)\n end", "title": "" }, { "docid": "7524889ba09f86f61a486e1292072f9c", "score": "0.6618949", "text": "def update_resource_content\n resource_content\n end", "title": "" }, { "docid": "dee32231c3d5a7f145ffa36f98594de2", "score": "0.66121054", "text": "def login_infor\n render :update do |page| \n page.replace_html 'content' , :partial => 'login_infor'\n end \n end", "title": "" }, { "docid": "76234b48d38e7496e29ca1a1315155b7", "score": "0.65984577", "text": "def update\n\t\tself.setContent\n\t\treturn self\n\tend", "title": "" }, { "docid": "7fe3db440b675578be31612aacafdeb4", "score": "0.6555854", "text": "def update_contents(*args); end", "title": "" }, { "docid": "bfbb631f112773e50d79c1726e83faa9", "score": "0.6554073", "text": "def update\n respond_to do |format|\n @content = @slide.contents.first\n @content.body = slide_params[:mercury_content][:value]\n if @content.save\n format.html { redirect_to presentation_slide_url(@presentation, @slide), notice: 'Slide was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @slide.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bf63eedf62b225dba3e8a3e28e731a13", "score": "0.654853", "text": "def update\n respond_to do |format|\n if @content.update_attributes(params[:content])\n format.html { redirect_to collection_content_url(@content.collection_id, @content), notice: 'Content was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @content.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "559f82d8fc4aa480d2ec501388827131", "score": "0.65469307", "text": "def update\n respond_to do |format|\n if @o_single.update(url_content_params)\n format.html { redirect_to (is_admin? ? url_contents_url : root_url), notice: t(\"general.successfully_updated\") }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @o_single.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6b122038dfb982dd14f5e44b4965efcc", "score": "0.65441084", "text": "def update\n @page_content = PageContent.find(params[:id])\n\n @page_content.assign_attributes(params[:page_content])\n\n respond_to do |format|\n if @page_content.save\n format.html { redirect_to admin_page_content_path(@page_content), flash: {success: t('app.msgs.success_updated', :obj => t('mongoid.models.page_content.one'))} }\n format.json { head :no_content }\n else\n set_tabbed_translation_form_settings('advanced')\n format.html { render action: \"edit\" }\n format.json { render json: @page_content.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "672c055c71c0a201ae147023204bcbee", "score": "0.65178293", "text": "def update\n @content = Content.find(params[:id])\n\n respond_to do |format|\n if @content.update_attributes(params[:content])\n format.html { redirect_to @content, notice: 'Content 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: @content.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end", "title": "" }, { "docid": "c25246d4d904fefcf0a6119920dabcc5", "score": "0.6507394", "text": "def update\n super do\n render :update do |page|\n page[\"coberturas\"].replace_html :partial => \"tableros/index_modelo_barra\", \n :locals => {:modelo => \"cobertura\"}\n page[\"coberturas\"].visual_effect :appear\n page << \"Nifty('div#coberturas');\"\n end\n end\n end", "title": "" }, { "docid": "24dd96d7a7f0cae453ac51a32365f212", "score": "0.6503311", "text": "def update\n @admin_content = Content.find(params[:id])\n\n if @admin_content.update_attributes(params[:admin_content])\n params.keys.each do |k|\n set_params(k)\n end\n else\n flash[:notice] = t(\"admin.contents.update.notice_failure\")\n respond_with(@admin_content)\n end\n end", "title": "" }, { "docid": "81ca6fc11c486425672cd88e3460805f", "score": "0.6454799", "text": "def content=(new_content)\n self.content_part1 = new_content\n end", "title": "" }, { "docid": "2ef35faab48790f73412e329357598cf", "score": "0.6427597", "text": "def update\n respond_to do |format|\n if @content.update(content_params)\n format.html { redirect_to presentation_slide_content_path(@presentation, @slide, @content), notice: 'Content was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @content.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3e4f3b809f851f7d66d342f202bfc709", "score": "0.6415271", "text": "def update\n respond_to do |format|\n if @content.update(content_params)\n format.html { redirect_to :contents, notice: '内容修改成功。' }\n format.json { render :show, status: :ok, location: @content }\n else\n format.html { render :edit }\n format.json { render json: @content.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3923df598020c4dd9c9310f32cbc26c8", "score": "0.64114374", "text": "def update\n @content = Content.find(params[:id])\n\n respond_to do |format|\n if @content.update_attributes(params[:content])\n notify :notice, 'Content was successfully updated.'\n format.html { redirect_to content_url(@content) }\n format.xml { head :ok }\n format.js #\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @content.errors.to_xml }\n end\n end\n end", "title": "" }, { "docid": "ae4ba2d172bf79cb8d9c8cbd8306ca29", "score": "0.6398814", "text": "def edit\n\n @content = acquire_content_object\n\n end", "title": "" }, { "docid": "be62f9c96c29c83882e360109eb3cce8", "score": "0.63896024", "text": "def update\n @content = Content.find(params[:id])\n\n respond_to do |format|\n if @content.update_attributes(params[:content])\n format.html { redirect_to @content.course, notice: 'Content was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @content.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3a54ac4b3f20db3ff23d411ae55c02f6", "score": "0.63770425", "text": "def edit \n @content = {}\n @blog_post.blog_post_contents.each do |content|\n @content[content.id] = content.contentable\n end\n render :update do |page|\n page[\"sub-content\"].replace_html :partial => \"edit\"\n page << \"#{raw_tiny_mce_init(taz_tiny_mce_options)}\"\n end \n end", "title": "" }, { "docid": "27a306cecbb862a4eed7e5da154f5aa0", "score": "0.63743454", "text": "def update (raw_content)\n @content = raw_content\n self.parse\n end", "title": "" }, { "docid": "536c8e4de0355f66d2852bd3450905db", "score": "0.6363937", "text": "def update_all\n Oktopartial::Content.update_all\n redirect_to :action => :index\n end", "title": "" }, { "docid": "456c3f23ebf34d9c0226ebc22a3a0e2a", "score": "0.63637966", "text": "def update\n respond_to do |format|\n if @page_content.update(page_content_params)\n format.html { redirect_to [:admin,@page_content], notice: t('shared.msgs.success_updated',\n obj: t('activerecord.models.page_content', count: 1))}\n else\n format.html { render :edit }\n end\n end\n end", "title": "" }, { "docid": "10ad2328f259a9fb79b81ee739be92e4", "score": "0.6359832", "text": "def update\n respond_to do |format|\n if @content.update(content_params)\n format.html { redirect_to @content, notice: 'Content was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @content.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "10ad2328f259a9fb79b81ee739be92e4", "score": "0.6359832", "text": "def update\n respond_to do |format|\n if @content.update(content_params)\n format.html { redirect_to @content, notice: 'Content was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @content.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "10ad2328f259a9fb79b81ee739be92e4", "score": "0.6359832", "text": "def update\n respond_to do |format|\n if @content.update(content_params)\n format.html { redirect_to @content, notice: 'Content was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @content.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "10ad2328f259a9fb79b81ee739be92e4", "score": "0.6359832", "text": "def update\n respond_to do |format|\n if @content.update(content_params)\n format.html { redirect_to @content, notice: 'Content was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @content.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "56c8bc9fcceb616ba59b1b1b4413d8f9", "score": "0.6356904", "text": "def set_content(new_content)\r\n self.content = new_content\r\n return self\r\n end", "title": "" }, { "docid": "bd8d6e30c1580c9c2c4e77c7b564a907", "score": "0.6354907", "text": "def update\n @content = Content.find(params[:id])\n\n respond_to do |format|\n if @content.update_attributes(params[:content])\n format.html { redirect_to @content, notice: 'Content was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @content.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f2a1a1ad19d6b560ec5bd3be6d60d09c", "score": "0.6350329", "text": "def update\n @content_block = ContentBlock.where(:id=>params[:id]).first()\n @page_title = \"Edit Content Block\"\n @admin_section = true\n respond_to do |format|\n if @content_block.update_attributes(params[:content_block])\n format.html { redirect_to(content_blocks_url, :notice => 'Content block was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @content_block.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aa12269eb21219123ca975788fd2e016", "score": "0.6349079", "text": "def content=(new_content)\n @edited = true\n @structure[:content] = new_content\n end", "title": "" }, { "docid": "5ea81aa5d2e70e6e980580b3f018305a", "score": "0.6349004", "text": "def update_items\n [ :content ]\n end", "title": "" }, { "docid": "5ea81aa5d2e70e6e980580b3f018305a", "score": "0.6349004", "text": "def update_items\n [ :content ]\n end", "title": "" }, { "docid": "f86a3ed9067bd7d99323b14b035ac068", "score": "0.63451564", "text": "def edit_content(content_id, payload)\n put(url_(\"content\", content_id), payload)\n end", "title": "" }, { "docid": "1f6079120b8c7f8adc6860828993f34e", "score": "0.63431776", "text": "def update\n @admin_content = AdminContent.find(params[:id])\n\n respond_to do |format|\n if @admin_content.update_attributes(params[:admin_content])\n format.html { redirect_to @admin_content, notice: 'Admin content was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_content.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c031748db070ea8af57362767ad5eb25", "score": "0.6341499", "text": "def update\n @element = Humpyard::Element.find(params[:id])\n if @element\n unless can? :update, @element\n render :json => {\n :status => :failed\n }, :status => 403\n return\n end\n \n if @element.content_data.update_attributes params[:element]\n render :json => {\n :status => :ok,\n :dialog => :close,\n :replace => [\n { \n :element => \"hy-id-#{@element.id}\",\n :url => humpyard_element_path(@element)\n }\n ]\n }\n else\n render :json => {\n :status => :failed, \n :errors => @element.content_data.errors\n }\n end\n else\n render :json => {\n :status => :failed\n }, :status => 404\n end\n end", "title": "" }, { "docid": "61f166a37e27f2cf414817853b9c89cb", "score": "0.634034", "text": "def update_sectemplate\n @sectiontemplates=Admin::Sectiontemplate.find(:all,:conditions=>['ExamTemplate_Id='+params[:tempid]],:select=>'SectionTitle,SectionTemplate_Id')\n render :update do |page|\n page.replace_html \"sectiontemp\" ,:partial => 'sectemp_by_examtemp',:object=>@sectiontemplates,:layout=>false\n end\n end", "title": "" }, { "docid": "db1285431b81d2f96bc83f3fa9f737ca", "score": "0.6337058", "text": "def update_content(content)\n\t\tself.chapter.content = content\n\t\tchapter.save\n\tend", "title": "" }, { "docid": "78ab29101943bb4cb94e3f92b26460c9", "score": "0.6333869", "text": "def update\n respond_to do |format|\n if @my_content.update(my_content_params)\n format.html { redirect_to @my_content, notice: 'My content was successfully updated.' }\n format.json { render :show, status: :ok, location: @my_content }\n else\n format.html { render :edit }\n format.json { render json: @my_content.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b51bacf146970230dea8956afaae0434", "score": "0.631777", "text": "def update\n edit()\n\n if @content.update(content_params)\n redirect_to content_path(@content.course_id), notice: \"Content has been updated successfully.\"\n\n else\n render :edit\n end\n end", "title": "" }, { "docid": "efde2e82b3adcb57d609882021e293ba", "score": "0.62963784", "text": "def update\n @block = Block.find(params[:id])\n @page = @block.page\n @section = @page.section\n \n unless params[:block][:block_contents_attributes].blank?\n params[:block][:block_contents_attributes].delete_if do |k,v|\n v[:do_add] == \"0\"\n end\n end\n \n respond_to do |format|\n if @block.update_attributes(params[:block])\n flash[:notice] = 'Block was successfully updated.'\n format.html { redirect_to([@section,@page]) }\n format.js do \n if @block.parent.blank?\n render_block = @block\n else\n render_block = @block.parent\n end\n render :partial => \"pages/block\", :locals => { :block => render_block }\n end\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.js { render :action => \"edit\" }\n format.xml { render :xml => @block.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2225ea0683755fa4fb0e89b8750ac0a9", "score": "0.62926435", "text": "def update\n @content = Content.find(params[:id])\n if @content.update_attributes(content_params)\n redirect_to content_path, :notice =>\"Your content has been updated\"\n else\n render \"edit\"\n end\n end", "title": "" }, { "docid": "5b505c763e2cd25934f5708eff02c9cd", "score": "0.62862486", "text": "def update\n respond_to do |format|\n if @content.update(update_params)\n format.html { redirect_to @content, notice: 'Content was successfully updated.' }\n format.json { render :show, status: :ok, location: @content }\n else\n format.html { render :edit }\n format.json { render json: @content.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bc758a591934fb33bd632aa9c50557ae", "score": "0.62831634", "text": "def update\n respond_to do |format|\n if @content.update(content_params)\n @content.update(url: @content.url+'/') unless @content.url.end_with?('/')\n format.html { redirect_to @content, notice: 'Сведения о файле сохранены.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @content.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0cce4dcbca6943ae53bb8015f7c6b42a", "score": "0.6282715", "text": "def content=(new_content)\r\n @content = new_content\r\n touch()\r\n return new_content\r\n end", "title": "" }, { "docid": "3820b4aed65ccf7958074636898120ee", "score": "0.6279444", "text": "def update\n respond_to do |format|\n if @content.update(content_params)\n format.html { redirect_to @content, notice: 'content was successfully updated.' }\n format.json { render :show, status: :ok, location: @content }\n else\n format.html { render :edit }\n format.json { render json: @content.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fe50ec080bef817aaa832ab8cb49896d", "score": "0.6278431", "text": "def setContent(content)\r\n\t\t\t\t\t@content = content\r\n\t\t\t\tend", "title": "" }, { "docid": "3bdf49ba28410de33f4eae85322011c3", "score": "0.62779206", "text": "def update\n @content_block = ContentBlock.find(params[:id])\n\n respond_to do |format|\n if @content_block.update_attributes(params[:content_block])\n format.html { redirect_to @content_block, notice: 'Content block was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @content_block.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4e085976e5be60c56054754be9266d91", "score": "0.6276538", "text": "def update\n respond_to do |format|\n if @customized_content.update(customized_content_params)\n format.html {redirect_to @customized_content, notice: 'Customized content was successfully updated.'}\n format.json {render :show, status: :ok, location: @customized_content}\n else\n format.html {render :edit}\n format.json {render json: @customized_content.errors, status: :unprocessable_entity}\n end\n end\n end", "title": "" }, { "docid": "10b8f7b4c3a53b9ed8f8010c47ccd1e3", "score": "0.6275953", "text": "def update\n @content = Content.find(params[:id])\n\n respond_to do |format|\n if @content.update_attributes(params[:content])\n format.html { redirect_to @content, notice: 'Content was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @content.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "10b8f7b4c3a53b9ed8f8010c47ccd1e3", "score": "0.6275953", "text": "def update\n @content = Content.find(params[:id])\n\n respond_to do |format|\n if @content.update_attributes(params[:content])\n format.html { redirect_to @content, notice: 'Content was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @content.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d9598d94301750212c1038116e38a4e4", "score": "0.62681663", "text": "def update\n @content_page = @section.content_pages.find(params[:id])\n\n respond_to do |format|\n if @content_page.update_attributes(params[:content_page])\n flash[:notice] = 'Page was successfully updated.'\n format.html { redirect_to learning_module_section_content_page_path(@learning_module, @section, @content_page) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @content_page.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "27eb8304a170a25adb357c6aeef6a029", "score": "0.62631035", "text": "def update\n @raw_html = RawHtml.find(params[:id])\n @page_section = @raw_html.page_section\n @page = @page_section.page\n @site_section = @page.site_section\n\n respond_to do |format|\n if @raw_html.update_attributes(params[:raw_html]) and @page_section.update_attributes(params[:page_section])\n flash[:notice] = 'RawHtml was successfully updated.'\n format.html { redirect_to site_section_page_url(@site_section, @page) }\n format.js { render :partial => \"page_sections/show\", :object => @page_section }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.js { render :action => \"edit\" }\n format.xml { render :xml => @raw_html.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a27ea75b5b7da15c5942518cac1b18f1", "score": "0.6255208", "text": "def update\n @content = Content.find(params[:id])\n\n if @content.update_attributes(content_params)\n head :no_content\n else\n render json: @content.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "1f3a06cc77349449a0a9dd83dbe5c86d", "score": "0.6250033", "text": "def update\n @article = Article.find(params[:id])\n params[:article][:content] = tag_content(params[:article][:content], false)\n respond_to do |format|\n if @article.update_attributes(params[:article])\n format.html { redirect_to @article, notice: 'Article was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @article.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "18c93bd7e2151e9791fd8c4f86467c8a", "score": "0.6235073", "text": "def update_content_text(content_item_id, content, user_id) \n puts \"id = #{content_item_id}, user id = #{user_id} content= #{content}\"\n content_item = ContentItem.find(content_item_id)\n content_item.content = content\n content_item.updated_by = User.find(user_id)\n content_item.save\n puts \"content item saved!!\"\n puts \"content = #{content_item.content}\"\n search_service = SearchService.new\n search_service.add_content_item content_item\n end", "title": "" }, { "docid": "76c6ccf04a3cebd4b0dcfa02f5e3a150", "score": "0.62349874", "text": "def update_content(id, type_id, units, options = {})\n update_units(id, generate_content(type_id, units, options), options)\n end", "title": "" }, { "docid": "76c6ccf04a3cebd4b0dcfa02f5e3a150", "score": "0.62349874", "text": "def update_content(id, type_id, units, options = {})\n update_units(id, generate_content(type_id, units, options), options)\n end", "title": "" }, { "docid": "497389ef4fec6a0555fea2f21e42f07a", "score": "0.6231544", "text": "def update\n respond_to do |format|\n if @content.update(content_params)\n format.html { redirect_to @content, notice: 'Content was successfully updated.' }\n format.json { render :show, status: :ok, location: @content }\n else\n format.html { render :edit }\n format.json { render json: @content.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "497389ef4fec6a0555fea2f21e42f07a", "score": "0.6231544", "text": "def update\n respond_to do |format|\n if @content.update(content_params)\n format.html { redirect_to @content, notice: 'Content was successfully updated.' }\n format.json { render :show, status: :ok, location: @content }\n else\n format.html { render :edit }\n format.json { render json: @content.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "497389ef4fec6a0555fea2f21e42f07a", "score": "0.6231544", "text": "def update\n respond_to do |format|\n if @content.update(content_params)\n format.html { redirect_to @content, notice: 'Content was successfully updated.' }\n format.json { render :show, status: :ok, location: @content }\n else\n format.html { render :edit }\n format.json { render json: @content.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "22842055d9948367e5fc8f23d8db269c", "score": "0.62262034", "text": "def update_page(page, content)\n path = create_path page\n $LOG.verbose \"Updating page with content '#{page.output_path}'\" if $LOG.verbose?\n payload = create_payload page, content\n patch path, payload\n end", "title": "" }, { "docid": "27d1f685b4f3846a707b4b49a1636f12", "score": "0.6217214", "text": "def update_partial\n\n get_user = User.find(session[:current_user])\n\n if !get_user.blank? || get_user.user_type_id == 3\n object = Timetable.find_by_class_id(get_user.class_id) rescue nil\n if object.blank?\n object = Timetable.new\n object.class_id = get_user.class_id\n object.timetable_content = params[:content]\n object.save!\n else\n object = Timetable.find_by_class_id(get_user.class_id) rescue nil\n object.timetable_content = params[:content]\n object.save!\n end\n else\n redirect_to :action => \"login\"\n end\n return true\n end", "title": "" }, { "docid": "ff78143fbc4d764b8107dc990c7e45c8", "score": "0.6214111", "text": "def update\n @content = Content.find(params[:id])\n\n respond_to do |format|\n if @content.update_attributes(params[:content])\n flash[:notice] = 'Content was successfully updated.'\n format.html { redirect_to @content }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @content.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7ca02886577ac10b1a61af6f314fe8e8", "score": "0.6211951", "text": "def update\n if @content_element.update_attributes(params[:content_element])\n respond_to do |format|\n format.json { render :json => @content_element }\n format.xml { render :xml => @content_element }\n end\n else\n respond_to do |format|\n format.json { raise Palani::Api::InvalidUpdateOfRecordJSONException }\n format.xml { raise Palani::Api::InvalidUpdateOfRecordXMLException }\n end\n end\n end", "title": "" }, { "docid": "e79b5c7a362f2123117f821b337bb789", "score": "0.62119013", "text": "def update!(**args)\n @content = args[:content] if args.key?(:content)\n @object_type = args[:object_type] if args.key?(:object_type)\n @original_content = args[:original_content] if args.key?(:original_content)\n end", "title": "" }, { "docid": "c7db81640324ba143918747c98788f44", "score": "0.6210785", "text": "def update\n if is_admin_user?\n @content = Content.find_by_id(params[:id])\n #@content = Content.where(\"id = ?\",params[:id])\n #@content = Content.find_by_url(\"no-path\")\n \n respond_to do |format|\n if @content.update_attributes(params[:content])\n format.html { redirect_to '/' + params[:content][:url], notice: \"Content successfully updated\" }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @content.errors, status: :unprocessable_entity }\n end\n end\n else\n respond_to do |format|\n format.html { redirect_to \"/\" }\n end\n end\n end", "title": "" }, { "docid": "6cdda138efaf618bfb76adced94100f4", "score": "0.6201041", "text": "def update\n respond_to do |format|\n if @cl_content.update(cl_content_params)\n format.html { redirect_to @cl_content, notice: 'Content was successfully updated.' }\n format.json { render :show, status: :ok, location: @cl_content }\n else\n format.html { render :edit }\n format.json { render json: @cl_content.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "48f5449044653179fa479c4059ca6903", "score": "0.61971635", "text": "def set_content\n @content = Content.find(params[:id])\n end", "title": "" }, { "docid": "48f5449044653179fa479c4059ca6903", "score": "0.61971635", "text": "def set_content\n @content = Content.find(params[:id])\n end", "title": "" }, { "docid": "48f5449044653179fa479c4059ca6903", "score": "0.61971635", "text": "def set_content\n @content = Content.find(params[:id])\n end", "title": "" }, { "docid": "48f5449044653179fa479c4059ca6903", "score": "0.61971635", "text": "def set_content\n @content = Content.find(params[:id])\n end", "title": "" }, { "docid": "48f5449044653179fa479c4059ca6903", "score": "0.61971635", "text": "def set_content\n @content = Content.find(params[:id])\n end", "title": "" }, { "docid": "48f5449044653179fa479c4059ca6903", "score": "0.61971635", "text": "def set_content\n @content = Content.find(params[:id])\n end", "title": "" }, { "docid": "48f5449044653179fa479c4059ca6903", "score": "0.61971635", "text": "def set_content\n @content = Content.find(params[:id])\n end", "title": "" }, { "docid": "48f5449044653179fa479c4059ca6903", "score": "0.61971635", "text": "def set_content\n @content = Content.find(params[:id])\n end", "title": "" }, { "docid": "48f5449044653179fa479c4059ca6903", "score": "0.61971635", "text": "def set_content\n @content = Content.find(params[:id])\n end", "title": "" }, { "docid": "48f5449044653179fa479c4059ca6903", "score": "0.61971635", "text": "def set_content\n @content = Content.find(params[:id])\n end", "title": "" }, { "docid": "48f5449044653179fa479c4059ca6903", "score": "0.61971635", "text": "def set_content\n @content = Content.find(params[:id])\n end", "title": "" }, { "docid": "48f5449044653179fa479c4059ca6903", "score": "0.61971635", "text": "def set_content\n @content = Content.find(params[:id])\n end", "title": "" }, { "docid": "48f5449044653179fa479c4059ca6903", "score": "0.61971635", "text": "def set_content\n @content = Content.find(params[:id])\n end", "title": "" }, { "docid": "48f5449044653179fa479c4059ca6903", "score": "0.61971635", "text": "def set_content\n @content = Content.find(params[:id])\n end", "title": "" }, { "docid": "48f5449044653179fa479c4059ca6903", "score": "0.61971635", "text": "def set_content\n @content = Content.find(params[:id])\n end", "title": "" }, { "docid": "48f5449044653179fa479c4059ca6903", "score": "0.61971635", "text": "def set_content\n @content = Content.find(params[:id])\n end", "title": "" }, { "docid": "48f5449044653179fa479c4059ca6903", "score": "0.61971635", "text": "def set_content\n @content = Content.find(params[:id])\n end", "title": "" }, { "docid": "48f5449044653179fa479c4059ca6903", "score": "0.61971635", "text": "def set_content\n @content = Content.find(params[:id])\n end", "title": "" } ]
678a9182b40ee594c61cfac39aead5e9
Sets the allowFormatColumns property value. Represents the worksheet protection option of allowing formatting columns.
[ { "docid": "2fd9864784d673963318f3a2220d27e1", "score": "0.7967862", "text": "def allow_format_columns=(value)\n @allow_format_columns = value\n end", "title": "" } ]
[ { "docid": "e941206cd60c75f3604b1a8e247fdf15", "score": "0.7059938", "text": "def allow_format_columns\n return @allow_format_columns\n end", "title": "" }, { "docid": "4509848578a35b9dc7b73f209782d02d", "score": "0.6725619", "text": "def allow_format_cells=(value)\n @allow_format_cells = value\n end", "title": "" }, { "docid": "baf6a5522dc377041ac53e2cd4bbdbd8", "score": "0.6113125", "text": "def allow_format_cells\n return @allow_format_cells\n end", "title": "" }, { "docid": "7a0d3aabedfaed096dc8d7bfceff7325", "score": "0.60402656", "text": "def allow_delete_columns=(value)\n @allow_delete_columns = value\n end", "title": "" }, { "docid": "909bbca9ecb26474a4f35b71e3895b51", "score": "0.58258027", "text": "def set_allowed_columns(*cols)\n @allowed_columns = cols\n end", "title": "" }, { "docid": "76e771be7715ba784beb921d44384996", "score": "0.57216585", "text": "def formatting=(headers)\n @col_opts[:formatting] = headers\n end", "title": "" }, { "docid": "6cd61419135472e27ad0bb8587d622fe", "score": "0.5605324", "text": "def allow_format_rows=(value)\n @allow_format_rows = value\n end", "title": "" }, { "docid": "815b817c0bf5f2a540e2758f21f600cc", "score": "0.55312026", "text": "def allow_insert_columns=(value)\n @allow_insert_columns = value\n end", "title": "" }, { "docid": "845e90468d091d95f11e1bb7449c21de", "score": "0.5352192", "text": "def set_restricted_columns(*cols)\n @restricted_columns = cols\n end", "title": "" }, { "docid": "a400718dbbeb19ca8573f931b9a49a77", "score": "0.51387906", "text": "def column_widths(*args)\n args.each_with_index do |value, index|\n raise ArgumentError, \"Invalid column specification\" unless index < @auto_fit_data.size\n Axlsx::validate_unsigned_numeric(value) unless value == nil\n @auto_fit_data[index][:fixed] = value\n end\n end", "title": "" }, { "docid": "c0a878c326d62a1c3a34865cff99ed66", "score": "0.508434", "text": "def allow_format_rows\n return @allow_format_rows\n end", "title": "" }, { "docid": "5c5c4d425a5dd28cea301cfea9a9466e", "score": "0.5002903", "text": "def set_columns(formats, col_sep=' ', auto=true)\n self << Columns.new(formats, col_sep, auto)\n end", "title": "" }, { "docid": "5f92c803a9631273e6cc0c9718a5e7bb", "score": "0.4996739", "text": "def set_columns(column_types, column_names = [])\n @columns = Column.set(@columns, column_types, column_names, @options)\n @options[:column_overflow] = true if @options[:column_overflow].nil?\n @options[:column_underflow] = true if @options[:column_underflow].nil?\n end", "title": "" }, { "docid": "6087cf247f5ab7c3d4cd0728a300a123", "score": "0.4941079", "text": "def allow_delete_columns\n return @allow_delete_columns\n end", "title": "" }, { "docid": "1305405f12ab4fd59bc10c7adec3c057", "score": "0.48970926", "text": "def formatting\n @col_opts[:formatting]\n end", "title": "" }, { "docid": "baaaf78e8c84236aceeb8237079a2a97", "score": "0.4888961", "text": "def whitelist\n @columns = []\n end", "title": "" }, { "docid": "358d4080177b354b7cabbee4201170e0", "score": "0.48743504", "text": "def freeze\n @allowed_columns.freeze\n super\n end", "title": "" }, { "docid": "70164c85bae1d41b7f69ed24b22831ab", "score": "0.48665306", "text": "def set_columns_visible(value)\n self.write_attribute :columns, value.to_json\n end", "title": "" }, { "docid": "8ab2d2e61d04f7ebdbb55a7215351862", "score": "0.48561838", "text": "def validate_exportable_columns(columns)\n unless columns.is_a?(Array)\n raise SpotlightSearch::Exceptions::InvalidValue.new('Expected Array. Invalid type received')\n end\n unless (self.enabled_columns & columns.map(&:to_sym)) == columns.size\n return false\n end\n return true\n end", "title": "" }, { "docid": "aac8d7578036ce1517c12df0209e551c", "score": "0.4851761", "text": "def set_column_widths\n column_widths.each_with_index do |w, col_num|\n column(col_num).width = w\n end\n end", "title": "" }, { "docid": "810a28edf75229cf457ff5a7badcc713", "score": "0.47975758", "text": "def column_format(method, options = {})\n options[:formatter] = procify(options[:formatter]) if options[:formatter] && options[:formatter].is_a?(Symbol)\n @attr_formats = (@attr_formats || default_formats).deep_merge({method.to_s => options})\n end", "title": "" }, { "docid": "92b4fbfbeab0d9654f2f91d8d612cd70", "score": "0.4790096", "text": "def set_restricted(hash, only, except)\n columns_not_set = [nil, false, \"\", [], {}].include?(model.instance_variable_get(:@columns))\n meths = setter_methods(only, except)\n strict = strict_param_setting\n hash.each do |k,v|\n m = \"#{k}=\"\n if meths.include?(m)\n send(m, v)\n elsif columns_not_set && (Symbol === k)\n Deprecation.deprecate('Calling Model#set_restricted for a column without a setter method when the model class does not have any columns', 'Use Model#[] for these columns')\n self[k] = v\n elsif strict\n raise Error, \"method #{m} doesn't exist or access is restricted to it\"\n end\n end\n self\n end", "title": "" }, { "docid": "68dd847b83941d67e66d636e26bb8732", "score": "0.4751734", "text": "def allow(*fields)\n expand_schema(\"allow\",*fields)\n end", "title": "" }, { "docid": "55816d2245e721566fa80e0f14f78846", "score": "0.47471836", "text": "def ensure_columns_are_filterable! columns\n columns.each do |col|\n raise \"Unable to filter #{self} on column '#{col}'\" unless filter_type( col )\n end\n end", "title": "" }, { "docid": "60131883275c37aa279600c8ac702bba", "score": "0.46978462", "text": "def set_column_widths cw\n raise \"Cannot call set_column_widths till table set\" unless @table_column_model\n tcm = @table_column_model\n tcm.each_with_index do |col, ix|\n col.width cw[ix]\n end\n table_structure_changed(nil)\n end", "title": "" }, { "docid": "938dedded3bda8f06893a0af9596c877", "score": "0.46974275", "text": "def set_columns(formats, col_sep=' ')\n self << Columns.new(formats, col_sep)\n end", "title": "" }, { "docid": "493de6c50c924950a6b31b7d7dee606d", "score": "0.46969986", "text": "def columns=(array)\n @col_opts[:columns] = array\n end", "title": "" }, { "docid": "747f64f9f1aca00805d9e1d71081b29e", "score": "0.469011", "text": "def allow_insert_columns\n return @allow_insert_columns\n end", "title": "" }, { "docid": "582bba2ad478db117e5ebb5e28f27b59", "score": "0.46628988", "text": "def freeze\n @restricted_columns.freeze\n\n super\n end", "title": "" }, { "docid": "4877b042cbc43e238f270dd7363e0e1c", "score": "0.46570435", "text": "def validate_exportable_columns(columns)\n unless columns.is_a? Array\n raise SpotlightSearch::Exceptions::InvalidValue, 'Expected Array. Invalid type received'\n end\n (columns & SpotlightSearch::Utils.serialize_csv_columns(*enabled_columns)).size == columns.size # returns true if all columns are valid\n end", "title": "" }, { "docid": "8a47eb296c45e7386a90c8e22c269f0d", "score": "0.46495405", "text": "def format_style=(fs)\n raise ArgumentError, \"Invalid value provided for format_style.\" if ((fs < LEFT_ALIGN) || (fs > JUSTIFY))\n @format_style = fs\n end", "title": "" }, { "docid": "b81742df868c02bbff29ddccb14425c7", "score": "0.4647386", "text": "def set_grid_columns(columns)\n TSApi.tsapi_setDefinedColumns(columns)\n end", "title": "" }, { "docid": "3b3d66839289482301e75e96350b435a", "score": "0.46152762", "text": "def set_field_types_from_columns(force: nil)\n return unless Admin::MigrationGenerator.table_or_view_exists? table_name\n\n # Ensure the new options have reloaded\n option_configs\n return if !force && db_columns.present?\n\n dbc = {}\n table_columns.each do |col|\n dbc[col.name.to_s] = {\n type: col.type.to_s\n }\n dbc[col.name.to_s][:array] = true if col.array?\n end\n\n return if dbc.empty?\n\n hash = { '_db_columns' => dbc }\n prepend_to_options(hash)\n end", "title": "" }, { "docid": "db20cff01ba2fc3d2c8eebaff15683ca", "score": "0.46146956", "text": "def set_initial_columns( columns = nil )\n if columns.nil?\n if @opts[:header] == false\n columns = (0...csv_column_count).map{ |i| :\"col#{i}\" }\n else\n columns = fetch_csv_headers.map{ |name| self.class.getter_name( name ) }\n end\n else\n unless !@csv || columns.length == csv_column_count\n $stderr.puts \"Warning <#{@spreadsheet_file}>: columns array does not match the number of columns in the spreadsheet.\" \n compare_columns_to_headers\n end\n end\n \n for column in columns\n raise \"#{column} is in the list FORBIDDEN_COLUMN_NAMES\" if FORBIDDEN_COLUMN_NAMES.include?(column)\n end\n \n @columns = columns\n end", "title": "" }, { "docid": "7ce903d82fc8c4fde475706bf6bb75da", "score": "0.45972294", "text": "def columns_allowed\n columns_default + ['description','created_at','updated_at']\n end", "title": "" }, { "docid": "bcc28d0bbc5dee0b6196fb6a0657229f", "score": "0.4595192", "text": "def enable\n update_columns(\n disabled_by_id: nil,\n disabled_at: nil,\n disabled_reason: nil,\n enabled: true\n )\n end", "title": "" }, { "docid": "b3081bed89b01684169cda93c58472b0", "score": "0.45871565", "text": "def get_setter_methods\n if allowed_columns\n allowed_columns.map{|x| \"#{x}=\"}\n else\n super\n end\n end", "title": "" }, { "docid": "f55d41fd3a4f427d6833bf6b721158ea", "score": "0.4567791", "text": "def disallowed_behavior=(disallowed_behavior)\n set_option(:disallowed_behavior, disallowed_behavior)\n end", "title": "" }, { "docid": "a7dd92cf0bc6b920f448c6b30514239a", "score": "0.45645842", "text": "def disable_format_for *matchers\n return if mounted?\n (@__e__disable_formats_for ||= []).concat matchers\n end", "title": "" }, { "docid": "ae7f845faa3d986a9b0e84bdd4362a7f", "score": "0.45423487", "text": "def allow(*args)\n response.headers['Allow'] = args.flatten.map { |m| m.to_s.upcase }.join(',')\n end", "title": "" }, { "docid": "bb6160863ba64332bff618d41d79167c", "score": "0.45358077", "text": "def disable_format_for *matchers\n return if mounted?\n (@disable_formats_for ||= []).concat matchers\n end", "title": "" }, { "docid": "4eb5cecd63ff4095dc8d6baad1fcc3d4", "score": "0.45185825", "text": "def allowed_cols\n return @allowed_cols if defined?(@allowed_cols)\n @allowed_cols ||= begin\n infi = Float::INFINITY\n size = IO.console&.winsize&.last\n size = size || infi\n size / 6\n end\n end", "title": "" }, { "docid": "6413b1d4ded03b7f4d2df6c741c43dce", "score": "0.450256", "text": "def columns=(value)\n @columns = value\n end", "title": "" }, { "docid": "6413b1d4ded03b7f4d2df6c741c43dce", "score": "0.450256", "text": "def columns=(value)\n @columns = value\n end", "title": "" }, { "docid": "6413b1d4ded03b7f4d2df6c741c43dce", "score": "0.450256", "text": "def columns=(value)\n @columns = value\n end", "title": "" }, { "docid": "c31ed0ef4f6f3e92bc5562ba9ebc6234", "score": "0.45015997", "text": "def disallowed_warnings=(disallowed_warnings)\n set_option(:disallowed_warnings, disallowed_warnings)\n end", "title": "" }, { "docid": "a7932f260c0a46ad782bb5f0a5c7c482", "score": "0.44934654", "text": "def write(columns, format_opts = nil)\n @current_sheet.write(columns, format(format_opts))\n end", "title": "" }, { "docid": "cedc4650029b3a4d2b625216af08e2b0", "score": "0.44829807", "text": "def content_columns_with_security\n content_columns_without_security.reject { |c|\n not displayable?(c.name)\n }\n end", "title": "" }, { "docid": "acb10c8a83b75869c616d6d6298dd25f", "score": "0.44764465", "text": "def available_columns\n column_options.reject{|column| viable_report_columns.map(&:column_name).include? column.name.to_s}\n end", "title": "" }, { "docid": "17e2c26f491ab94283db94427995a49e", "score": "0.44741327", "text": "def sanitize_columns(table_name: name, **options)\n self.class.sanitize_columns(table_name, column_sanitization_version, options)\n end", "title": "" }, { "docid": "cfc31e429041ff1f5d6cf882662cdaff", "score": "0.4449908", "text": "def enable_mailings!\n self.update_columns mailings: 'enabled' unless mailings == 'force_disabled'\n end", "title": "" }, { "docid": "8686ed2d97eddc612cb79f7c20724603", "score": "0.44168317", "text": "def requested_columns=(columns)\n raise InvalidColumnsAmountError unless valid_dimension_range.include?(columns)\n @columns = columns\n end", "title": "" }, { "docid": "3d673871f1697448af520fbc9d0539d5", "score": "0.4407352", "text": "def allowed_member_types=(value)\n @allowed_member_types = value\n end", "title": "" }, { "docid": "601c0f0b12a7bd664809a49655416242", "score": "0.43737903", "text": "def prepare_column_options(column, types)\n spec = super\n spec[:array] = 'true' if column.respond_to?(:array) && column.array\n spec\n end", "title": "" }, { "docid": "81c443c5d32eef5f563dca61d9c923e9", "score": "0.4350313", "text": "def to_safe_format!\n sheets &:to_safe_format!\n self\n end", "title": "" }, { "docid": "ef685c19bf96ac05d2b4690e5867a584", "score": "0.4333124", "text": "def allow_settings(settings)\n @allowed_settings = Array(settings)\n end", "title": "" }, { "docid": "410a796af614ec96e2c46b6b7f939379", "score": "0.43246496", "text": "def prepare_column_options(column, types) # :nodoc:\n spec = super\n spec[:array] = 'true' if column.respond_to?(:array) && column.array\n spec\n end", "title": "" }, { "docid": "7c2b46046c7314c5a2ef44819f5718c3", "score": "0.431522", "text": "def allowable_change_fields(options={:include_control_column => true})\n attrs = definition.fields_allowed_for_value(current_control_value)\n attrs.delete(definition.control_by) unless options[:include_control_column] == true\n attrs\n end", "title": "" }, { "docid": "1046b24f4bc637f0d32fda72c1a80d64", "score": "0.43009305", "text": "def format_column idx, format=nil, opts={}\n opts[:worksheet] = self\n res = case idx\n when Integer\n column = nil\n if format\n column = Column.new(idx, format, opts)\n end\n @columns[idx] = column\n else\n idx.collect do |col| format_column col, format, opts end\n end\n shorten @columns\n res\n end", "title": "" }, { "docid": "4c151fbd0a3db554d91fbe5efb3306a1", "score": "0.4298899", "text": "def field_index_format=(field_index_format)\n validator = EnumAttributeValidator.new('String', [\"Template\", \"Classic\", \"Fancy\", \"Modern\", \"Bulleted\", \"Formal\", \"Simple\"])\n if field_index_format.to_i == 0\n unless validator.valid?(field_index_format)\n raise ArgumentError, \"invalid value for 'field_index_format', must be one of #{validator.allowable_values}.\"\n end\n @field_index_format = field_index_format\n else\n @field_index_format = validator.allowable_values[field_index_format.to_i]\n end\n end", "title": "" }, { "docid": "86d48d60327c366e3302be4d88ff0746", "score": "0.42888892", "text": "def columns=(columns)\n @columns = columns.map { |c| c.is_a?(Column) ? c : Column.new(c) }\n @columns.each do |col|\n raise ArgumentError, \"Invalid column type: #{col.type}\" unless col.valid?\n end\n end", "title": "" }, { "docid": "c0b6658ee00b6a99a5bab1c398b01cb4", "score": "0.4281558", "text": "def columns(*array)\n unless array.empty?\n if (array.class == Array)\n options[:columns] = array\n else\n raise \"Report columns must be specified.\"\n end\n else\n options[:columns]\n end\n end", "title": "" }, { "docid": "b9d0f67497710316c39257643deda2c1", "score": "0.42694724", "text": "def set_revisable_columns(options)\n return unless self.versioned_columns.blank?\n return self.versioned_columns = [] if options[:except] == :all\n return self.versioned_columns = [options[:only]].flatten.map(&:to_s).map(&:downcase) unless options[:only].blank?\n\n except = [options[:except]].flatten || []\n #don't version some columns by default\n except += %w(created_at created_on updated_at updated_on) unless options[:timestamps]\n self.versioned_columns ||= (column_names - except.map(&:to_s)).flatten.map(&:downcase)\n end", "title": "" }, { "docid": "65d4ae0afa06a5e81ea3f38c8a5a772e", "score": "0.42559335", "text": "def allowed_formats\n renderable_formats.keys\n end", "title": "" }, { "docid": "78729384b43315e949cbad75f4c5dfe1", "score": "0.42554355", "text": "def available_columns\n column_options.reject{|column| self.report_columns.pluck(:column_name).include? column.name.to_s}\n end", "title": "" }, { "docid": "e89f7ca5ac2fc584b50f2f1d90e42f50", "score": "0.42507228", "text": "def column_widths(*widths)\n widths.each_with_index do |value, index|\n next if value.nil?\n\n Axlsx.validate_unsigned_numeric(value) unless value.nil?\n find_or_create_column_info(index).width = value\n end\n end", "title": "" }, { "docid": "5fa7cd81ee722118a5f82fd412d56ee3", "score": "0.42442352", "text": "def allow_guests=(allow_guests)\n self.guest_access = (allow_guests ? :can_join : :forbidden)\n allow_guests\n end", "title": "" }, { "docid": "321b1d9682afe939d7014adf8d422b02", "score": "0.4228543", "text": "def hide columns\n\t\tcolumns.each do |col|\n\t\t\t@potential_keys_to_ignore.push(col.to_s)\n\t\tend\n\t\treturn self\n\tend", "title": "" }, { "docid": "af4a70035d59b05c1246cfe9edbae50d", "score": "0.4221807", "text": "def allow_migrations\n return @allow_migrations unless @allow_migrations.nil?\n\n @allow_migrations = Settings::AllowDynamicMigrations && !prevent_migrations\n end", "title": "" }, { "docid": "336c5c5b4f6db8e505db651338d3fcf4", "score": "0.42172605", "text": "def allow_delete_rows=(value)\n @allow_delete_rows = value\n end", "title": "" }, { "docid": "5c23cc0e5dca8f497b5d87667bcf52d9", "score": "0.42151138", "text": "def field_style=(value)\n allowed_values = [:normal,:simple]\n raise ArgumentError, \"Only #{allowed_values.inspect} are allowed\" unless allowed_values.include?(value)\n @field_style = value\n end", "title": "" }, { "docid": "9cb0d768823f0cfcf4600963578562cd", "score": "0.42149028", "text": "def columns(columns)\n @columns = columns\n end", "title": "" }, { "docid": "2d1cacce71c1fe939b256fffb4206bd9", "score": "0.42142025", "text": "def set_column_width(c, width)\n if width < 100\n # Assume we are trying to use Excel-user style widths, scale up accordingly.\n # You can call col's width method directly to avoid this.\n width = width * 260\n end\n col(c).width = width\n end", "title": "" }, { "docid": "0d2236690f63272d479fa67c2411a3b4", "score": "0.42103428", "text": "def update_col_auto_width(idx, val, format)\n font_scale = (@workbook.font_sizes[format] || 11) / 10.0\n width = (val.count(THIN_CHARS) + 3) * font_scale\n width = 255 if width > 255 # Max xlsx column width is 255 characters\n @col_auto_widths[idx] = [@col_auto_widths[idx] || 0, width].max\n end", "title": "" }, { "docid": "cc8b1fff0b0710ccdcc2397bc24114be", "score": "0.42096016", "text": "def allowed_values=(value)\n @allowed_values = value\n end", "title": "" }, { "docid": "d261509b9e1527cf32f243b6b390d3c2", "score": "0.42068094", "text": "def set_column_widths\ncolumn_widths.each_with_index do |w, col_num|\ncolumn(col_num).width = w\nend\nend", "title": "" }, { "docid": "f82aa58fe90bd0081a0fb19f9901c6f9", "score": "0.41975895", "text": "def filterable_fields(&config_block)\n cattr_accessor :filterable_fields, :filterable_scopes, :default_filter_method, :default_filter_options\n\n # make all columns filterable, incase only or except aren't called in the configuration block\n self.filterable_fields = column_names.map { |column_name| column_name.to_s }\n\n FilterableConfiguration.new(self).instance_eval(&config_block)\n self.filterable_fields.collect!{ |field| field.to_s }\n\n self.default_filter_method ||= :any\n self.default_filter_options ||= {}\n end", "title": "" }, { "docid": "ed87a2e25b630c93d9bfcfe8a7f5a9bf", "score": "0.41973746", "text": "def formatter(column, options = {}, &block)\n set_required_columns(column, options[:requires]) if options.has_key?(:requires)\n formatters[column] = block\n end", "title": "" }, { "docid": "0e25892136746c717d42ec3e776bf824", "score": "0.4191789", "text": "def pdf_format=(pdf_format)\n validator = EnumAttributeValidator.new('String', [\"Default\", \"PdfA_1A\", \"PdfA_1B\", \"PdfA_2A\", \"PdfA_3A\", \"PdfA_2B\", \"PdfA_2U\", \"PdfA_3B\", \"PdfA_3U\", \"v1_3\", \"v1_4\", \"v1_5\", \"v1_6\", \"v1_7\", \"PdfX_1A\", \"PdfX3\"])\n if pdf_format.to_i == 0\n unless validator.valid?(pdf_format)\n raise ArgumentError, \"invalid value for 'pdf_format', must be one of #{validator.allowable_values}.\"\n end\n @pdf_format = pdf_format\n else\n @pdf_format = validator.allowable_values[pdf_format.to_i]\n end\n end", "title": "" }, { "docid": "495d08871946c468840859dd3b4912ff", "score": "0.41861725", "text": "def autosize_columns(except: nil)\n columns = get_columns(except: except)\n columns.each { |column| column.width = Util.wrapped_width(column.header) }\n @sources.each_with_index do |source, row_index|\n columns.each_with_index do |column, column_index|\n cell = column.body_cell(source, row_index: row_index, column_index: column_index)\n cell_width = Util.wrapped_width(cell.formatted_content)\n column.width = Util.max(column.width, cell_width)\n end\n end\n self\n end", "title": "" }, { "docid": "253a192ec69acac8824c35d372233e12", "score": "0.41843867", "text": "def format_columns_for_js\n colnames = []\n colmodel = []\n cols_to_format = []\n unless @plugin.nil?\n cols_to_format = @plugin.cols_to_format || []\n end\n\n @column_configs.each_with_index do |col_config, index|\n next if col_config[:hide] # Hide column, but retain data in rows.\n\n if col_config[:column_caption].nil?\n colname = (col_config[:col_name] || col_config[:field_name]) # If dataset is empty, need to build cols from fld.\n else\n colname = col_config[:column_caption]\n end\n col = {}\n col['name'] = colname\n col['field'] = col_config[:field_name]\n col['id'] = col_config[:field_name]\n col['sortable'] = true\n col['selectable'] = true\n col['cssClass'] = 'slk_cell_right_align' if ['integer', 'number'].include? col_config[:data_type]\n col['width'] = col_width(col_config)\n\n col['groupTotalsFormatter'] = 'sumTotalsFormatter' if @group_fields_to_sum.include?(col_config[:field_name])\n col['groupTotalsFormatter'] = 'cntTotalsFormatter' if @group_fields_to_count.include?(col_config[:field_name])\n col['groupTotalsFormatter'] = 'avgTotalsFormatter' if @group_fields_to_avg.include?(col_config[:field_name])\n col['groupTotalsFormatter'] = 'maxTotalsFormatter' if @group_fields_to_max.include?(col_config[:field_name])\n col['groupTotalsFormatter'] = 'minTotalsFormatter' if @group_fields_to_min.include?(col_config[:field_name])\n\n col['formatter'] = col_config[:format] unless col_config[:format].nil?\n # Check if a plugin has implemented a cell formatter for this field.\n col['formatter'] = 'text' if cols_to_format.include?(col_config[:field_name])\n\n if 'action' == col_config[:field_type]\n col['formatter'] = 'link'\n col['cssClass'] = 'slk_cell_centre_align'\n col['unfiltered'] = true\n col['sortable'] = false\n col['dynlink'] = true if col_config[:settings] && col_config[:settings][:dynamic_link_text].nil? && col_config[:settings][:image].blank?\n end\n if 'link_window' == col_config[:field_type]\n col['formatter'] = 'link_window'\n col['cssClass'] = 'slk_cell_centre_align'\n col['unfiltered'] = true\n col['sortable'] = false\n col['dynlink'] = true if col_config[:settings] && col_config[:settings][:link_text].blank? && col_config[:settings][:image].blank?\n end\n if 'action_collection' == col_config[:field_type]\n col['formatter'] = 'action_collection'\n col['cssClass'] = 'slk_cell_centre_align'\n col['unfiltered'] = true\n col['sortable'] = false\n end\n if 'boolean' == col_config[:data_type]\n col['cssClass'] = 'slk_cell_centre_align'\n col['formatter'] = 'bool' #'SlickBooleanFormatter'\n end\n\n colmodel << col\n end\n @colmodel = colmodel.to_json\n end", "title": "" }, { "docid": "2870d555b75670cb81a08d9642cadf29", "score": "0.41839975", "text": "def format *columns\n values, widths = [], []\n @records.each_with_index do |record, index|\n values[index] = []\n\n columns.each_with_index do |column, column_index|\n values[index][column_index] = column.respond_to?(:call) ?\n column.call(record) :\n record.send(column.intern)\n\n widths[column_index] = values[index][column_index].length if\n values[index][column_index].length > (widths[column_index] || 0)\n end # each\n end # each\n\n output = \"\"\n values.each do |line|\n line.each_with_index do |value, column_index|\n output << value << \" \" * (widths[column_index] - value.length)\n output << @separator unless column_index == line.count - 1\n end # each\n output << \"\\n\"\n end # each\n\n output\n end", "title": "" }, { "docid": "7c480c5cc115780847a40461d5f8cc13", "score": "0.41831392", "text": "def set_column(sheet, column, width, title)\n bold = Spreadsheet::Format.new(:weight => :bold, :size => 10)\n sheet.row(0).set_format(column, bold)\n sheet[0,column] = \"#{title}\"\n sheet.column(column).width = width\n end", "title": "" }, { "docid": "8c1d1f0b4fdd50a69c7c9daf3adda31f", "score": "0.41778195", "text": "def revisable_watch_columns #:nodoc:\n return self.revisable_columns unless self.revisable_columns.blank?\n return self.revisable_columns ||= [] if self.revisable_options.except == :all\n return self.revisable_columns ||= [self.revisable_options.only].flatten.map(&:to_s).map(&:downcase) unless self.revisable_options.only.blank?\n \n except = [self.revisable_options.except].flatten || []\n except += REVISABLE_SYSTEM_COLUMNS\n except += REVISABLE_UNREVISABLE_COLUMNS\n except.uniq!\n\n self.revisable_columns ||= (column_names - except.map(&:to_s)).flatten.map(&:downcase)\n end", "title": "" }, { "docid": "328215340eff1df5ccd0b9e1680d7def", "score": "0.41757348", "text": "def get_setter_methods\n meths = super\n if !(respond_to?(:allowed_columns) && allowed_columns) && restricted_columns\n meths -= restricted_columns.map{|x| \"#{x}=\"}\n end\n meths\n end", "title": "" }, { "docid": "9dc082fd505122eab5953f13b48766aa", "score": "0.41693574", "text": "def prepare_column_options(column)\n spec = super\n spec[:array] = 'true' if column.array?\n spec\n end", "title": "" }, { "docid": "a7ef17d16c0e2445701ede35a4449d43", "score": "0.41681", "text": "def setFixedColumn( fixedColName, fixedColWidth )\n @fixedColWidth = fixedColWidth\n @fixedColSide = fixedColName\n end", "title": "" }, { "docid": "9eeec6da825b439dd3a4e18eb83641f4", "score": "0.41672105", "text": "def set_column_width(column, value)\n @current_sheet.set_column(column, column, value)\n end", "title": "" }, { "docid": "608fe687cba80370a4909cfb0e758655", "score": "0.41618556", "text": "def columns=(value)\n if value.is_a?(Lolita::Configuration::Columns)\n @columns = value\n @columns.parent = self\n elsif value.respond_to?(:each)\n value.each{|possible_column| \n column(possible_column)\n }\n else\n raise ArgumentError.new(\"Columns must bet Array or Lolita::Configuration::Columns.\")\n end\n end", "title": "" }, { "docid": "28e60f273c65cc19eee60d92daf6d6f3", "score": "0.4157123", "text": "def per_column_statistics=(boolean)\n @per_column_statistics = boolean\n end", "title": "" }, { "docid": "5e305ded45eaf6a6a95c6fe70a6be165", "score": "0.4156429", "text": "def enforce_column_types_callback\n crypt_keeper_fields.each do |field|\n ensure_valid_field! field\n end\n end", "title": "" }, { "docid": "5e305ded45eaf6a6a95c6fe70a6be165", "score": "0.4156429", "text": "def enforce_column_types_callback\n crypt_keeper_fields.each do |field|\n ensure_valid_field! field\n end\n end", "title": "" }, { "docid": "c562215ef3473f1b8dd237132526977c", "score": "0.4147137", "text": "def normalize_column_options(name, opts)\n preset = column_preset_for(opts[:preset] || name)\n opts = Tabulatr::COLUMN_OPTIONS.merge(preset).merge(opts)\n {:width => 'width', :align => 'text-align', :valign => 'vertical-align'}.each do |key,css|\n if opts[key]\n [:th_html, :filter_html, :td_html].each do |set|\n opts[set] ||= {}\n opts[set][:style] = (opts[set][:style] ? opts[set][:style] << \"; \" : \"\") << \"#{css}: #{opts[key]}\"\n end # each\n end # if\n end # each\n # more to come!\n opts\n end", "title": "" }, { "docid": "1c3c3952c3171919c6b86628c3301d53", "score": "0.4139171", "text": "def validate_columns(&block)\n raise 'Invalid block passed to Importer#validate_columns: block should accept a single argument' if block.arity != 1\n @column_validator = block\n end", "title": "" }, { "docid": "64f594b2ed7abf88905a86c482a3f87a", "score": "0.41378668", "text": "def compose_not_range_options(table, column_name, allowed, hash)\n compose_range_options(table, column_name, allowed, hash).not\n end", "title": "" }, { "docid": "e5259bca35e51ad149e0e07359255dd8", "score": "0.41363454", "text": "def setter_methods(only, except)\n only = only.nil? ? model.allowed_columns : only\n except = except.nil? ? model.restricted_columns : except\n if only\n only.map{|x| \"#{x}=\"}\n else\n meths = methods.collect{|x| x.to_s}.grep(/=\\z/) - RESTRICTED_SETTER_METHODS\n meths -= Array(primary_key).map{|x| \"#{x}=\"} if primary_key && model.restrict_primary_key?\n meths -= except.map{|x| \"#{x}=\"} if except\n meths\n end\n end", "title": "" }, { "docid": "3f5a56837a20cf323bb069eecc9107a3", "score": "0.41162458", "text": "def format_column(column_name, value, options = {})\n format = format_of(column_name)\n if format && (formatter = format[:formatter])\n formatter_options = options.merge(:options => format[:options])\n formatter.call(value, formatter_options)\n else\n Rails.logger.debug \"[table_formatter] Column #{column_name} has no configured formatter\"\n value.to_s\n end\n end", "title": "" }, { "docid": "134435214bf5090532b351e6c8893fa8", "score": "0.4115037", "text": "def column(collection = [])\n @column_widths << (collection.map(&:to_s).map(&:size).max || 0)\n end", "title": "" }, { "docid": "ae82e683b4a7fa824ddffffb8ec734dd", "score": "0.41135496", "text": "def allow_sort=(value)\n @allow_sort = value\n end", "title": "" }, { "docid": "78cca622a2b16053d5dc7517101478f5", "score": "0.41132414", "text": "def columns\n fail OutOfRange,\n 'Valid value between 1 and 12 inclusive.' if out_of_range?\n\n column * value\n end", "title": "" } ]
828df8f862c3f853056421f3d6ac715e
Inserts two records into 'sequence_test' and returns the generated id values session: the active Session table: name of the table which is to be tested
[ { "docid": "c05091136305ccd648f8bd8ab8f4562c", "score": "0.7463359", "text": "def get_example_sequence_values(session, table = 'sequence_test')\n session.left.insert_record table, { 'name' => 'bla' }\n id1 = session.left.select_one(\"select max(id) as id from #{table}\")['id'].to_i\n session.left.insert_record table, { 'name' => 'blub' }\n id2 = session.left.select_one(\"select max(id) as id from #{table}\")['id'].to_i\n return id1, id2\nend", "title": "" } ]
[ { "docid": "d150ee02bfea1048ad33d844a438df69", "score": "0.6709008", "text": "def test_auto_increment_with_step\n s1 = FirstSequencedModel.create\n\n s = FirstSequencedModel.next_sequence('auto_increment', 3)\n s2 = FirstSequencedModel.create(auto_increment: s)\n assert_not_equal s2.auto_increment, 4\n assert_equal FirstSequencedModel.get_sequence('auto_increment'), 5\n end", "title": "" }, { "docid": "3e022e3014baa51762e42cb7de37c163", "score": "0.6526125", "text": "def insert()\n query = \"INSERT INTO genres (gen_name) VALUES ($1) RETURNING gen_id\"\n @gen_id = DbHelper.run_sql_return_first_row_column_value(query, [@gen_name], 'gen_id').to_i\n end", "title": "" }, { "docid": "9b07ac0e7309199e5d1cf366387b1bb8", "score": "0.64903635", "text": "def create_sequence(sequence, options = {})\n create_sql = \"CREATE SEQUENCE #{quote_table_name(sequence)} INCREMENT BY 1 START WITH 1 NO CYCLE\"\n execute create_sql \n\t select_value(\"SELECT #{quote_table_name(sequence)}.NEXTVAL FROM DUMMY\")\n end", "title": "" }, { "docid": "386297d6ebb1d4d58839c8fe5361eb6e", "score": "0.6466733", "text": "def last_insert_id_result(sequence_name); end", "title": "" }, { "docid": "3d1c84c2e1d4fe3e8a2d73f5aef2c8d5", "score": "0.63863945", "text": "def insert(klass, inserts)\n next_oid = nil\n\n if !inserts[klass.primary_key] || inserts[klass.primary_key] == \"NULL\"\n if seq = klass.ann(klass.primary_key, :sequence)\n next_oid = Integer(query(\"SELECT nextval('#{seq}')\").first_value)\n inserts[klass.primary_key] = write_attr(next_oid, :class => Integer)\n end\n end\n super\n\n return next_oid\n end", "title": "" }, { "docid": "18d90c3ad69d48df0abafd47d8a9356b", "score": "0.62294185", "text": "def set_pk_sequence!(table, value); end", "title": "" }, { "docid": "296c20d5fa162633f0ee022e54ee87f5", "score": "0.619059", "text": "def create_sequence_if_not_exists\n ActiveRecord::Base.connection.execute(create_sequence_sql)\n end", "title": "" }, { "docid": "e902c4520150ae9bf2830c59d473f3bb", "score": "0.61812174", "text": "def save()\n sql = \"INSERT INTO sessions\n (name, genre, capacity, session_time, session_date)\n VALUES\n ($1, $2, $3, $4, $5)\n RETURNING id\"\n values = [@name, @genre, @capacity, @session_time, @session_date]\n results = SqlRunner.run(sql, values)\n @id = results.first()['id'].to_i\n end", "title": "" }, { "docid": "ef3a75e7022c49d547f02a1dc84e596a", "score": "0.61412203", "text": "def pk_and_sequence_for(table); end", "title": "" }, { "docid": "037e48b7d5d8a1ee9ec0b2297e86e119", "score": "0.6138551", "text": "def last_insert_id(table, sequence_name) #:nodoc:\n Integer(select_value(\"SELECT currval('#{sequence_name}')\"))\n end", "title": "" }, { "docid": "28bd54fef50bdde9812ccd5df7d6167f", "score": "0.609633", "text": "def next_val_sequence(name)\n val = self.insert_sql(\"INSERT INTO %s_sequence VALUES(NULL)\" % name)\n # In jdbcsqlite, insert_sql is not implemented\n val ||= last_insert_id(\"#{name}_sequence\", nil) rescue nil\n end", "title": "" }, { "docid": "a7588151f327b515ef84024d0aaeca90", "score": "0.6062722", "text": "def set_get_id table,value\n sql = \"INSERT INTO #{table} (name) \" +\n \"VALUES ('#{value}')\"\n id = 0\n @db.connect do \n @db.query(sql)\n id = @db.query(\"select last_insert_id()\").fetch_row[0].to_i\n end\n id\n end", "title": "" }, { "docid": "d42c87b5183382bfad3645889c73c14d", "score": "0.6035426", "text": "def create_sequence(table_name, pk=\"id\")\n ActiveRecord::Base.connection.execute(%{\n CREATE SEQUENCE #{table_name}_#{pk}_seq OWNED BY #{table_name}.#{pk}\n })\n end", "title": "" }, { "docid": "e3859965ed2a114b0172033d2c20b85c", "score": "0.60129315", "text": "def spanner_create_sequence project_id:, instance_id:, database_id:\n db_admin_client = Google::Cloud::Spanner::Admin::Database.database_admin\n\n database_path = db_admin_client.database_path project: project_id,\n instance: instance_id,\n database: database_id\n\n\n job = db_admin_client.update_database_ddl database: database_path, statements: [\n \"CREATE SEQUENCE Seq OPTIONS (sequence_kind = 'bit_reversed_positive')\",\n \"CREATE TABLE Customers (CustomerId INT64 DEFAULT (GET_NEXT_SEQUENCE_VALUE(Sequence Seq)), CustomerName STRING(1024)) PRIMARY KEY (CustomerId)\"\n ]\n\n puts \"Waiting for operation to complete...\"\n job.wait_until_done!\n puts \"Created Seq sequence and Customers table, where the key column CustomerId uses the sequence as a default value\"\nend", "title": "" }, { "docid": "25e26a9a31fc50a70a22e147f21c5063", "score": "0.6010394", "text": "def next_seq_id\n @tx_seq_id += 1\n end", "title": "" }, { "docid": "25e26a9a31fc50a70a22e147f21c5063", "score": "0.6010394", "text": "def next_seq_id\n @tx_seq_id += 1\n end", "title": "" }, { "docid": "109d61e6d395f133c36b2e6e93c1198f", "score": "0.5987921", "text": "def last_insert_id(table, sequence_name) #:nodoc:\n Integer(select_value(\"SELECT scope_identity()\"))\n end", "title": "" }, { "docid": "92dd77311dd9bdc843c814e51bc7bec0", "score": "0.5963803", "text": "def sequence_id\n @sequence_id\n end", "title": "" }, { "docid": "dc249109a3f7422ecc69245c3b93b517", "score": "0.5940175", "text": "def addSequence\n\n end", "title": "" }, { "docid": "cf007a3b662f8fbcebcb96dccf6b32df", "score": "0.58976334", "text": "def insert\n DATABASE.execute(\"INSERT INTO items_tables (table_name) VALUES \n ('#{@table_name}')\")\n @id = DATABASE.last_insert_row_id\n end", "title": "" }, { "docid": "8ff754a49adb02a34083b2a6fb08949d", "score": "0.5884675", "text": "def insert\n col_names = attributes.keys.join(\", \")\n vals = attribute_values\n n = vals.count\n question_marks = \"(#{([\"?\"] * n).join(\", \")})\"\n table = self.class.table_name\n insert_into = \"#{table} (#{col_names})\"\n query = @@db.execute(<<-SQL, *vals)\n INSERT INTO\n #{insert_into}\n VALUES\n #{question_marks}\n SQL\n self.id = @@db.instance.last_insert_row_id\n end", "title": "" }, { "docid": "78374f8d1d973fd8604b3974e3e3d227", "score": "0.5882513", "text": "def create_sequence(sequence_name)\n execute(\"CREATE SEQUENCE #{sequence_name}\") rescue nil\n end", "title": "" }, { "docid": "fe56c7efea0e040ba6eb53eebe7c8d86", "score": "0.5872809", "text": "def insert\n sql_query = \"INSERT INTO guests (first_name, last_name, age, gender, reservation_id) VALUES ('#{@first_name}', '#{@last_name}', '#{@age}', '#{@gender}', '#{@reservation_id}')\"\n \n DATABASE.execute(sql_query)\n @id = DATABASE.last_insert_row_id # will return the value of the row id\n end", "title": "" }, { "docid": "1d02cf1058d445fdbfd58ae65558299a", "score": "0.58614206", "text": "def next_sequence_value(sequence_name)\n # if sequence_name is set to :autogenerated then it means that primary key will be populated by trigger\n return nil if sequence_name == AUTOGENERATED_SEQUENCE_NAME\n sequence_name = quote_table_name(sequence_name)\n sql = \"SELECT #{sequence_name}.NEXTVAL id FROM dual\"\n log(sql, 'SQL') { @connection.next_sequence_value(sequence_name) }\n end", "title": "" }, { "docid": "78dda7ccae6479e6b32679ecf8a08bd4", "score": "0.5836537", "text": "def insert_sql(sql, name = nil, pk = nil, id_value = nil, sequence_name = nil)\n super\n\n @connection.sql('SELECT @@IDENTITY')\n unless @connection.cmd_fail?\n id = @connection.top_row_result.rows.first.first\n id = id.to_i if id\n return id if id > 0\n end\n end", "title": "" }, { "docid": "65b68a753b70ebdf0936f47178b19f18", "score": "0.58346766", "text": "def last_insert_id_result(sequence_name)\n exec_query(\"SELECT currval(#{quote(sequence_name)})\", \"SQL\")\n end", "title": "" }, { "docid": "0e89444b469c3727e1f74382873913c7", "score": "0.58327514", "text": "def exec_insert(sql, name = T.unsafe(nil), binds = T.unsafe(nil), pk = T.unsafe(nil), sequence_name = T.unsafe(nil)); end", "title": "" }, { "docid": "3ae1b57c3da0e5e50dbd88e1c6b9aeb9", "score": "0.5829558", "text": "def save\n DB[:conn].execute(\"INSERT INTO #{table_name_for_insert} (#{col_names_for_insert}) VALUES (#{values_for_insert})\")\n \n self.id = DB[:conn].execute(\"SELECT last_insert_rowid() FROM #{table_name_for_insert}\")[0][0]\n end", "title": "" }, { "docid": "882c8b10f72b2bbecbb74221bd1b4854", "score": "0.5820421", "text": "def set_sequence\n @sequence = Sequence.where(project_id: sessions_current_project_id).find(params[:id])\n end", "title": "" }, { "docid": "502651734c8e2df3ffdc2ec73e39c776", "score": "0.58190006", "text": "def increment_insert_id\n @insert_id = @insert_id.next\n end", "title": "" }, { "docid": "50edc36b86bc6408553f95c7afd55638", "score": "0.5807024", "text": "def save()\n sql = \"INSERT INTO products (\n name,\n description,\n stock_quantity,\n buy_price,\n sell_price,\n designer_id\n ) VALUES (\n $1, $2, $3, $4, $5, $6\n ) RETURNING id;\"\n values = [@name, @description, @stock_quantity, @buy_price, @sell_price, @designer_id]\n results = SqlRunner.run(sql, values)\n @id = results.first['id'].to_i\nend", "title": "" }, { "docid": "26d928895a1b7e1968076d2a9eeca9cb", "score": "0.5791711", "text": "def last_insert_id_result(sequence_name)\n internal_exec_query(\"SELECT currval(#{quote(sequence_name)})\", \"SQL\")\n end", "title": "" }, { "docid": "0b7646f517ee7c7495258f838f279e8d", "score": "0.57794744", "text": "def insert_sql(sql, name = nil, pk = nil, id_value = nil, sequence_name = nil)\n execute(sql, name)\n id_value\n end", "title": "" }, { "docid": "0b7646f517ee7c7495258f838f279e8d", "score": "0.57794744", "text": "def insert_sql(sql, name = nil, pk = nil, id_value = nil, sequence_name = nil)\n execute(sql, name)\n id_value\n end", "title": "" }, { "docid": "29c74d7ef1414d6bbf8bcdb68d37a01f", "score": "0.5758837", "text": "def exec_insert(sql, name = nil, binds = [], pk = nil, sequence_name = nil)\n sql, binds = sql_for_insert(sql, pk, binds)\n type_casted_binds = type_casted_binds(binds)\n\n log(sql, name, binds, type_casted_binds) do\n cached = false\n cursor = nil\n returning_id_col = returning_id_index = nil\n with_retry do\n if without_prepared_statement?(binds)\n cursor = @raw_connection.prepare(sql)\n else\n unless @statements.key?(sql)\n @statements[sql] = @raw_connection.prepare(sql)\n end\n\n cursor = @statements[sql]\n\n cursor.bind_params(type_casted_binds)\n\n if /:returning_id/.match?(sql)\n # it currently expects that returning_id comes last part of binds\n returning_id_index = binds.size\n cursor.bind_returning_param(returning_id_index, Integer)\n end\n\n cached = true\n end\n\n cursor.exec_update\n end\n\n rows = []\n if returning_id_index\n returning_id = cursor.get_returning_param(returning_id_index, Integer).to_i\n rows << [returning_id]\n end\n cursor.close unless cached\n build_result(columns: returning_id_col || [], rows: rows)\n end\n end", "title": "" }, { "docid": "17df2d12fa023fdd2247230ff993b96f", "score": "0.5755169", "text": "def insert()\n sql = \"INSERT INTO films (title, previous_episode_id) VALUES ($1, $2) RETURNING id\"\n @id = Helper.sql_run(sql, [@title, @previous_episode_id])[0]['id']\n end", "title": "" }, { "docid": "89ac79f0d07ec8f2927c0db4bef29f00", "score": "0.5753355", "text": "def insert_fixture(fixture, table_name); end", "title": "" }, { "docid": "ba87039155b69d8369fe6731666406ff", "score": "0.573866", "text": "def insert\n table = self.class.table_name\n column_names = self.class.columns.join(\", \")\n num_fields = self.class.columns.length\n fields = ([\"?\"] * num_fields).join(\", \")\n\n result = DBConnection.execute(<<-SQL, attribute_values)\n INSERT INTO\n #{table} (#{column_names})\n VALUES\n (#{fields})\n SQL\n\n self.id = DBConnection.last_insert_row_id\n end", "title": "" }, { "docid": "76c964a06e57c32c719a189c7878bc0c", "score": "0.57320833", "text": "def last_insert_id(sequence_name) #:nodoc:\n r = exec_query(\"SELECT currval('#{sequence_name}')\", 'SQL')\n Integer(r.rows.first.first)\n end", "title": "" }, { "docid": "060d88629466418b76b3726c5b0df988", "score": "0.57232404", "text": "def insert()\n query = \"INSERT INTO purchase_items (pri_qty, pri_unit_price, pri_alb_id, pri_pro_id)\n VALUES ($1, $2, $3, $4) RETURNING pri_id\"\n @pri_id = DbHelper.run_sql_return_first_row_column_value(query,\n [@pri_qty, @pri_unit_price, @pri_alb_id, @pri_pro_id],\n 'pri_id').to_i\n end", "title": "" }, { "docid": "a15aabf85b2e92ea25ac86962f9c16be", "score": "0.57213604", "text": "def next_sequence_value(sequence_name)\n execute(\"SELECT #{sequence_name}.NEXTVAL id FROM DUMMY\").first['id'].to_i\n end", "title": "" }, { "docid": "a5c80e504d749b102f432d523295ceeb", "score": "0.5720938", "text": "def save\n sql = \"INSERT INTO #{table_name_for_insert} (#{col_names_for_insert}) VALUES (#{values_for_insert})\"\n DB[:conn].execute(sql)\n @id = DB[:conn].execute(\"SELECT last_insert_rowid() FROM #{table_name_for_insert}\")[0][0] #retrieves id from database after inserting into it\n end", "title": "" }, { "docid": "13cbec384b2d6d680546f27b4d5abce2", "score": "0.5715748", "text": "def set_pk_sequence!(table, value) #:nodoc:\n pk, sequence = pk_and_sequence_for(table)\n\n if pk\n if sequence\n quoted_sequence = quote_table_name(sequence)\n\n select_value(\"SELECT setval('#{quoted_sequence}', #{value})\", 'SCHEMA')\n else\n @logger.warn \"#{table} has primary key #{pk} with no default sequence\" if @logger\n end\n end\n end", "title": "" }, { "docid": "09c682dcb478d72ee5cc40b0c323ffc0", "score": "0.57145697", "text": "def insert_sql(sql, name = nil, pk = nil, id_value = nil, sequence_name = nil) # :nodoc:\n sql = annotate_sql(sql) if @annotate\n\n @logger.unknown(\"args=[#{sql}|#{name}|#{pk}|#{id_value}|#{sequence_name}]\") if @@trace\n\n # id_value ::= pre-assigned id\n retry_count = 0\n begin\n pre_insert(sql, name, pk, id_value, sequence_name) if respond_to?(\"pre_insert\")\n stmt = log(sql, name) { @connection.run(sql) }\n table = sql.split(\" \", 4)[2]\n res = id_value || last_insert_id(table, sequence_name ||\n default_sequence_name(table, pk), stmt)\n rescue Exception => e\n @logger.unknown(\"exception=#{e}\") if @@trace\n if @dbmsName == :virtuoso && id_value.nil? && e.message =~ /sr197/i\n # Error: Non unique primary key\n # If id column is an autoincrementing IDENTITY column and there\n # have been prior inserts using explicit id's, the sequence\n # associated with the id column could lag behind the id values\n # inserted explicitly. In the course of subsequent inserts, if\n # an explicit id isn't given, the autogenerated id may collide\n # with a previously explicitly inserted value.\n unless stmt.nil?\n stmt.drop; stmt = nil\n end\n table_name = e.message =~/Non unique primary key on (\\w+\\.\\w+\\.\\w+)/i ? $1 : nil\n if table_name && retry_count == 0\n retry_count += 1\n # Set next sequence value to be greater than current max. pk value\n set_sequence(table_name, pk)\n retry\n end\n end\n raise StatementInvalid, e.message\n ensure\n post_insert(sql, name, pk, id_value, sequence_name) if respond_to?(\"post_insert\")\n stmt.drop unless stmt.nil?\n end\n res\n end", "title": "" }, { "docid": "e8178cff29bd9acb48525026b943d77f", "score": "0.5714509", "text": "def mint_id\n r = execute \"SELECT nextval('obj_sequence');\"\n r[0][0].to_i\n end", "title": "" }, { "docid": "3380e4c0696430eac4e704d1c907246b", "score": "0.5710912", "text": "def insert\n stringy_columns = self.class.columns.map(&:to_s).join(\", \")\n question_marks = ([\"?\"]*(self.class.columns.length)).join(\", \") \n query = \"INSERT INTO #{self.class.table_name} (#{stringy_columns}) VALUES (#{question_marks})\"\n DBConnection.execute(query, *attribute_values)\n self.id = DBConnection.last_insert_row_id\n end", "title": "" }, { "docid": "9f2dfbe017b62a0fef2e8744c9b7c845", "score": "0.57049966", "text": "def insert\n vals = self.class.columns.join(', ')\n q_marks = []\n attribute_values.length.times { q_marks << '?' }\n q_marks = q_marks.join(', ')\n DBConnection.execute(<<-SQL, *attribute_values)\n INSERT INTO\n #{self.class.table_name} (#{vals})\n VALUES\n (#{q_marks})\n SQL\n self.id = DBConnection.last_insert_row_id\n end", "title": "" }, { "docid": "89be3eb08e1f9fba92662f974b3e1738", "score": "0.5702702", "text": "def save()\n sql = \"INSERT INTO gymclasses\n (type,instructor,capacity)\n VALUES($1,$2,$3) RETURNING id\"\n values = [@type,@instructor,@capacity]\n result = SqlRunner.run(sql,values)\n @id = result.first()['id'].to_i\n end", "title": "" }, { "docid": "7152204e2492ab5e17422579a91fa0df", "score": "0.57013017", "text": "def insert_id\n @insert_id\n end", "title": "" }, { "docid": "dd45c6014d7c552dd30f641e6246b873", "score": "0.5700701", "text": "def execute_statement_insert(stmt, sql)\n stmt.execute(sql, JavaSQL::Statement.RETURN_GENERATED_KEYS)\n end", "title": "" }, { "docid": "64b04fd456872b3fd2f7aadabbaac631", "score": "0.56996334", "text": "def insert\n columns = self.class.columns.drop(1)\n col_names = columns.map(&:to_s).join(', ')\n\n question_marks = (['?'] * columns.length).join(', ')\n table_name = self.class.table_name\n\n DBConnection.execute(<<-SQL, *attribute_values)\n INSERT INTO \"#{table_name}\" (#{col_names})\n VALUES (#{question_marks})\n SQL\n\n self.id = DBConnection.last_insert_row_id\n end", "title": "" }, { "docid": "2fb2287281e0006cd27778bd15fcbe5d", "score": "0.56950176", "text": "def allocate_next_seq\n retries = 20\n while true\n reload\n seq = send(seq_column)\n case r = self.class.base_class.update_all(\n [\"#{seq_column}=?\",seq+1],\n [\"#{self.class.base_class.primary_key}=? and #{seq_column}=?\",id,seq])\n when 0\n retries -= 1\n raise ActiveRecordError, \"Unable to allocate from #{seq_column}\" if retries <= 0\n sleep rand(0.5)\n when 1\n return seq\n else\n raise ActiveRecordError, \"Unexpected update result #{r.inspect} in allocate_next_seq\"\n end\n end\n end", "title": "" }, { "docid": "dfd436226ce10139b43029e030670909", "score": "0.5690009", "text": "def insert_fixture(fixture, table_name)\n puts_log \"insert_fixture = #{fixture}\"\n if(fixture.respond_to?(:keys))\n insert_query = \"INSERT INTO #{quote_table_name(table_name)} ( #{fixture.keys.join(', ')})\"\n else\n insert_query = \"INSERT INTO #{quote_table_name(table_name)} ( #{fixture.key_list})\"\n end\n\n insert_values = []\n params = []\n if @servertype.instance_of? IBM_IDS\n super\n return\n end\n column_list = columns(table_name)\n fixture.each do |item|\n col = nil\n column_list.each do |column|\n if column.name.downcase == item.at(0).downcase\n col= column\n break\n end\n end\n\t\t \n if item.at(1).nil? || \n item.at(1) == {} || \t\t\t \n\t\t\t (item.at(1) == '' && !(col.sql_type.to_s =~ /text|clob/i))\n params << 'NULL'\n\t\t\t\t\n\t\t elsif (!col.nil? && (col.sql_type.to_s =~ /blob|binary|clob|text|xml/i) )\t\t\t\n # Add a '?' for the parameter or a NULL if the value is nil or empty \n # (except for a CLOB field where '' can be a value)\n insert_values << quote_value_for_pstmt(item.at(1))\n params << '?'\n else\n insert_values << quote_value_for_pstmt(item.at(1),col)\n params << '?'\n end \n end\n \n insert_query << \" VALUES (\"+ params.join(',') + \")\"\n unless stmt = IBM_DB.prepare(@connection, insert_query)\n error_msg = IBM_DB.getErrormsg( @connection, IBM_DB::DB_CONN )\n if error_msg && !error_msg.empty?\n raise \"Failed to prepare statement for fixtures insert due to : #{error_msg}\"\n else\n raise StandardError.new('An unexpected error occurred during preparing SQL for fixture insert')\n end\n end\n \n log(insert_query,'fixture insert') do\n unless IBM_DB.execute(stmt, insert_values)\n error_msg = IBM_DB.getErrormsg(stmt, IBM_DB::DB_STMT )\n IBM_DB.free_stmt(stmt) if stmt\n raise \"Failed to insert due to: #{error_msg}\"\n else\n IBM_DB.free_stmt(stmt) if stmt\n end\n end\n end", "title": "" }, { "docid": "a70a70743c31c3101771706e7c12e9ec", "score": "0.5677333", "text": "def save()\n sql = \"INSERT INTO bookings(member_id, gym_class_id) VALUES ($1, $2) RETURNING id\"\n values = [@member_id, @gym_class_id]\n results = SqlRunner.run(sql, values)\n @id = results.first()['id'].to_i\nend", "title": "" }, { "docid": "db1de2ae4ad59e2d902e9efd5a5e19c9", "score": "0.5670236", "text": "def save\n sql = \"INSERT INTO #{table_name_for_insert} (#{col_names_for_insert}) VALUES (#{values_for_insert})\"\n DB[:conn].execute(sql)\n @id = DB[:conn].execute(\"SELECT last_insert_rowid() FROM #{table_name_for_insert}\")[0][0]\n end", "title": "" }, { "docid": "db1de2ae4ad59e2d902e9efd5a5e19c9", "score": "0.5670236", "text": "def save\n sql = \"INSERT INTO #{table_name_for_insert} (#{col_names_for_insert}) VALUES (#{values_for_insert})\"\n DB[:conn].execute(sql)\n @id = DB[:conn].execute(\"SELECT last_insert_rowid() FROM #{table_name_for_insert}\")[0][0]\n end", "title": "" }, { "docid": "db1de2ae4ad59e2d902e9efd5a5e19c9", "score": "0.5670236", "text": "def save\n sql = \"INSERT INTO #{table_name_for_insert} (#{col_names_for_insert}) VALUES (#{values_for_insert})\"\n DB[:conn].execute(sql)\n @id = DB[:conn].execute(\"SELECT last_insert_rowid() FROM #{table_name_for_insert}\")[0][0]\n end", "title": "" }, { "docid": "db1de2ae4ad59e2d902e9efd5a5e19c9", "score": "0.5670236", "text": "def save\n sql = \"INSERT INTO #{table_name_for_insert} (#{col_names_for_insert}) VALUES (#{values_for_insert})\"\n DB[:conn].execute(sql)\n @id = DB[:conn].execute(\"SELECT last_insert_rowid() FROM #{table_name_for_insert}\")[0][0]\n end", "title": "" }, { "docid": "db1de2ae4ad59e2d902e9efd5a5e19c9", "score": "0.5670236", "text": "def save\n sql = \"INSERT INTO #{table_name_for_insert} (#{col_names_for_insert}) VALUES (#{values_for_insert})\"\n DB[:conn].execute(sql)\n @id = DB[:conn].execute(\"SELECT last_insert_rowid() FROM #{table_name_for_insert}\")[0][0]\n end", "title": "" }, { "docid": "92fe3a852c516108d3d86d7629003590", "score": "0.5667982", "text": "def make_sure_pk_works(table_name, name)\n # Ensure the auto-generated id will not violate the primary key constraint.\n # This is expensive and it's used so that the tests pass. Comment out for production code(?).\n # Assume that table name has one primary key column named id that is associated with a sequence,\n # otherwise return\n hdl = nil\n sequence_name = extract_sequence_name(select_value(\"select \\\"default\\\" from #{MDB_SYS_SCHEMA}_columns where table_id in (select id from #{MDB_SYS_SCHEMA}_tables where name = '#{table_name}') and name='id';\"))\n\n return if sequence_name.blank?\n\n max_id = select_value(\"select max(id) from #{table_name}\").to_i\n next_seq_val = select_value(\"select next value for #{sequence_name}\").to_i\n\n if (max_id > next_seq_val)\n hdl = execute(\"ALTER SEQUENCE #{sequence_name} RESTART WITH #{max_id+1}\", name)\n else\n hdl = execute(\"ALTER SEQUENCE #{sequence_name} RESTART WITH #{next_seq_val+1}\", name)\n end\n end", "title": "" }, { "docid": "7ad1a66b762cf426e68be4261e90d3d6", "score": "0.5667786", "text": "def insert\n num_columns = col_names = self.class.columns[1..-1].length\n col_names = self.class.columns[1..-1].join(\", \")\n q_marks = Array.new( num_columns, \"?\").join(\", \")\n\n attributes = attribute_values[1..-1]\n DBConnection.execute(<<-SQL, *attributes)\n INSERT INTO \n #{self.class.table_name} (#{col_names})\n VALUES\n (#{q_marks})\n SQL\n\n self.id = DBConnection.last_insert_row_id\n end", "title": "" }, { "docid": "dbf99fef9e972b4a9576215058e51ed6", "score": "0.564515", "text": "def insert\n DATABASE.execute(\"INSERT INTO quotes (quote, person_id) VALUES \n ('#{@quote}', #{@person_id})\")\n @id = DATABASE.last_insert_row_id\n end", "title": "" }, { "docid": "9c3f11d339887b11be770ab4b893f311", "score": "0.56445795", "text": "def fix_sequence_id(tablename)\n connection = ActiveRecord::Base.connection()\n connection.execute(\"select setval('#{tablename}_id_seq',(select max(id) from #{tablename}))\")\n end", "title": "" }, { "docid": "756a15029d66806d5a7c48777cb6827f", "score": "0.56254894", "text": "def insert\n # doesn't this already includes an :id attribute?\n attributes_hash = self.attributes\n\n insert_into_string = attributes_hash.keys.join(', ')\n\n values_symbol_string = attributes_hash.keys.map { |att| \":#{att}\"}.join(', ')\n\n sql = <<-SQL\n INSERT INTO\n #{self.class.table_name} (#{insert_into_string})\n VALUES\n (#{values_symbol_string})\n SQL\n\n DBConnection.execute(sql, attributes_hash)\n\n self.id = DBConnection.last_insert_row_id\n end", "title": "" }, { "docid": "67e9e9011d6e74906d2175c8e7860782", "score": "0.56247914", "text": "def insert\n DBConnection.execute(<<-SQL, *attribute_values)\n INSERT INTO #{self.class.table_name} (#{attributes.keys.join(', ')})\n VALUES (#{([\"?\"]*attributes.length).join(', ')})\n SQL\n self.id = DBConnection.instance.last_insert_row_id\n end", "title": "" }, { "docid": "bca96cf1bf7c60df3991122650d0c599", "score": "0.562391", "text": "def create_record(class_identifier, *args)\n insert(ScenarioRecord, class_identifier, *args) do |record|\n meta = record.record_meta\n fixture = record.to_fixture\n begin\n meta.connection.insert_fixture(fixture, record.record_meta.table_name)\n rescue # Rails 1.2 compatible!\n meta.connection.execute \"INSERT INTO #{meta.table_name} (#{fixture.key_list}) VALUES (#{fixture.value_list})\"\n end\n record.id\n end\n end", "title": "" }, { "docid": "40e84d1ea1ad5c039f801ad4e13102da", "score": "0.5623788", "text": "def insert_sql(sql, name = nil, pk = nil, id_value = nil, sequence_name = nil)\n execute(sql, name)\n id_value\n end", "title": "" }, { "docid": "62db274ea225c40df3026d15f4fafef0", "score": "0.5618284", "text": "def save()\n sql = \"INSERT INTO tickets\n (\n customer_id,\n film_id\n\n\n\n )\n VALUES\n (\n $1, $2\n )\n RETURNING *\"\n values = [@customer_id, @film_id]\n ticket = SqlRunner.run(sql, values).first\n @id = ticket['id'].to_i\n end", "title": "" }, { "docid": "530cc988043757cd80cd9bc549fb29d9", "score": "0.561481", "text": "def save\n sql = \"INSERT INTO #{table_name_for_insert} (#{col_names_for_insert}) VALUES (#{values_for_insert})\"\n DB[:conn].execute(sql)\n self.id = DB[:conn].execute(\"SELECT last_insert_rowid()\")[0][0]\n end", "title": "" }, { "docid": "8197d90340a87abc902afb699b361d4c", "score": "0.56075794", "text": "def increment_insert_id\n @insert_id = @insert_id.next.slice(-INSERT_ID_SIZE,INSERT_ID_SIZE) # slice is required to make sure ID has fixed length.\n end", "title": "" }, { "docid": "5ee1d686842747e9b82b019bdc52cab6", "score": "0.56072813", "text": "def save\n \tsql = \"INSERT INTO #{table_name_for_insert} (#{col_names_for_insert}) VALUES (#{values_for_insert})\"\n \tDB[:conn].execute(sql)\n\n \t@id = DB[:conn].execute(\"SELECT last_insert_rowid()\")[0][0]\n end", "title": "" }, { "docid": "43307f11cb5b83a771cc45e315138632", "score": "0.55985004", "text": "def insert\n attributes = []\n values = []\n \n instance_variables.each do |x|\n unless x == :@id\n attributes << x.to_s.delete('@')\n end\n end\n \n columns = attributes.join(\", \")\n attributes.each do |x| \n if self.send(x).is_a? Integer\n values << self.send(x)\n else\n values << \"'#{self.send(x)}'\"\n end \n end\n \n DATABASE.execute(\"INSERT INTO #{self.class.to_s.pluralize} (#{columns}) VALUES (#{values.join(', ')})\")\n @id = DATABASE.last_insert_row_id\n end", "title": "" }, { "docid": "f9a3d0c6a651895552acd0a4dde79870", "score": "0.5597525", "text": "def next_id(options = {}) \n options.assert_valid_keys(:table)\n table_name = options.delete :table\n\n create_field_or_ensure_type_integer_for(table_name)\n atomic_increment!(table_name)\n end", "title": "" }, { "docid": "3db97be3afbd2fdf5d4c0798fbf60130", "score": "0.5596585", "text": "def insert\n DATABASE.execute(\"INSERT INTO products(general_info, technical_specs, where_to_buy) \n VALUES ('#{@general_info}', '#{@technical_specs}', '#{@where_to_buy}')\")\n @id = DATABASE.last_insert_row_id\n end", "title": "" }, { "docid": "095d6a83003db919a15e5d5c2f4f0dff", "score": "0.5596365", "text": "def create\n column_names = self.instance_variables.map do |var| \n var[-1..1] \n end.join(', ')\n\n row_values = self.instance_variables.map do |var|\n self.instance_variable_get(var)\n end\n\n DBConnection.execute(<<-SQL, row_values)\n INSERT INTO\n #{@table_name} #{column_names}\n VALUES\n ?\n SQL\n\n @id = DBConnection.last_row_id\n end", "title": "" }, { "docid": "c16ab71d6e8902d21d700332aa718ce8", "score": "0.5596322", "text": "def last_insert_id(table, sequence_name, stmt = nil)\np \"last_insert_id, #{table}, #{sequence_name}\"\n @logger.unknown(\"ODBCAdapter#last_insert_id>\") if @trace\n #select_value(\"select LAST_INSERT_ID()\", 'last_insert_id')\n\tif sequence_exists?(sequence_name)\n uncached do\n #select_value(\"SELECT #{quote_table_name(sequence_name)}.CURRVAL FROM DUMMY\")\n select_value(\"SELECT #{quote_table_name(sequence_name)}.NEXTVAL FROM DUMMY\")\n \n select_value(\"SELECT #{quote_table_name(sequence_name)}.CURRVAL FROM DUMMY\")\n end\n\telsif has_column?(table, \"ID\")\n\t return select_value(\"select max(ID) from #{quote_table_name(table)}\")\n else \n return nil\n\tend\n end", "title": "" }, { "docid": "cc3e33ca8a92b505d04101f8af2fdeb4", "score": "0.5581036", "text": "def execute_statement_insert(stmt, sql)\n stmt.executeUpdate(sql, JavaSQL::Statement.RETURN_GENERATED_KEYS)\n end", "title": "" }, { "docid": "11f8c9f838ab285b03b18b91320081f3", "score": "0.55802613", "text": "def test_post_insert_data\n\n post \"/db/simpletest\", params = {:test => \"four\"}\n\n #make sure this responded ok\n assert last_response.success?\n\n #make sure that the table looks as it should.\n assert_equal [{:id=>1, :test=>\"one\"},{:id=>2, :test=>\"two\"},{:id=>3, :test=>\"two\"},{:id=>4, :test=>\"four\"}], $BS.tables[:simpletest].entire_table(:override_security => true)\n end", "title": "" }, { "docid": "0d148597f886f7e2b8c372699a917201", "score": "0.5579563", "text": "def insert\n # drop first column - we do not insert row ID\n table_name = self.class.table_name\n columns = self.class.columns.drop(1)\n question_marks = Array.new(columns.count, '?').join(', ')\n column_names = columns\n .map(&:to_s)\n .join(', ')\n\n # drop first column - we do not insert row ID\n DBConnection.execute(<<-SQL, *attribute_values.drop(1))\n INSERT INTO\n #{table_name} (#{column_names})\n VALUES\n (#{question_marks})\n SQL\n\n self.id = DBConnection.last_insert_row_id\n end", "title": "" }, { "docid": "777697aaed371427804e8d7cde1730c4", "score": "0.5570806", "text": "def set_pk_sequence!(table, value) # :nodoc:\n pk, sequence = pk_and_sequence_for(table)\n\n if pk\n if sequence\n quoted_sequence = quote_table_name(sequence)\n\n query_value(\"SELECT setval(#{quote(quoted_sequence)}, #{value})\", \"SCHEMA\")\n else\n @logger.warn \"#{table} has primary key #{pk} with no default sequence.\" if @logger\n end\n end\n end", "title": "" }, { "docid": "af80be793b23548adf092670eb6ab9db", "score": "0.5567467", "text": "def test02\r\n database = Database::new(DB_FILE)\r\n @connection = database.connect('newuser', 'password', Connection::ROLE => 'SALES' )\r\n assert_nothing_raised() do\r\n \r\n assert(@connection.execute_immediate( 'insert into sales_test values(1)' ) == 1 )\r\n \r\n end\r\n @connection.close\r\n end", "title": "" }, { "docid": "378925f3c409c20ebc1630d87e64d416", "score": "0.5565114", "text": "def sql_for_insert(sql, pk, binds)\n unless pk == false || pk.nil? || pk.is_a?(Array) || pk.is_a?(String)\n sql = \"#{sql} RETURNING #{quote_column_name(pk)} INTO :returning_id\"\n (binds = binds.dup) << ActiveRecord::Relation::QueryAttribute.new(\"returning_id\", nil, Type::OracleEnhanced::Integer.new)\n end\n super\n end", "title": "" }, { "docid": "0704286d30d450e681fb3096aebf3e26", "score": "0.5564126", "text": "def create_sequence(name, start_val = SEQ_DFLT_START_VAL)\n raise ActiveRecordError, \"sequence start value <= 0\" if start_val <= 0\n ensure_sequences_table unless @@seqs_table_exists\n sql = \"INSERT INTO #{SEQS_DFLT_TBL_NAME}(SEQ_NAME, SEQ_NEXT_VAL) VALUES ('#{name.upcase}', #{start_val})\"\n @connection.do(sql)\n end", "title": "" }, { "docid": "6062a750ce077c92c342506c622449f6", "score": "0.5562909", "text": "def create! value = 1, increment_by = 1\n create = JDBCHelper::SQL.check(\n \"create sequence #{name} start with #{value} increment by #{increment_by}\")\n @connection.update(create)\n self\n end", "title": "" }, { "docid": "a9d0d7d0d3b4443b57efa19b38747916", "score": "0.5560685", "text": "def create_sequence_statement(model, property)\n \"CREATE SEQUENCE #{quote_column_name(sequence_name(model, property))}\"\n end", "title": "" }, { "docid": "b6ee557f1e69ce9c64fd9f2f01f3953e", "score": "0.5559413", "text": "def insert_record(table, values)\n sweeper.ping\n result = super\n sweeper.ping\n result\n end", "title": "" }, { "docid": "0f6706d6768b412075b76ffec3c494c2", "score": "0.55589145", "text": "def sequence_id\n return @sequence_id\n end", "title": "" }, { "docid": "c62f5c839143b07e933a812ec4b09006", "score": "0.5557843", "text": "def insert_sql(sql, klass)\n str = ''\n\n if klass.ann(klass.primary_key, :sequence)\n str << \"@#{klass.primary_key} = store.last_insert_id(#{klass})\\n\"\n end\n\n str << \"store.exec \\\"#{sql}\\\"\"\n\n return str\n end", "title": "" }, { "docid": "f8e837359a1a181790a67aa853d1d36c", "score": "0.5555545", "text": "def post_insert(sql, name, pk, id_value, sequence_name)\n if @iiEnabled\n begin\n @connection.do(enable_identity_insert(@iiTable, false))\n rescue Exception => e\n raise ActiveRecordError, \"IDENTITY_INSERT could not be turned off\"\n end\n end\n end", "title": "" }, { "docid": "f8e837359a1a181790a67aa853d1d36c", "score": "0.5555545", "text": "def post_insert(sql, name, pk, id_value, sequence_name)\n if @iiEnabled\n begin\n @connection.do(enable_identity_insert(@iiTable, false))\n rescue Exception => e\n raise ActiveRecordError, \"IDENTITY_INSERT could not be turned off\"\n end\n end\n end", "title": "" }, { "docid": "765c04b851559733464934b00bd431db", "score": "0.55524296", "text": "def insert\n DATABASE.execute(\"INSERT INTO temperaments (temperament) VALUES ('#{@temperament}')\")\n @id = DATABASE.last_insert_row_id\n end", "title": "" }, { "docid": "f4d83adc3830832600fbbfe288e2245a", "score": "0.5550767", "text": "def db_log_start(test_name)\r\n # time = Time.new\r\n # teststarted= \"#{time.year}-#{time.month}-#{time.day} #{time.hour}:#{time.min}\"\r\n # client = TinyTds::Client.new username: 'svc_cdm', password: 'password', dataserver: 'dexd5080.hr-applprep.de', database: 'automation'\r\n\r\n\r\n # newQuery = \"insert into results (test_name)\r\n # values(\\\"#{test_name}\\\");\"\r\n\r\n # results = client.execute(newQuery)\r\n # results.do\r\n # newQuery = \"SELECT top 1 id FROM results ORDER BY id DESC;\"\r\n\r\n # results2 = client.execute(newQuery)\r\n\r\n # id =\"\"\r\n # results2.each(:as => :array) do |row|\r\n # id= \"#{row[0]}\"\r\n # end\r\n\r\n # @util.logging(\"----->Test run Id = #{id}\")\r\n # @util.logging(\"View http://dexw5171.hr-applprep.de:8000/specifictest?#{id}\")\r\n # client.close\r\n return 1\r\n end", "title": "" }, { "docid": "b4d675ff9c3e4ba4219f3922837d4876", "score": "0.5546331", "text": "def create \n @batch = Batch.find(params[:id])\n @sequence = @batch.create_sequence(params[:sequence]) \n if @sequence.save\n flash[:notice] = 'Sequence Details Added'\n redirect_to sequence_path(:id =>@batch.id) \n end\n end", "title": "" }, { "docid": "b695afab3369410b4e1467f464f1fe8d", "score": "0.5543043", "text": "def insert(sql, name = nil, pk = nil, id_value = nil, sequence_name = nil) #:nodoc:\n puts \"SQL -> #{sql.inspect}\" if FB_TRACE\n execute(sql, name)\n id_value || pk\n end", "title": "" }, { "docid": "499839a4b15ac24935802cbaf07f58d0", "score": "0.5541547", "text": "def save\n sql = \"INSERT INTO #{table_name_for_insert} (#{col_names_for_insert}) VALUES (#{values_for_insert})\"\n DB[:conn].execute(sql)\n @id = DB[:conn].execute(\"SELECT last_insert_rowid() FROM #{table_name_for_insert}\")[0][0]\n end", "title": "" }, { "docid": "ef1947b8d52ede7747004905f5337f09", "score": "0.55398095", "text": "def save()\n sql = \"\n INSERT INTO tickets\n (customer_id, film_id, screening_id)\n VALUES\n ($1, $2, $3)\n RETURNING id;\n \"\n values = [@customer_id, @film_id, @screening_id]\n hash = SqlRunner.run(sql, values)\n @id = hash[0]['id']\n end", "title": "" }, { "docid": "0468a484cc509e0ddd859b6ff7b5e40b", "score": "0.55375546", "text": "def insert\n sql_command=\"INSERT INTO users (user_name, office_num) VALUES ('#{@user_name}', '#{@office_num}')\"\n DATABASE.execute(sql_command)\n \n @user_id = DATABASE.last_insert_row_id\n\n # sql_command_pop_order_table = \"INSERT INTO orders (user_id) VALUES ('#{@user_id}')\"\n# DATABASE.execute(sql_command_pop_order_table)\n end", "title": "" }, { "docid": "64a1932c5b6e8cbdc09eb8624445d579", "score": "0.5533128", "text": "def exec_insert(sql, name, binds, pk = nil, sequence_name = nil)\n exec_query(sql, name, binds)\n end", "title": "" }, { "docid": "912af9c123d01ea759d950bf4c47cf65", "score": "0.55289805", "text": "def save()\n sql = \"INSERT INTO collection (artist_name, collection_title, genre) VALUES ($1, $2, $3) RETURNING id;\"\n values = [@artist_name, @collection_title, @genre]\n result = SqlRunner.run(sql, values)\n @id = result[0]['id'].to_i\nend", "title": "" } ]
1ad303a4f631184eac46a9cdc7c04f73
POST /measurements POST /measurements.xml
[ { "docid": "d7ab061b514c5e9e259de64c451f81a1", "score": "0.5439311", "text": "def create\n unless current_user.measurements.find_date(params[:measure_date]).nil?\n update_all\n else\n @measurement = Measurement.new(params[:measurement])\n @measurement.user = current_user\n respond_to do |format|\n unless params[:commit] == 'Cancel'\n if @measurement.save\n flash[:notice] = 'Measurement was successfully created.'\n format.html { redirect_to dashboards_path }\n format.xml { render :xml => @measurement, :status => :created, :location => @measurement }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @measurement.errors, :status => :unprocessable_entity }\n end\n else\n format.html { redirect_to dashboards_path }\n format.xml { head :ok }\n end\n end\n end\n end", "title": "" } ]
[ { "docid": "e3892cf2e81c3cea927f65d6cdb67204", "score": "0.6839911", "text": "def measurements_post(opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: MeasurementApi#measurements_post ...\"\n end\n \n # resource path\n path = \"/measurements\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'access_token'] = opts[:'access_token'] if opts[:'access_token']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json']\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 = ['application/json']\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 = @api_client.object_to_http_body(opts[:'body'])\n \n\n auth_names = ['quantimodo_oauth2']\n result = @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 :return_type => 'inline_response_200_13')\n if Configuration.debugging\n Configuration.logger.debug \"API called: MeasurementApi#measurements_post. Result: #{result.inspect}\"\n end\n return result\n end", "title": "" }, { "docid": "38fa3c082e6a5c5b80f88fea6ee7361a", "score": "0.64548784", "text": "def create\n @measurement = Measurement.new(params[:measurement])\n\n respond_to do |format|\n if @measurement.save\n flash[:notice] = 'Measurement was successfully created.'\n format.html { redirect_to(@measurement) }\n format.xml { render :xml => @measurement, :status => :created, :location => @measurement }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @measurement.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "239c47aa2310e7cded409fa8dc41de6b", "score": "0.64170283", "text": "def measurement_params\n params.require(:measurement).permit(:value, :datetime, :sensor_id)\n end", "title": "" }, { "docid": "f6c2e3ef55eb5f7edb2cfac4ff6d18cd", "score": "0.63517386", "text": "def create\n\n @measurement = Measurement.new(measurement_params)\n\n respond_to do |format|\n if @measurement.save\n format.html { redirect_to @measurement, notice: 'Measurement was successfully created.' }\n format.json { render json: @measurement.sensor.beehive, status: :created }\n else\n format.html { render :new }\n format.json { render json: @measurement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d1488130a91c2d03a44cce30e8ab9049", "score": "0.6331235", "text": "def create\n @measurement = Measurement.new(params[:measurement])\n\n respond_to do |format|\n if @measurement.save\n format.html { redirect_to body_measurement_path(@measurement), notice: 'Measurement was successfully created.' }\n format.json { render json: @measurement, status: :created, location: @measurement }\n else\n format.html { render action: \"new\" }\n format.json { render json: @measurement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "142548a05a0a7c335613041468582737", "score": "0.629223", "text": "def create\n @measurement = Measurement.new(measurement_params)\n\n respond_to do |format|\n if @measurement.save\n format.html { redirect_to @measurement, notice: 'Measurement was successfully created.' }\n format.json { render :show, status: :created, location: @measurement }\n else\n format.html { render :new }\n format.json { render json: @measurement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "142548a05a0a7c335613041468582737", "score": "0.629223", "text": "def create\n @measurement = Measurement.new(measurement_params)\n\n respond_to do |format|\n if @measurement.save\n format.html { redirect_to @measurement, notice: 'Measurement was successfully created.' }\n format.json { render :show, status: :created, location: @measurement }\n else\n format.html { render :new }\n format.json { render json: @measurement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ec7e090b1deb5d283dfdcd2542fdc78a", "score": "0.61396533", "text": "def create\n @measurement = Measurement.new(correct_parameters_for_mongo)\n\n respond_to do |format|\n if @measurement.save\n format.html { redirect_to @measurement, notice: \"Measurement was successfully created.\" }\n format.json { render :show, status: :created, location: @measurement }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @measurement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d9775e3ceb8574f1a887845492056757", "score": "0.60665536", "text": "def measurement_params\n params.require(:measurement).permit(:station, :value_type, :measured_at, :measured_value, :active)\n end", "title": "" }, { "docid": "cc793ce80ee0b296618e1b9a94e3d93e", "score": "0.6046449", "text": "def measurement_params\n params.require(:measurement).permit(:date, part_measurements_attributes: [:name, :unit, :value,\n measurement_doc_attributes: [:check_up_id],\n measurement_home_attributes: [:patient_id]])\n end", "title": "" }, { "docid": "8bea669a08898cc86e09bce92b70cde2", "score": "0.596039", "text": "def create\n @part_measurement = PartMeasurement.new(part_measurement_params)\n\n respond_to do |format|\n if @part_measurement.save\n puts @part_measurement.value\n format.html { redirect_to @part_measurement, notice: 'Part measurement was successfully created.' }\n format.json { render :show, status: :created, location: @part_measurement }\n else\n format.html { render :new }\n format.json { render json: @part_measurement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5eb3c9004bef05c69d9abcc212bee501", "score": "0.5909258", "text": "def measurement_params\n params.require(:measurement).permit(:data, :user_id, :type, :dt)\n end", "title": "" }, { "docid": "8ae2521e7cc8089d9b2955f2a6a33d4c", "score": "0.58895946", "text": "def create\n authorize! :view, Measurement\n\n @measurement = Measurement.new(measurement_params)\n\n respond_to do |format|\n if @measurement.save\n format.html { redirect_to @measurement, notice: 'Measurement was successfully created.' }\n format.json { render :show, status: :created, location: @measurement }\n else\n format.html { render :new }\n format.json { render json: @measurement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "11ea9381ef06cb3de277942d9786b887", "score": "0.5857455", "text": "def create\n @body_measurement = BodyMeasurement.new(body_measurement_params)\n\n respond_to do |format|\n if @body_measurement.save\n format.html { redirect_to @body_measurement, notice: 'Body measurement was successfully created.' }\n format.json { render action: 'show', status: :created, location: @body_measurement }\n else\n format.html { render action: 'new' }\n format.json { render json: @body_measurement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6d2e04ba430bf32673853ccf275b91f7", "score": "0.58290577", "text": "def create\n @body_measurement = BodyMeasurement.new(body_measurement_params)\n respond_to do |format|\n if @body_measurement.save\n format.html { redirect_to profile_router_path, notice: 'Measurements Saved' }\n format.json { render :show, status: :created, location: @body_measurement }\n else\n format.html { render :new }\n format.json { render json: @body_measurement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6e492b9dab9cc3e66088375955ee69ac", "score": "0.58172", "text": "def create\n @k_measurement = KMeasurement.new(k_measurement_params)\n\n respond_to do |format|\n if @k_measurement.save\n format.html { redirect_to @k_measurement, notice: 'K measurement was successfully created.' }\n format.json { render action: 'show', status: :created, location: @k_measurement }\n else\n format.html { render action: 'new' }\n format.json { render json: @k_measurement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1e5a71e9c228f6d3d360d8959142bdad", "score": "0.58005786", "text": "def measurement_params\n params.require(:measurement).permit(:temperature, :humidity, :lightLevel, :device_id)\n end", "title": "" }, { "docid": "f8117c0b6c43db803bac1c12d8a3cfbf", "score": "0.5779691", "text": "def post_measurement_mobile\n\t\tif !params[:value].nil? and !params[:card_id].nil? and !params[:measure_type_id].nil?\n\t\t\t@measurement = Measurement.new(measurement_mobile)\n\t\t\tif @measurement.save\n\t\t\t\trender json: {status: \"success\" }\n\t\t\telse\n\t\t\t\trender json: {status: \"failure\" }\n\t\t\tend\n\t\telse\n\t\t\trender json: {status: \"failure\" }\n\t\tend\n\tend", "title": "" }, { "docid": "1807169235e750d7b52d6ad160130965", "score": "0.576937", "text": "def create\n @standard_measurement = StandardMeasurement.new(params[:standard_measurement])\n\n respond_to do |format|\n if @standard_measurement.save\n format.html { redirect_to @standard_measurement, notice: 'Standard measurement was successfully created.' }\n format.json { render json: @standard_measurement, status: :created, location: @standard_measurement }\n else\n format.html { render action: \"new\" }\n format.json { render json: @standard_measurement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8844044e0a05717cafd773f51c5ad382", "score": "0.57691115", "text": "def create\n @measurement = current_user.measurements.new(params[:measurement])\n\n respond_to do |format|\n \n if ( params[:water_percent] == \"\" && params[:comment] == \"\" && params[:visceral_fat] == \"\" && params[:is_goal] == \"0\" && params[:belly] == \"\" && params[:calf] == \"\" && params[:muscle_percent] == \"\" && params[:chest] == \"\" && params[:weight] == \"\" && params[:hip] ==\"\" && params[:thigh] ==\"\" && params[:resting_metabolism] ==\"\" && params[:fat_percent] == \"\" && params[:neck] == \"\" && params[:bicep] == \"\" )\n flash[:notice] = 'Your Measurement was not updated.'\n format.html { render :action => \"new\" } \n elsif @measurement.save\n flash[:notice] = 'Measurement was successfully created.'\n format.html { redirect_to(measurements_path) }\n else\n flash[:notice] = 'Your Measurement was not updated.'\n format.html { render :action => \"new\" }\n end\n end\n end", "title": "" }, { "docid": "7710a0df5baa69b4afeeb436e148a0bc", "score": "0.57357645", "text": "def measurement_params\n params.require(:measurement).permit(:instrument_id, :parameter, :value, :unit, :measured_at, :test, :end, :trim_id)\n end", "title": "" }, { "docid": "03df69359c299008b72c54f0008d3226", "score": "0.5672695", "text": "def body_measurement_params\n params.require(:body_measurement).permit(:measurementDate, :occurrence, :weight, :bodyFat)\n end", "title": "" }, { "docid": "6a156a57a54dab72488178c884b39670", "score": "0.56395024", "text": "def create\n @running_measurement = RunningMeasurement.new(running_measurement_params)\n\n respond_to do |format|\n if @running_measurement.save\n format.html { redirect_to @running_measurement, notice: 'Running measurement was successfully created.' }\n format.json { render action: 'show', status: :created, location: @running_measurement }\n else\n format.html { render action: 'new' }\n format.json { render json: @running_measurement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8379cc760f610a3c720514fd310d7bb2", "score": "0.56336087", "text": "def create\n @city_measurement = CityMeasurement.new(params[:city_measurement])\n\n respond_to do |format|\n if @city_measurement.save\n format.html { redirect_to @city_measurement, notice: 'City measurement was successfully created.' }\n format.json { render json: @city_measurement, status: :created, location: @city_measurement }\n else\n format.html { render action: \"new\" }\n format.json { render json: @city_measurement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5354532c95d0cfb87b95234655682d8e", "score": "0.5633496", "text": "def measurements_get(opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: MeasurementApi#measurements_get ...\"\n end\n \n # resource path\n path = \"/measurements\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'access_token'] = opts[:'access_token'] if opts[:'access_token']\n query_params[:'user_id'] = opts[:'user_id'] if opts[:'user_id']\n query_params[:'client_id'] = opts[:'client_id'] if opts[:'client_id']\n query_params[:'connector_id'] = opts[:'connector_id'] if opts[:'connector_id']\n query_params[:'variable_id'] = opts[:'variable_id'] if opts[:'variable_id']\n query_params[:'source_id'] = opts[:'source_id'] if opts[:'source_id']\n query_params[:'start_time'] = opts[:'start_time'] if opts[:'start_time']\n query_params[:'value'] = opts[:'value'] if opts[:'value']\n query_params[:'unit_id'] = opts[:'unit_id'] if opts[:'unit_id']\n query_params[:'original_value'] = opts[:'original_value'] if opts[:'original_value']\n query_params[:'original_unit_id'] = opts[:'original_unit_id'] if opts[:'original_unit_id']\n query_params[:'duration'] = opts[:'duration'] if opts[:'duration']\n query_params[:'note'] = opts[:'note'] if opts[:'note']\n query_params[:'latitude'] = opts[:'latitude'] if opts[:'latitude']\n query_params[:'longitude'] = opts[:'longitude'] if opts[:'longitude']\n query_params[:'location'] = opts[:'location'] if opts[:'location']\n query_params[:'created_at'] = opts[:'created_at'] if opts[:'created_at']\n query_params[:'updated_at'] = opts[:'updated_at'] if opts[:'updated_at']\n query_params[:'error'] = opts[:'error'] if opts[:'error']\n query_params[:'limit'] = opts[:'limit'] if opts[:'limit']\n query_params[:'offset'] = opts[:'offset'] if opts[:'offset']\n query_params[:'sort'] = opts[:'sort'] if opts[:'sort']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json']\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 = ['application/json']\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 = ['quantimodo_oauth2']\n result = @api_client.call_api(:GET, 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 => 'inline_response_200_13')\n if Configuration.debugging\n Configuration.logger.debug \"API called: MeasurementApi#measurements_get. Result: #{result.inspect}\"\n end\n return result\n end", "title": "" }, { "docid": "8330239346eb17e8088d5d5de030830b", "score": "0.5621047", "text": "def get_measurements\n render json: @data_source.measurements\n end", "title": "" }, { "docid": "0d5bb0294b4982650196df9a8b4317e5", "score": "0.56178427", "text": "def create\n @measurement = Measurement.new( measurement_params )\n\n # TODO \n unless @measurement.save\n render status: 500, json: @measurement.errors.full_messages\n end\n \n data = {\n circles: @measurement.circles.to_json \n }\n render status: :ok, json: @measurement if @measurement.valid?\n \n end", "title": "" }, { "docid": "5a3cff24a2a64fda62cc20f621d93c8c", "score": "0.56176347", "text": "def new\n @measurement = Measurement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @measurement }\n end\n end", "title": "" }, { "docid": "5a3cff24a2a64fda62cc20f621d93c8c", "score": "0.56176347", "text": "def new\n @measurement = Measurement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @measurement }\n end\n end", "title": "" }, { "docid": "027f003827d6749e3f4932f879194543", "score": "0.55691624", "text": "def create\n @unit_of_measure = UnitOfMeasure.create(params[:unit_of_measure])\n get_data\n end", "title": "" }, { "docid": "8bfd8273a5220b3d6824015f305c887f", "score": "0.5531785", "text": "def measurement_params\n params.require(:measurement).permit(:measurement_area_id, :width, :height, :length)\n end", "title": "" }, { "docid": "aef2619264e54279c98314e4abb5b2f2", "score": "0.5526786", "text": "def create\n @user_measurement = UserMeasurement.new(user_measurement_params)\n @user_measurement.user_id = current_user.id\n\n respond_to do |format|\n if @user_measurement.save\n format.html { redirect_to @user_measurement, notice: 'User measurement was successfully created.' }\n format.json { render action: 'show', status: :created, location: @user_measurement }\n else\n format.html { render action: 'new' }\n format.json { render json: @user_measurement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eb486b264c7137bf98643d7f97d50a62", "score": "0.54146296", "text": "def k_measurement_params\n params.require(:k_measurement).permit(:timestamp, :k1, :k2, :axis, :white_to_white, :pupil_x, :pupil_y, :pupil_rx, :pupil_ry, :pupil_q, :limbus_x, :limbus_y, :limbus_rx, :limbus_ry, :limbus_q, :cr_x, :cr_y, :cr_q, :patient_id)\n end", "title": "" }, { "docid": "9261bbcbd67994e49ce3354af2f15ca5", "score": "0.5411495", "text": "def measure_params\n params.require(:measure).permit(:temp_out, :temp_in, :humidity_out, :humidity_in, :pump_status)\n end", "title": "" }, { "docid": "504060c16478fcf8f737cbb29a9889f8", "score": "0.5381015", "text": "def part_measurement_params\n params.require(:part_measurement).permit(:name, :unit, :value)\n end", "title": "" }, { "docid": "7da79fb1ac8e7133771a9b0167faf87c", "score": "0.5368247", "text": "def get_measurements\r\n logger.debug params.length\r\n result=nil\r\n if params.length >= 5\r\n site_id=params[0]\r\n measureList=params[1]\r\n channelList=params[2]\r\n start_dt=params[3]\r\n stop_dt=params[4]\r\n result=_get_measurements(site_id,\r\n measureList, channelList,start_dt, stop_dt)\r\n end\r\n respond_to do |format|\r\n format.html\r\n format.xml { render :xml => result.to_x }\r\n format.amf { \r\n logger.debug \"Returning result\"\r\n logger.debug \"Returning #{result}\"\r\n render :amf => result \r\n }\r\n end\r\n end", "title": "" }, { "docid": "6cb697006d74ff755364aaa91c89534e", "score": "0.5366329", "text": "def index\n @measurements = Measurement.all\n end", "title": "" }, { "docid": "6cb697006d74ff755364aaa91c89534e", "score": "0.5366329", "text": "def index\n @measurements = Measurement.all\n end", "title": "" }, { "docid": "6cb697006d74ff755364aaa91c89534e", "score": "0.5366329", "text": "def index\n @measurements = Measurement.all\n end", "title": "" }, { "docid": "d4043d198be046d42878a2df2f1ecaf4", "score": "0.5364144", "text": "def create\n @measurment = Measurment.new(measurment_params)\n\n respond_to do |format|\n if @measurment.save\n format.html { redirect_to @measurment, notice: 'Measurment was successfully created.' }\n format.json { render :show, status: :created, location: @measurment }\n else\n format.html { render :new }\n format.json { render json: @measurment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4452f9b56ddc1a0cb239d92d051e8aca", "score": "0.5360895", "text": "def set_measurement\n @measurement = Measurement.find(params[:id])\n end", "title": "" }, { "docid": "67b310d7f60c070526aae65f85daad51", "score": "0.5355551", "text": "def weather_measure_params\n params.require(:weather_measure).permit(:temperature, :pressure, :humidity, :rainfall)\n end", "title": "" }, { "docid": "f672bd3e40798d5f38787f4309ac623e", "score": "0.53460026", "text": "def sensor_params\n params.require(:sensor).permit(:name, :location, :value)\n end", "title": "" }, { "docid": "0d3adc28c8eed5c7cdde7c3a2efc5468", "score": "0.53398854", "text": "def sensor_data_params\n params.require(:sensor_data).permit(:user_id_id, :position, :time, :measurement)\n end", "title": "" }, { "docid": "aaa9c6284104bae1aee60c63b5fd6702", "score": "0.53381586", "text": "def user_measurement_params\n params.require(:user_measurement).permit(:user_id, :measurement_id, :value, :value_string, :note, :date, :unix_date)\n end", "title": "" }, { "docid": "1cad18f87d72c7955640e7cd1923ac7a", "score": "0.5337731", "text": "def create\n @weather_measure = WeatherMeasure.new(weather_measure_params)\n\n respond_to do |format|\n if @weather_measure.save\n format.html { redirect_to @weather_measure, notice: 'Weather measure was successfully created.' }\n format.json { render :show, status: :created, location: @weather_measure }\n else\n format.html { render :new }\n format.json { render json: @weather_measure.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9366566c1541f756e2adb073c6bd763f", "score": "0.53340536", "text": "def create\n @sensor_datum = SensorDatum.new(sensor_datum_params)\n\n create_save(@sensor_datum, \"Sensor datum\")\n end", "title": "" }, { "docid": "6f1e7a5df1c01d6ff23d9f4c38f87a41", "score": "0.5332792", "text": "def transmit_data\n body = {body: {datum:{data_type:\"float\", value: rand, virtual_entity_id: 1}}}\n self.class.post(API+'/data', body)\n end", "title": "" }, { "docid": "03eb16fa91504c4e4456353a109702c2", "score": "0.53270704", "text": "def create\n @measure = @attribute.attribute_measures.new(measure_params)\n if @measure.save\n render json: @measure, status: :created, location: entity_attribute_measure_url(@entity, @attribute, @measure)\n else\n render json: @measure.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "e0528145292626c1d88bddc3f82c34b4", "score": "0.53261757", "text": "def create\n\t \t@measurement = Measurement.new(measurement_params)\n\t \t@card = Card.find_by(protege_id: protege.id)\n\t \t@measurement.card_id = @card.id.to_i\n\n\t \tif @measurement.save\n\t \t\t@measurement.id = @measurement.measure_type_id\n\t \t\tflash[:success] = \"Pomyślnie dodano do kartoteki\"\n\t \t\tredirect_to measurement_path(id:@measurement.id.to_i)\n\t \telse\n\t \t\tflash[:danger] = \"Podana wartość nie jest liczbą\"\n\t \t\tredirect_to measurement_path(id:@measurement.measure_type_id.to_i)\n\t \tend\n\tend", "title": "" }, { "docid": "fb514d3eff58cd9dfc63a36b87c9f4b4", "score": "0.5313669", "text": "def create\n @measure = Measure.new(measure_params)\n\n respond_to do |format|\n if @measure.save\n format.html { redirect_to @measure, notice: 'Measure was successfully created.' }\n format.json { render :show, status: :created, location: @measure }\n else\n format.html { render :new }\n format.json { render json: @measure.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0eeedba56f02879b9f302ef86b9b5d0f", "score": "0.53097194", "text": "def create\n @measure = Measure.new(params[:measure])\n\n respond_to do |format|\n if @measure.save\n format.html { redirect_to @measure, notice: 'Measure was successfully created.' }\n format.json { render json: @measure, status: :created, location: @measure }\n else\n format.html { render action: 'new' }\n format.json { render json: @measure.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "59c61d233e496df0f3151e5ca350d533", "score": "0.5302676", "text": "def create\n @pupil_measurement = PupilMeasurement.new(pupil_measurement_params)\n\n respond_to do |format|\n if @pupil_measurement.save\n format.html { redirect_to @pupil_measurement, notice: \"Pupil measurement was successfully created.\" }\n format.json { render :show, status: :created, location: @pupil_measurement }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @pupil_measurement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1ab337a0fffb61bddb846d927663ebc1", "score": "0.5302576", "text": "def v2_measurements_request_xls_post(opts = {})\n data, _status_code, _headers = v2_measurements_request_xls_post_with_http_info(opts)\n return data\n end", "title": "" }, { "docid": "f6ae8bcbfbde671d962cb17480269a06", "score": "0.5291894", "text": "def create\n @gios_measurment = GiosMeasurment.new(gios_measurment_params)\n\n respond_to do |format|\n if @gios_measurment.save\n format.html { redirect_to @gios_measurment, notice: 'Gios measurment was successfully created.' }\n format.json { render :show, status: :created, location: @gios_measurment }\n else\n format.html { render :new }\n format.json { render json: @gios_measurment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "433a933329b8dbb14e140185ab34b599", "score": "0.52710015", "text": "def url_create\n\n # secure the creation of new measurements\n if @profile.secure_data_entry\n unless @profile.data_entry_key == params[:key]\n return\n end\n end\n \n\n # Are the data submitted in this query a test?\n is_test_value = false\n if params.key?(:test)\n is_test_value = true\n end\n \n # Save the url that invoked us\n Instrument.update(params[:instrument_id], :last_url => request.original_url)\n\n # Create an array containing the names of legitimate variable names\n measured_at_parameters = Array.new\n variable_shortnames = Array.new\n \n Instrument.find(params[:instrument_id]).vars.each do |var|\n measured_at_parameters.push(var.measured_at_parameter)\n variable_shortnames.push(var.shortname)\n \n # see if the parameter was submitted\n \n if params.include? var.shortname\n\n if params.key?(var.measured_at_parameter)\n measured_at = params[var.measured_at_parameter]\n elsif params.key?(var.at_parameter)\n measured_at = params[var.at_parameter]\n elsif params[:at]\n measured_at = params[:at]\n else \n measured_at = Time.now \n end\n # Create a new measurement\n @measurement = Measurement.new(\n :measured_at => measured_at,\n :instrument_id => params[:instrument_id], \n :test => is_test_value,\n :parameter => var.shortname, \n :value => params[var.shortname])\n @measurement.save\n end\n end\n\n respond_to do |format|\n if @measurement.save\n format.json { render text: \"OK\" }\n format.html { render :show, status: :created, location: @measurement, message: \"Measurement created\" }\n else\n format.html { render :new }\n format.json { render json: @measurement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3c033bafec4d54002d5d6a633337d99e", "score": "0.52689826", "text": "def postReadings(info, state)\r\n params = {\r\n :device_id => info.deviceId,\r\n :sensor_data => [\r\n {\r\n :type => \"Temperature\",\r\n :value => state.temperature,\r\n :time => Time.now.to_i\r\n },\r\n {\r\n :type => \"Humidity\",\r\n :value => state.humidity,\r\n :time => Time.now.to_i\r\n }\r\n ]\r\n }\r\n res = apiPostJson(\"readings\", params)\r\n if res.status != 201\r\n $LOG.warn(\"Failed to post readings to backend! Status: #{res.status}, Response: #{res.body}\")\r\n end\r\n end", "title": "" }, { "docid": "91435838ea6a9af735b47935544c237a", "score": "0.52689415", "text": "def set_measurement\n @measurement = Measurement.find(params[:id])\n end", "title": "" }, { "docid": "91435838ea6a9af735b47935544c237a", "score": "0.52689415", "text": "def set_measurement\n @measurement = Measurement.find(params[:id])\n end", "title": "" }, { "docid": "91435838ea6a9af735b47935544c237a", "score": "0.52689415", "text": "def set_measurement\n @measurement = Measurement.find(params[:id])\n end", "title": "" }, { "docid": "91435838ea6a9af735b47935544c237a", "score": "0.52689415", "text": "def set_measurement\n @measurement = Measurement.find(params[:id])\n end", "title": "" }, { "docid": "91435838ea6a9af735b47935544c237a", "score": "0.52689415", "text": "def set_measurement\n @measurement = Measurement.find(params[:id])\n end", "title": "" }, { "docid": "91435838ea6a9af735b47935544c237a", "score": "0.52689415", "text": "def set_measurement\n @measurement = Measurement.find(params[:id])\n end", "title": "" }, { "docid": "bd4233f5eb7171004c5d11d7c373affa", "score": "0.5267296", "text": "def create\n @sensor_data = SensorData.new(sensor_data_params)\n\n respond_to do |format|\n if @sensor_data.save\n format.html { redirect_to @sensor_data, notice: 'Sensor data was successfully created.' }\n format.json { render :show, status: :created, location: @sensor_data }\n else\n format.html { render :new }\n format.json { render json: @sensor_data.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "715d5fc6981f7fccce6abd5ce0460e7d", "score": "0.5258608", "text": "def new\n @measurement = Measurement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @measurement }\n end\n end", "title": "" }, { "docid": "89dcfd477f3f24b7f208dc49caa8aa06", "score": "0.5256874", "text": "def forwardSensorValues\n logger.debug \"This is my params: \"+params[\"data\"][\"temperature\"].to_s\n logger.debug \"This is my params: \"+params[\"data\"][\"temperature\"].to_s\n rp = params[\"data\"][\"temperature\"].to_i + 1\n respond_to do |format|\n format.json {render :json => { :value => rp }.to_json}\n end\n if !@@sockets[params[\"serialPort\"]]\n create_socket(params[\"serialPort\"])\n end\n @@sockets[params[\"serialPort\"]].write(params[\"data\"].to_json)\n end", "title": "" }, { "docid": "ccfacaba0f61b7b831fbb64e4830c84c", "score": "0.52436346", "text": "def measurements=(value)\n if value == @defaults['measurements']\n @values.delete 'measurements' if @values.key? 'measurements'\n else\n @values['measurements'] = value\n end\n end", "title": "" }, { "docid": "9933be904be4d4577d2e1c7f0fa4c947", "score": "0.52302533", "text": "def v2_measurements_request_xls_post_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: MeasurementsApi.v2_measurements_request_xls_post ...\"\n end\n # resource path\n local_var_path = \"/v2/measurements/request_xls\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'access_token'] = opts[:'access_token'] if opts[:'access_token']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['quantimodo_oauth2']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Integer')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: MeasurementsApi#v2_measurements_request_xls_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "392c0624e886174e6ceb3a11cf51575c", "score": "0.52262104", "text": "def meter_params\n params.require(:meter).permit(:start_date, :end_date, :readings)\n end", "title": "" }, { "docid": "41465b1439a74830c2aa5840cb00c40e", "score": "0.52219874", "text": "def measurements_request_csv_post(opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: MeasurementApi#measurements_request_csv_post ...\"\n end\n \n # resource path\n path = \"/measurements/request_csv\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'access_token'] = opts[:'access_token'] if opts[:'access_token']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json']\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 = ['application/json']\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 = ['quantimodo_oauth2']\n result = @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 :return_type => 'Integer')\n if Configuration.debugging\n Configuration.logger.debug \"API called: MeasurementApi#measurements_request_csv_post. Result: #{result.inspect}\"\n end\n return result\n end", "title": "" }, { "docid": "43d53979ce262db486c760d0df5fafd7", "score": "0.521011", "text": "def sensor_datum_params\n params.require(:sensor_datum).permit(:sensor_find_id, :timestamp, :data)\n end", "title": "" }, { "docid": "b706a75ccfe5fedd8a282de759dd0ae2", "score": "0.52021384", "text": "def create\n @sensor = Sensor.new(sensor_params)\n\n respond_to do |format|\n if @sensor.save\n format.html { redirect_to @sensor, notice: 'Sensor was successfully created.' }\n format.json { render json: @sensor, status: :created }\n else\n format.html { render action: 'new' }\n format.json { render json: @sensor.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bd443b11b25abf6e586b2eea8c79baf4", "score": "0.51995", "text": "def create\n @measle = Measle.new(measle_params)\n\n respond_to do |format|\n if @measle.save\n format.html { redirect_to @measle, notice: 'Measle was successfully created.' }\n format.json { render :show, status: :created, location: @measle }\n else\n format.html { render :new }\n format.json { render json: @measle.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f5b856b3cf85e5431091c1700533b048", "score": "0.5198069", "text": "def create\n @unit_measure = UnitMeasure.new(unit_measure_params)\n\n respond_to do |format|\n if @unit_measure.save\n format.html { redirect_to @unit_measure, notice: 'Unit measure was successfully created.' }\n format.json { render :show, status: :created, location: @unit_measure }\n else\n format.html { render :new }\n format.json { render json: @unit_measure.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "95c790c328b94691c785e685cf61258b", "score": "0.5186254", "text": "def create\n if doctor_signed_in? or user_signed_in? or admin_signed_in?\n @measurement = Measurement.new(measurement_params)\n\n respond_to do |format|\n if @measurement.save\n flash[:notice] = 'Meritev je bila kreirana'\n if admin_signed_in?\n format.html { redirect_to controller: :admins, action: :sifranti }\n else\n format.html { redirect_to controller: :measurements, action: :new }\n end\n else\n format.html { render :new }\n format.json { render json: @measurement.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "title": "" }, { "docid": "de0d59100f1cd34667e4d00d83536ced", "score": "0.5164706", "text": "def update\n @measurement = current_user.measurements.find(params[:id])\n\n respond_to do |format|\n if @measurement.update_attributes(params[:measurement])\n flash[:notice] = 'Measurement was successfully updated.'\n format.html { redirect_to(measurements_path) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @measurement.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f0112a297624c7a9b3e8ca247cda8a2b", "score": "0.51627785", "text": "def measurements\n return @values['measurements'] if @values.key?('measurements')\n @values['measurements'] = {}\n @values['measurements']\n end", "title": "" }, { "docid": "97897839010bd592aee4cfba63e3f9c0", "score": "0.51573014", "text": "def measurements_id_put(id, opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: MeasurementApi#measurements_id_put ...\"\n end\n \n # verify the required parameter 'id' is set\n fail \"Missing the required parameter 'id' when calling measurements_id_put\" if id.nil?\n \n # resource path\n path = \"/measurements/{id}\".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'access_token'] = opts[:'access_token'] if opts[:'access_token']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json']\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 = ['application/json']\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 = @api_client.object_to_http_body(opts[:'body'])\n \n\n auth_names = ['quantimodo_oauth2']\n result = @api_client.call_api(:PUT, 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 => 'inline_response_200_2')\n if Configuration.debugging\n Configuration.logger.debug \"API called: MeasurementApi#measurements_id_put. Result: #{result.inspect}\"\n end\n return result\n end", "title": "" }, { "docid": "72cc3165b9851f78351452af997b2ad7", "score": "0.5157075", "text": "def index\n @body_measurements = BodyMeasurement.all\n end", "title": "" }, { "docid": "57de3c067896211e2ebf5bcf22f710d0", "score": "0.51558924", "text": "def update\n @measurement = Measurement.find(params[:id])\n\n respond_to do |format|\n if @measurement.update_attributes(params[:measurement])\n flash[:notice] = 'Measurement was successfully updated.'\n format.html { redirect_to(@measurement) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @measurement.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6c10f73f32fa236a862029377de8a90a", "score": "0.51467955", "text": "def create\n @measure = current_user.account.measures.new(params[:measure])\n\n respond_to do |format|\n if @measure.save\n flash[:notice] = 'Measure was successfully created.'\n format.html { redirect_to(@measure) }\n format.xml { render :xml => @measure, :status => :created, :location => @measure }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @measure.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "33a9975da26529784b17d7f387ddcd68", "score": "0.5144334", "text": "def create\n @measurement_log = MeasurementLog.new(params[:measurement_log])\n @measurement_log.user = current_account\n respond_to do |format|\n if @measurement_log.save\n format.html { redirect_to(measurements_path, :notice => 'Measurement log was successfully created.') }\n format.xml { render :xml => @measurement_log, :status => :created, :location => @measurement_log }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @measurement_log.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2f22f5b36a707c4d0f1247a646a83020", "score": "0.5132833", "text": "def index\n @measurements = current_user.nil? ? nil : current_user.measurements\n respond_to do |format|\n format.html { render :action => \"index\" }\n format.xml { render :xml => @measurements }\n end\n end", "title": "" }, { "docid": "0872bfce8c7380bfc5720e61b74c9cb2", "score": "0.51323795", "text": "def create\n @meteo_datum = MeteoDatum.new(meteodatum_params)\n @meteo_datum.weather_station_id = params[:weather_station_id]\n\n if @meteo_datum.save\n render json: @meteo_datum, status: :created\n else\n render json: @meteo_datum.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "6e609626441a5f719f8eb9a9c2d1c035", "score": "0.5129903", "text": "def create\n @temperature_sensor = TemperatureSensor.new(params[:temperature_sensor])\n\n respond_to do |format|\n if @temperature_sensor.save\n format.html { redirect_to @temperature_sensor, :notice => 'Temperature sensor was successfully created.' }\n format.json { render :json => @temperature_sensor, :status => :created, :location => @temperature_sensor }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @temperature_sensor.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1a60584400fb7a10023afdd3bda5ec9d", "score": "0.51260495", "text": "def measurement_type_params\n params.require(:measurement_type).permit(:name, :units, :description)\n end", "title": "" }, { "docid": "f9d5cb2bc525e2e4eb1d92ff5622e718", "score": "0.5119479", "text": "def measurements\n @measurements ||= []\n end", "title": "" }, { "docid": "818a668461eacd121f2fc6d20b8482b0", "score": "0.51096356", "text": "def post endpoint, data\n do_request :post, endpoint, data\n end", "title": "" }, { "docid": "9b6c6d10a4d48b619febf6622743e195", "score": "0.5107246", "text": "def post_query( xml )\n url = URI.parse( self.url )\n response = self.http.post_form( url, { \"query\" => xml } )\n return response.body\n end", "title": "" }, { "docid": "8a07895c3b64576eff697657716823a4", "score": "0.51015764", "text": "def create\n @tank = @user.tanks.find(params[:tank_id])\n sensor = Sensor.find(params[:reading][:sensor_id])\n @reading = ReadingService.create_manual_reading(@user, sensor, params[:reading][:date], params[:hour], params[:minute], params[:value])\n respond_to do |format| \n if @reading.save!\n format.js { }\n else\n format.js { render json: @reading.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2b09009eca64fe6a9cec479253d663e2", "score": "0.5095122", "text": "def create\n @staff_measurement = StaffMeasurement.new(staff_measurement_params)\n\n respond_to do |format|\n if @staff_measurement.save\n format.html { redirect_to @staff_measurement, notice: (t 'staff_measurements.title')+(t 'actions.created')}\n format.json { render action: 'show', status: :created, location: @staff_measurement }\n else\n format.html { render action: 'new' }\n format.json { render json: @staff_measurement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b02fd3878dec5897427ae6d83465e1f4", "score": "0.508582", "text": "def observation_params\n params.require(:observation).permit(:user_id, :location_id, :specie_id, :resource_id, :access, :approved, :resource_secondary_id, measurements_attributes: [:id, :user_id, :trait_id, :standard_id, :methodology_id, :value, :value_type, :valuetype_id, :precisiontype_id, :precision_type, :precision, :precision_upper, :replicates, :measurement_description, :_destroy])\n end", "title": "" }, { "docid": "f138f781f9ddc6d297b15ef0c2f679c4", "score": "0.50828", "text": "def create\n data = []\n trace_params.each do |p|\n hash = {\n latitude: p[\"latitude\"],\n longitude: p[\"longitude\"]\n }\n data << hash\n end\n\n if Trace.upload_data(data)\n render json: {status: 'OK'}\n else\n render json: @trace.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "f82c4d753058c9468d96c1b3adffd2ae", "score": "0.5082048", "text": "def create\n @dbh_measurement = DbhMeasurement.new(dbh_measurement_params)\n\n respond_to do |format|\n if @dbh_measurement.save\n format.html { redirect_to @dbh_measurement, notice: 'Dbh measurement was successfully created.' }\n format.json { render json: @dbh_measurement, status: :created }\n else\n format.html { render action: 'new' }\n format.json { render json: @dbh_measurement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "76580d7ffaf6027b6cc69e385561d856", "score": "0.5077106", "text": "def create\n @sensor = Sensor.new(sensor_params)\n\n respond_to do |format|\n if @sensor.save\n flash[:success] = 'Sensor was successfully created.'\n format.html { redirect_to @sensor }\n format.json { render json: @sensor, status: :created }\n else\n format.html { render action: 'new' }\n format.json { render json: @sensor.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f6cc26910819bd4b10ebb6bf5abda429", "score": "0.5069404", "text": "def post_evaluate(excon, body)\n excon.request(\n method: :post,\n path: '/evaluate',\n headers: { 'Content-Type' => 'application/json' },\n body: body\n )\nend", "title": "" }, { "docid": "682d7924f84fae99951285a1f25b0153", "score": "0.50645804", "text": "def measurements_for_upload\n list = []\n timestamp = Time.now.to_i \n max_age = timestamp - 14 * 60 * 60 * 24 # 14 days old\n\n sql = \"SELECT id, value, temperature, noise, created_at, \" + \n \"uploaded_pvoutput \" +\n \"FROM measurements \" +\n \"WHERE uploaded_pvoutput IS NOT 1 AND created_at < ? \" +\n \"AND created_at > ?\"\n\n if @config['skip_zero_upload']\n sql += \" AND value > 0\"\n end\n\n @db.execute(sql, timestamp, max_age) do |row|\n @measurement = Measurement.new\n @measurement.id = row[0]\n @measurement.value = row[1]\n @measurement.temperature = row[2]\n @measurement.noise = row[3]\n @measurement.created_at = row[4]\n @measurement.uploaded_pvoutput = row[5]\n\n list << @measurement\n end\n list\n end", "title": "" }, { "docid": "1555fc75fb8c673c75dfabb899541ce1", "score": "0.50597686", "text": "def iot_datum_params\n params.require(:iot_datum).permit(:workbench_number, :part_number, :target, :lot_size, :employee_name, :employee_id, :shift, :device_id, :count, :status)\n end", "title": "" }, { "docid": "fb3e7401bba83bcaa01647175d935246", "score": "0.50591964", "text": "def create\n @measure_instance = MeasureInstance.new(measure_instance_params)\n\n respond_to do |format|\n if @measure_instance.save\n format.html { redirect_to @measure_instance, notice: 'Measure instance was successfully created.' }\n format.json { render action: 'show', status: :created, location: @measure_instance }\n else\n format.html { render action: 'new' }\n format.json { render json: @measure_instance.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "62476181908371890789ff562804dd6c", "score": "0.5054709", "text": "def update\n respond_to do |format|\n if @measurement.update(measurement_params)\n format.html { redirect_to @measurement, notice: 'Measurement was successfully updated.' }\n format.json { render :show, status: :ok, location: @measurement }\n else\n format.html { render :edit }\n format.json { render json: @measurement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
09f002cb4b2785237f27da1447d2ecc1
DELETE /prezzos/1 DELETE /prezzos/1.json
[ { "docid": "79f28292025716803ee59dbafff20114", "score": "0.6800706", "text": "def destroy\n @prezzo.destroy\n respond_to do |format|\n format.html { redirect_to prezzos_url, notice: 'Prezzo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.70942205", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": "9cb14f1d65d414aec1e90b4706219b74", "score": "0.70344085", "text": "def destroy\n @prepod = Prepod.find(params[:id])\n @prepod.destroy\n\n respond_to do |format|\n format.html { redirect_to prepods_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "7452c4d15daf08108aaa5a1b728adb31", "score": "0.6934796", "text": "def destroy\n @json.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "b445c184893647d3482f8fbc6a507a52", "score": "0.692821", "text": "def delete(path, params = {})\n path += '.json'\n res = @connection.delete(path, @header)\n parse_response(res)\n end", "title": "" }, { "docid": "0b24cbc6495df3923ea7679acbcd8deb", "score": "0.68587035", "text": "def delete_floor_plan(args = {}) \n delete(\"/files.json/floorplan/images\", args)\nend", "title": "" }, { "docid": "9106867cee9e8775ba817195d3bc2020", "score": "0.6823636", "text": "def delete_rest(path) \n run_request(:DELETE, create_url(path)) \n end", "title": "" }, { "docid": "75a785bddc2252b3dfe08070dcb44399", "score": "0.6814322", "text": "def delete(args)\n if args[:json]\n post(args.merge(method: :delete))\n else\n get(args.merge(method: :delete))\n end\n end", "title": "" }, { "docid": "773e5d611adeb09776f9c841e1b876cc", "score": "0.6800429", "text": "def delete_json(path, params = {}, headers = {})\n json_request(:delete, path, params, headers)\n end", "title": "" }, { "docid": "179ff0053e8f4f967cb3d92206094cf0", "score": "0.67916656", "text": "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "title": "" }, { "docid": "016ae6e07604cbcab8207a1df80bf1ef", "score": "0.67717177", "text": "def destroy\n @pre.destroy\n respond_to do |format|\n format.html { redirect_to pres_url, notice: 'Pre was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2763b840acb5262d9f3917f99f60f53f", "score": "0.67621565", "text": "def destroy\n @prepa.destroy\n respond_to do |format|\n format.html { redirect_to prepas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "822ddea2e45bf78350003645efcbdb54", "score": "0.6752211", "text": "def delete uri, args = {}; Request.new(DELETE, uri, args).execute; end", "title": "" }, { "docid": "506393cb5b1185455c36cd0efef16d79", "score": "0.67283714", "text": "def destroy\n @prestamo = Prestamo.find(params[:id])\n @prestamo.destroy\n\n respond_to do |format|\n format.html { redirect_to prestamos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "506393cb5b1185455c36cd0efef16d79", "score": "0.67283714", "text": "def destroy\n @prestamo = Prestamo.find(params[:id])\n @prestamo.destroy\n\n respond_to do |format|\n format.html { redirect_to prestamos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "33ae3fbaabb68170de9f95477c22d5d1", "score": "0.672193", "text": "def delete_json(path)\n retries = 0\n begin\n return resource(path).delete()\n rescue => e\n if e.kind_of?(RestClient::Exception) and e.http_code == 503 and retries < RETRY_503_MAX\n # the G5K REST API sometimes fail with error 503. In that case we should just wait and retry\n puts(\"G5KRest: DELETE #{path} failed with error 503, retrying after #{RETRY_503_SLEEP} seconds\")\n retries += 1\n sleep RETRY_503_SLEEP\n retry\n end\n handle_exception(e)\n end\n end", "title": "" }, { "docid": "153ef2b38b3dc6f815102a24eab8aa7a", "score": "0.67208743", "text": "def destroy\n @preco_servico.destroy\n respond_to do |format|\n format.html { redirect_to preco_servicos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ba67ebd85114998e01be10599c8943ca", "score": "0.6716891", "text": "def delete(path)\n RestClient.delete request_base+path\n end", "title": "" }, { "docid": "c43f7595ed0463e05d88a637d3b6be3d", "score": "0.67137265", "text": "def destroy\n @precliente = Precliente.find(params[:id])\n @precliente.destroy\n respond_to do |format|\n format.html { redirect_to preclientes_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "00c90bc63b0302afbbc4b2979ae20b57", "score": "0.66846657", "text": "def api_delete(path, data = {})\n api_request(:delete, path, :data => data).parsed\n end", "title": "" }, { "docid": "15c557e98152343c00483bb2655c9fcf", "score": "0.6680794", "text": "def destroy\n @precio = Precio.find(params[:id])\n @precio.destroy\n\n respond_to do |format|\n format.html { redirect_to precios_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "57b799133d29316426c358002043baa2", "score": "0.667819", "text": "def delete_rest(path, headers={}) \n run_request(:DELETE, create_url(path), headers) \n end", "title": "" }, { "docid": "93446b08e23133418b008f67e022c5e5", "score": "0.665972", "text": "def destroy\n @predepend.destroy\n respond_to do |format|\n format.html { redirect_to predepends_url, notice: 'Predepend was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "03e5a62bff0dd4689fb06edf58ac0e57", "score": "0.6654391", "text": "def destroy\n @prey = Prey.find(params[:id])\n @prey.destroy\n\n respond_to do |format|\n format.html { redirect_to preys_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9c8ef0b4313fef9d26c4290371bc530d", "score": "0.66490287", "text": "def delete!\n client.delete(:path => base_path)\n nil\n end", "title": "" }, { "docid": "2fa0a3656e86962ca1a10fa31aede189", "score": "0.6618389", "text": "def destroy\n @productos_json.destroy\n respond_to do |format|\n format.html { redirect_to productos_jsons_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b069af6ed882aa3d1229f80526b92fa0", "score": "0.6617802", "text": "def destroy\n @presencia = Presencia.find(params[:id])\n @presencia.destroy\n\n respond_to do |format|\n format.html { redirect_to presencia_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "a3c541f14459e116655c873dfe7c85f3", "score": "0.6590012", "text": "def v3_delete(path)\n # Expire cached objects from here on down\n expire_matching \"#{parent_path(path)}.*\"\n # Create request parameters\n delete_params = { \n :method => \"delete\" \n }\n # Request\n v3_do_request(delete_params, path)\n end", "title": "" }, { "docid": "3785c43327d9b7850cd8d54c588fe466", "score": "0.6581954", "text": "def destroy\n @preparat.destroy\n respond_to do |format|\n format.html { redirect_to preparats_url, notice: 'Информация о препарате была успешно удалена.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3ccd2fbecbaa95071b33c865c59c07fc", "score": "0.6552768", "text": "def delete(*args)\n RubyKong::Request::Api.delete args[0]\n end", "title": "" }, { "docid": "47a3c9c28e1fcd0fcae5ea58416b42bd", "score": "0.65350693", "text": "def delete(path)\n api :delete, path\n end", "title": "" }, { "docid": "0f491c02a31ae6a221fafb8ba4f6f988", "score": "0.6529945", "text": "def destroy\n @prezzi.destroy\n respond_to do |format|\n format.html { redirect_to prezzis_url, notice: 'Prezzi was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "40e7a0ef9f08a9482534e2e1f92eff79", "score": "0.65272975", "text": "def destroy\n @prestamo.destroy\n respond_to do |format|\n format.html { redirect_to prestamos_url, notice: 'Prestamo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4c1c164b581dbae14285797e584e8fb7", "score": "0.65241694", "text": "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "title": "" }, { "docid": "8705ffb9658cfacd55a9417b94505ca7", "score": "0.65204185", "text": "def destroy\n @predica = Predica.find(params[:id])\n @predica.destroy\n\n respond_to do |format|\n format.html { redirect_to predicas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f10ec797a3271c529c643f1ddc60c092", "score": "0.6511846", "text": "def destroy\r\n @client1.destroy\r\n respond_to do |format|\r\n format.html { redirect_to client1s_url }\r\n format.json { head :no_content }\r\n end\r\n end", "title": "" }, { "docid": "174b723f9e43bfa7501a9cdc389e4c1b", "score": "0.6509394", "text": "def delete\n @response = self.class.delete(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\")\n end", "title": "" }, { "docid": "9dd790c02a5ce3b1a66861c3f9e23778", "score": "0.6505857", "text": "def destroy\n @prazo = Prazo.find(params[:id])\n @prazo.destroy\n\n respond_to do |format|\n format.html { redirect_to prazos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4e218cb848bc03c05b46c07528ba21f8", "score": "0.65044314", "text": "def destroy\n @prescription = Prescription.find(params[:id])\n @prescription.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "44674a2d8e31b28ede6b0d8edfff421e", "score": "0.6494265", "text": "def destroy!\n freeze\n \n result = JSON.parse(RestClient.delete(File.join(uri, \"?rev=#{ rev }\")))\n \n result[\"ok\"]\n end", "title": "" }, { "docid": "c53a7ddfb5f66bdab62b1fc4305a0473", "score": "0.6485997", "text": "def delete *args\n make_request :delete, *args\n end", "title": "" }, { "docid": "e3ea90f717278b79d8908e5b537926be", "score": "0.648534", "text": "def delete(path)\n client.delete(\"/v1/#{encode_path(path)}\")\n return true\n end", "title": "" }, { "docid": "1691790ee2ee34cc8e6be6f7bb8d7f8d", "score": "0.6468601", "text": "def delete\n client.delete uri\n end", "title": "" }, { "docid": "1691790ee2ee34cc8e6be6f7bb8d7f8d", "score": "0.6468601", "text": "def delete\n client.delete uri\n end", "title": "" }, { "docid": "0d7990d57112329f96a2d0e29b3723b4", "score": "0.6468456", "text": "def destroy!\n freeze\n \n result = JSON.parse(RestClient.delete(uri))\n \n result[\"ok\"]\n end", "title": "" }, { "docid": "c062641bed95297a1f5e06f6a7986101", "score": "0.64649165", "text": "def destroy\n @prueba1 = Prueba1.find(params[:id])\n @prueba1.destroy\n\n respond_to do |format|\n format.html { redirect_to prueba1s_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "cfd05f8a3dc9cc6cf533f1b2463ced65", "score": "0.6462586", "text": "def destroy\n @reclamo.destroy\n respond_to do |format|\n format.html { redirect_to reclamos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "98571bdac58e36aa94455667781a4838", "score": "0.6462002", "text": "def destroy\n @prestep = Prestep.find(params[:id])\n @prestep.destroy\n\n respond_to do |format|\n format.html { redirect_to recipe_path(@prestep.recipe_id) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c1cde2518cb592b6add14fe05ae1b37d", "score": "0.6461853", "text": "def delete\n options = self.to_h \n uri = self.class.path_builder(:delete, self.id)\n data = {}\n data['id'] = self.id \n data = data.to_json\n VivialConnect::Client.instance.make_request('DELETE', uri, data)\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.64607555", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.64607555", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.64607555", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "a265194ef14d8a6ba6b3571e4e0dc332", "score": "0.6459948", "text": "def destroy\n @pregao.destroy\n respond_to do |format|\n format.html { redirect_to pregaos_url, notice: 'Pregão excluído com sucesso.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "db2fb619c0b20785ba61d8bbd0643177", "score": "0.6449252", "text": "def destroy\n @premiere.destroy\n respond_to do |format|\n format.html { redirect_to premieres_url, notice: 'Premiere was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2148e2fd9383c12872890f51efee3615", "score": "0.64458835", "text": "def delete\n begin\n task_id = \"#{@file}\".gsub(/\\.\\/singularity\\//, \"\").gsub(/\\.json/, \"\")\n # delete the request\n RestClient.delete \"#{@uri}/api/requests/request/#{task_id}\"\n puts \"#{task_id} DELETED\"\n rescue\n puts \"#{task_id} #{$!.response}\"\n end\n end", "title": "" }, { "docid": "3fe54c3cd295c6151785b7802e16fcd9", "score": "0.6444794", "text": "def destroy\n @apodo = Apodo.find(params[:id])\n @apodo.destroy\n\n respond_to do |format|\n format.html { redirect_to apodos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0879ade66bdab83e51e8da609fb6b45b", "score": "0.6444653", "text": "def destroy\n @resposta = Resposta.find(params[:id])\n @resposta.destroy\n\n respond_to do |format|\n format.html { redirect_to respostas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f245bcabc83c5d69181fc839e9c33b4f", "score": "0.6443639", "text": "def destroy\n @ocupacion = Ocupacion.find(params[:id])\n @ocupacion.destroy\n\n respond_to do |format|\n format.html { redirect_to ocupacions_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "03f9c088c87210a8a2d63a70d1fdf593", "score": "0.6443195", "text": "def destroy\n @resto.destroy\n respond_to do |format|\n format.html { redirect_to restos_url, notice: 'Resto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "09f6303f18ce5612216026bdd448d644", "score": "0.6439138", "text": "def api_delete(path)\n api_request(Net::HTTP::Delete.new(path))\n end", "title": "" }, { "docid": "6782ef11d1d5fd990cf98b5774a9f63c", "score": "0.64385426", "text": "def destroy\n @prelaunch = Prelaunch.find(params[:id])\n @prelaunch.destroy\n\n respond_to do |format|\n format.html { redirect_to prelaunches_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "49b1b48f8497506da88cfaa43c12466a", "score": "0.6436027", "text": "def destroy\n @prestamo_instrumento = PrestamoInstrumento.find(params[:id])\n @prestamo_instrumento.destroy\n\n respond_to do |format|\n format.html { redirect_to prestamo_instrumentos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ac6ce581a27e69d0fc21ae3d9c02ce26", "score": "0.64246064", "text": "def delete\n self.class.headers 'Authorization' => \"OAuth #{ENV['sfdc_token']}\"\n self.class.headers 'Content-Type' => \"application/json\"\n response = self.class.delete(SObject.root_url+\"/sobjects/#{@object_name}/#{@Id}\")\n raise response.parsed_response[0]['message'] if response.code.to_i > 299\n nil\n end", "title": "" }, { "docid": "22713b9bc13bc70f873f11851843fd2d", "score": "0.6422722", "text": "def destroy\n @restaurent.destroy\n respond_to do |format|\n format.html { redirect_to restaurents_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b9ec212f62402c26e0f73d4d5a7d4eca", "score": "0.64177626", "text": "def _delete(path, isD2l = true, headers = {})\n headers[:content_type] = :json\n auth_uri = path\n auth_uri = create_authenticated_uri(path, 'DELETE') if isD2l == true\n RestClient.delete(auth_uri, headers)\nend", "title": "" }, { "docid": "bd01164c6edd3314ec13ec01f586fae8", "score": "0.6410517", "text": "def destroy\n @pelicula = Pelicula.find(params[:id])\n @pelicula.destroy\n render json: {message: 'Eliminated'}, status: :ok\n\n end", "title": "" }, { "docid": "2d5fa404dda08682a0023029820346ad", "score": "0.6408742", "text": "def destroy\n @prelaunch.destroy\n respond_to do |format|\n format.html { redirect_to prelaunches_url, notice: 'Prelaunch was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5df0f46057bf97b13d699284b6fe55d4", "score": "0.64058685", "text": "def delete\n status 404\n nil\n end", "title": "" }, { "docid": "30f120e207763cf5017ea8d4ac9ce00c", "score": "0.6405461", "text": "def destroy\n @rice1.destroy\n respond_to do |format|\n format.html { redirect_to rice1s_url, notice: 'Rice1 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9e18e0be5823e2372a6bfc21f246c53e", "score": "0.6404381", "text": "def destroy\n @presenca.destroy\n respond_to do |format|\n format.html { redirect_to presencas_url, notice: 'Presenca was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6e261a4744e811459c7431ab5fc4c3fb", "score": "0.6394094", "text": "def destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d2375b11675de0e152de07976b50e9c7", "score": "0.6393689", "text": "def delete_request(url, queries)\n results = @@client.delete url, queries\n results.to_json\nend", "title": "" }, { "docid": "6a19ba99f0d1f7225b5ed73fe068136d", "score": "0.63911766", "text": "def delete(path, params: {}, headers: {})\n request_json :delete, path, params, headers\n end", "title": "" }, { "docid": "0387aa3c568d857184e97a214e580a14", "score": "0.63864493", "text": "def delete(path, params = {}, payload = {})\n JSON.parse Generic.delete(@base_url, @headers, path, params, payload)\n end", "title": "" }, { "docid": "8a67da3c0a80239b790a14b51d559de9", "score": "0.6386428", "text": "def destroy\n render json: @api_v1_client if @api_v1_client.destroy\n end", "title": "" }, { "docid": "4d3aec9078b542e2abfbc5dc422a2706", "score": "0.63809437", "text": "def destroy\n @orcamento.destroy\n respond_to do |format|\n format.html { redirect_to orcamentos_url }\n format.json { head :no_content }\n end\n\n\n end", "title": "" }, { "docid": "b530d57fd1601db5fe49d269dfac029f", "score": "0.63797235", "text": "def delete_rest_call(path, params = nil)\n uri = URI.parse('#{@base_url}#{path}')\n req_path = uri.path\n if params\n uri.query = URI.encode_www_form(params)\n req_path = '#{uri.path}?#{uri.query}'\n end\n request = Net::HTTP::Delete.new(req_path)\n return JSON.parse(send_request(request, uri).body)\n end", "title": "" }, { "docid": "4eadb61943fa9a636cad510bf21db1aa", "score": "0.6379592", "text": "def destroy\n @agronomiadecanato = Agronomiadecanato.find(params[:id])\n @agronomiadecanato.destroy\n\n respond_to do |format|\n format.html { redirect_to agronomiadecanatos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "caef785a365a227d79403972a9e2a170", "score": "0.63773483", "text": "def destroy\n @outro = Outro.find(params[:id])\n @outro.destroy\n\n respond_to do |format|\n format.html { redirect_to outros_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "319db6f8b32d2a9d4cdd6013f99a51d0", "score": "0.6376958", "text": "def destroy\n @orchestra.destroy\n respond_to do |format|\n format.html { redirect_to orchestras_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "77c742322d16bbccac07ab52cc2f42db", "score": "0.63749397", "text": "def delete\n # TODO\n end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.6370549", "text": "def delete; end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.6370549", "text": "def delete; end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.6370549", "text": "def delete; end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.6370549", "text": "def delete; end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.6370549", "text": "def delete; end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.6370549", "text": "def delete; end", "title": "" }, { "docid": "36887f2b24d31f98fbb51687409e73f6", "score": "0.6370549", "text": "def delete; end", "title": "" }, { "docid": "4100b1ba27a9a751bb11d54b45e1aeb1", "score": "0.6369527", "text": "def delete(path);end", "title": "" }, { "docid": "4100b1ba27a9a751bb11d54b45e1aeb1", "score": "0.6369527", "text": "def delete(path);end", "title": "" }, { "docid": "b6db2bfd7e105be65ed231e3d8849af0", "score": "0.63680124", "text": "def destroy\n @tiposuario.destroy\n respond_to do |format|\n format.html { redirect_to tiposuarios_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5c181505ac0deedddfba684db419e428", "score": "0.63676727", "text": "def delete\n render json: Own.delete(params[\"id\"])\n end", "title": "" }, { "docid": "1b2ccbbfd9bdd78601ee75fdf65cd788", "score": "0.6365846", "text": "def destroy\n @premiado.destroy\n respond_to do |format|\n format.html { redirect_to premiados_url, notice: 'Premiado was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4d38ce98ee6d4ace9d7329979e2ab718", "score": "0.6365385", "text": "def delete_command(args)\n id = args.pop\n \n return if !global_parameters_load(args)\n\n begin\n doc = Vuzit::Document.destroy(id)\n puts \"DELETED: #{id}\"\n rescue Vuzit::ClientException => ex\n error \"Error occurred: #{ex.code}, #{ex.message}\" \n end\nend", "title": "" }, { "docid": "0f288f9d0effd35a94a7b70277356fc8", "score": "0.63652146", "text": "def destroy\n @testjson.destroy\n respond_to do |format|\n format.html { redirect_to testjsons_url, notice: 'Testjson was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ef00b1d6157d32d9322acd35185fa932", "score": "0.6364745", "text": "def destroy\n @o_single.destroy\n respond_to do |format|\n format.html { redirect_to url_contents_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4bccb7ee1ddb98667fc5e70cdd42e292", "score": "0.6359184", "text": "def destroy\n @objeto = Objeto.find(params[:id])\n @objeto.destroy\n\n respond_to do |format|\n format.html { redirect_to objetos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "90daf8d90e5f4dac73cdf39e56513785", "score": "0.63571066", "text": "def destroy\n @reup.destroy\n respond_to do |format|\n format.html { redirect_to reups_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fa0e57e3170ba239d3b6a09bcd687605", "score": "0.6356141", "text": "def destroy\n @reino.destroy\n respond_to do |format|\n format.html { redirect_to reinos_url, notice: 'Reino was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f13e2bff5dbe5c9544f28a1aa6e17697", "score": "0.63552666", "text": "def destroy\n @precios_temporal.destroy\n respond_to do |format|\n format.html { redirect_to precios_temporals_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "edfbd9670613278d5b254b59df797611", "score": "0.6354758", "text": "def destroy\n @reo.destroy\n respond_to do |format|\n format.html { redirect_to reos_url, notice: 'Reo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
431f7eeb4e3aec5cfa780844961b289c
This method combines the output of both predicted deaths and speed of spread. This is used because the other two instance methods are private and cannot be called on their own.
[ { "docid": "0aea1ff6270ed24ee8d362f8d72bccff", "score": "0.0", "text": "def virus_effects\n predicted_deaths\n speed_of_spread\n end", "title": "" } ]
[ { "docid": "5a5eb616489297c88972b3b42ba49c91", "score": "0.746386", "text": "def deaths_and_speed\n # We are still perfecting our formula here. The speed is also affected\n # by additional factors we haven't added into this functionality.\n\n #Convert the local variable speed to an instance variable to use in speed_of_spread method.\n @speed = 0.0\n\n # predicted deaths is solely based on population density\n if @population_density >= 200\n @number_of_deaths = (@population * 0.4).floor \n @speed += 0.5 \n elsif @population_density >= 150\n @number_of_deaths = (@population * 0.3).floor\n @speed += 1\n elsif @population_density >= 100\n @number_of_deaths = (@population * 0.2).floor\n @speed += 1.5\n elsif @population_density >= 50\n @number_of_deaths = (@population * 0.1).floor\n @speed += 2\n else\n @number_of_deaths = (@population * 0.05).floor\n @speed += 2.5\n end\n end", "title": "" }, { "docid": "8ae80dc3bf2d44902d41b75322efd717", "score": "0.72349817", "text": "def predicted_deaths\n \n # calls the private method to calculate the number_of_deaths.\n deaths_and_speed\n print \"#{@state} will lose #{@number_of_deaths} people in this outbreak\"\n\n end", "title": "" }, { "docid": "8e2c6b0ccb57b6c9e4d8e7ad4047ace2", "score": "0.70908237", "text": "def virus_effects \n predicted_deaths\n # speed_of_spread\n end", "title": "" }, { "docid": "865affcdc538600f7bcc4195e0d3686b", "score": "0.6854152", "text": "def virus_effects \n predicted_deaths\n speed_of_spread\n end", "title": "" }, { "docid": "1cfbd2733727236fce7a3241b036a240", "score": "0.6783676", "text": "def virus_effects \r\n predicted_deaths\r\n speed_of_spread\r\n end", "title": "" }, { "docid": "7969e5767ac660d958fb6b339e0167fb", "score": "0.6761345", "text": "def virus_effects \n predicted_deaths\n speed_of_spread\n end", "title": "" }, { "docid": "7969e5767ac660d958fb6b339e0167fb", "score": "0.6761345", "text": "def virus_effects \n predicted_deaths\n speed_of_spread\n end", "title": "" }, { "docid": "f97eb826496bcd1c53a6625555ab6804", "score": "0.6727125", "text": "def virus_effects\n predicted_deaths_speed\n # speed_of_spread\n end", "title": "" }, { "docid": "36e3c89ba8ae07097e8c9737b92436bc", "score": "0.67216545", "text": "def virus_effects \n predicted_deaths()\n speed_of_spread()\n end", "title": "" }, { "docid": "0f4826ba0a654900a33f25946d5fa267", "score": "0.6709228", "text": "def virus_effects\n predicted_deaths\n speed_of_spread\n end", "title": "" }, { "docid": "0f4826ba0a654900a33f25946d5fa267", "score": "0.6709228", "text": "def virus_effects\n predicted_deaths\n speed_of_spread\n end", "title": "" }, { "docid": "0f4826ba0a654900a33f25946d5fa267", "score": "0.6709228", "text": "def virus_effects\n predicted_deaths\n speed_of_spread\n end", "title": "" }, { "docid": "0f4826ba0a654900a33f25946d5fa267", "score": "0.6709228", "text": "def virus_effects\n predicted_deaths\n speed_of_spread\n end", "title": "" }, { "docid": "0f4826ba0a654900a33f25946d5fa267", "score": "0.6709228", "text": "def virus_effects\n predicted_deaths\n speed_of_spread\n end", "title": "" }, { "docid": "a2c07a4a682cbc195e47e614c37a545b", "score": "0.67052656", "text": "def virus_effects\n predicted_deaths \n speed_of_spread \n end", "title": "" }, { "docid": "a2c07a4a682cbc195e47e614c37a545b", "score": "0.67052656", "text": "def virus_effects\n predicted_deaths \n speed_of_spread \n end", "title": "" }, { "docid": "a2c07a4a682cbc195e47e614c37a545b", "score": "0.67052656", "text": "def virus_effects\n predicted_deaths \n speed_of_spread \n end", "title": "" }, { "docid": "c32ee57d42f6234d14c84204847d26ac", "score": "0.67023253", "text": "def virus_effects\n predicted_deaths\n #predicted_deaths(@population_density, @population, @state)\n #speed_of_spread(@population_density, @state)\n speed_of_spread\n end", "title": "" }, { "docid": "023e9a6a18b25a5b2484c9b8deba896d", "score": "0.66881424", "text": "def virus_effects\n @deaths = predicted_deaths\n @speed = speed_of_spread\n end", "title": "" }, { "docid": "3b9bbf434a0c123e196b2bfd1e5c1a5a", "score": "0.6688109", "text": "def predicted_deaths\r\n # predicted deaths is solely based on population density\r\n speed = 0\r\n if @population_density >= 200\r\n number_of_deaths = (@population * 0.4).floor\r\n elsif @population_density >= 150\r\n number_of_deaths = (@population * 0.3).floor\r\n elsif @population_density >= 100\r\n number_of_deaths = (@population * 0.2).floor\r\n elsif @population_density >= 50\r\n number_of_deaths = (@population * 0.1).floor\r\n else\r\n number_of_deaths = (@population * 0.05).floor\r\n end\r\n print \"#{@state} will lose #{number_of_deaths} people in this outbreak \"\r\n \r\n end", "title": "" }, { "docid": "638a76484dbf8c2ee794f1ea486a3408", "score": "0.66863173", "text": "def virus_effects\n predicted_deaths\n speed_of_spread\n end", "title": "" }, { "docid": "27c07daed5ba2c64b2f20546f0aad48a", "score": "0.6685981", "text": "def virus_effects #HINT: What is the SCOPE of instance variables?\n predicted_deaths\n speed_of_spread\n # predicted_deaths(@population_density, @population, @state)\n # speed_of_spread(@population_density, @state)\n end", "title": "" }, { "docid": "9c5088d4c248a982a6f2c88450bde9ab", "score": "0.6678913", "text": "def virus_effects\n predicted_deaths # don't need this, it is setup on initilize: (@population_density, @population, @state)\n speed_of_spread #(@population_density, @state)\n end", "title": "" }, { "docid": "290bee692ebb95044eb26423a3fc2a54", "score": "0.66652", "text": "def virus_effects \n predicted_deaths #no arguments needed (@population_density, @population, @state) as method predicted_death works with instance variables\n speed_of_spread #no arguments needed (@population_density, @state) as method predicted_death works with instance variables\n end", "title": "" }, { "docid": "4477435502df8fe1445713d703338cc9", "score": "0.6664287", "text": "def virus_effects\n predicted_deaths # all of these arguments are redundant because instance vairables can be accessed by any method in the class and so do not have to be passed in for access. the same is true for predicted_deaths speed_of-Spread\n speed_of_spread\n end", "title": "" }, { "docid": "af8487139bd936ffd7e09e98ef42c602", "score": "0.6660697", "text": "def predicted_deaths\n speed = 0.0\n if @population_density >= 200\n number_of_deaths = (@population * 0.4).floor\n speed += 0.5\n elsif @population_density >= 150\n number_of_deaths = (@population * 0.3).floor\n speed += 1\n elsif @population_density >= 100\n number_of_deaths = (@population * 0.2).floor\n speed += 1.5\n elsif @population_density >= 50\n number_of_deaths = (@population * 0.1).floor\n speed += 2\n else \n number_of_deaths = (@population * 0.05).floor\n speed += 2.5\n end\n \n # modified output return to be easier to read for your scientists. \n # print \"#{@state} will lose #{number_of_deaths} people in this outbreak and will spread across the state in #{speed} months.\\n\\n\"\n print \"#{@state}:\\n Deaths: #{number_of_deaths}\\n Outbreak Period: #{speed} months.\\n\\n\"\n end", "title": "" }, { "docid": "472e6428b319ac529fec8582b7a94055", "score": "0.66573375", "text": "def virus_effects\n predicted_deaths(@population_data, @state)\n speed_of_spread(@population_data, @state)\n end", "title": "" }, { "docid": "0d49e3b2b3ad4c3b25e5c3f7d0aa13c3", "score": "0.66562355", "text": "def virus_effects\n predicted_deaths\n speed_of_spread \n end", "title": "" }, { "docid": "0d49e3b2b3ad4c3b25e5c3f7d0aa13c3", "score": "0.66562355", "text": "def virus_effects\n predicted_deaths\n speed_of_spread \n end", "title": "" }, { "docid": "739f5e12d302180b3a836e692fef662f", "score": "0.6652522", "text": "def predicted_deaths_and_speed_of_spread(population_density, population, state) \n speed = 0.0\n if @population_density >= 200\n number_of_deaths = (@population * 0.4).floor\n speed += 0.5\n elsif @population_density >= 150\n number_of_deaths = (@population * 0.3).floor\n speed += 1\n elsif @population_density >= 100\n number_of_deaths = (@population * 0.2).floor\n speed += 1.5\n elsif @population_density >= 50\n number_of_deaths = (@population * 0.1).floor\n speed += 2\n else \n number_of_deaths = (@population * 0.05).floor\n speed += 2.5\n end\n\n print \"#{@state} will lose #{number_of_deaths} people in this outbreak and will spread across the state in #{speed} months.\\n\\n\"\n end", "title": "" }, { "docid": "be0042d7c7545cd9087eab79d9e19b05", "score": "0.6648047", "text": "def virus_effects\n predicted_deaths #(@population_density, @population, @state)\n # speed_of_spread #(@population_density, @state)\n end", "title": "" }, { "docid": "e9b5eb79394fc456118f28d6833e5ca7", "score": "0.66437453", "text": "def predicted_deaths\r\n # predicted deaths is solely based on population density\r\n speed = 0.0\r\n \r\n if @population_density >= 200\r\n number_of_deaths = (@population * 0.4).floor\r\n speed += 0.5\r\n elsif @population_density >= 150\r\n number_of_deaths = (@population * 0.3).floor\r\n speed += 1\r\n elsif @population_density >= 100\r\n number_of_deaths = (@population * 0.2).floor\r\n speed += 1.5\r\n elsif @population_density >= 50\r\n number_of_deaths = (@population * 0.1).floor\r\n speed += 2\r\n else\r\n number_of_deaths = (@population * 0.05).floor\r\n speed += 2.5\r\n end\r\n\r\n print \"#{@state} will lose #{number_of_deaths} people in this outbreak and will spread across the state in #{speed} months.\\n\\n\"\r\n\r\n end", "title": "" }, { "docid": "d4f700ad9628b10ade3dfdd20817c952", "score": "0.6642541", "text": "def virus_effects\r\n predicted_deaths(@population_density, @population, @state)\r\n speed_of_spread(@population_density, @state)\r\n end", "title": "" }, { "docid": "d4f700ad9628b10ade3dfdd20817c952", "score": "0.6642541", "text": "def virus_effects\r\n predicted_deaths(@population_density, @population, @state)\r\n speed_of_spread(@population_density, @state)\r\n end", "title": "" }, { "docid": "d4f700ad9628b10ade3dfdd20817c952", "score": "0.6642541", "text": "def virus_effects\r\n predicted_deaths(@population_density, @population, @state)\r\n speed_of_spread(@population_density, @state)\r\n end", "title": "" }, { "docid": "d4f700ad9628b10ade3dfdd20817c952", "score": "0.6642541", "text": "def virus_effects\r\n predicted_deaths(@population_density, @population, @state)\r\n speed_of_spread(@population_density, @state)\r\n end", "title": "" }, { "docid": "d4f700ad9628b10ade3dfdd20817c952", "score": "0.6642541", "text": "def virus_effects\r\n predicted_deaths(@population_density, @population, @state)\r\n speed_of_spread(@population_density, @state)\r\n end", "title": "" }, { "docid": "6734c236559bb73e16c34fc9decf9b3a", "score": "0.6638832", "text": "def virus_effects\n predicted_deaths(population_density, population, state)\n speed_of_spread(population_density, state)\n end", "title": "" }, { "docid": "12cc209e399f0420f871597574605e58", "score": "0.662688", "text": "def virus_effects\r\n predicted_deaths\r\n speed_of_spread\r\n output\r\n end", "title": "" }, { "docid": "63c7915af3ebb39060650f7c80e21009", "score": "0.6615463", "text": "def predicted_deaths # removed variables because they exist in initialize/instance variables\r\n # predicted deaths is solely based on population density\r\n population_scaling = 0 #create variable to store scaling for calculating number_of_deaths\r\n # instead of running the number_of_deaths caluclation for every population density\r\n\r\n if @population_density >= 200\r\n population_scaling = 0.4\r\n elsif @population_density >= 150\r\n population_scaling = 0.3\r\n elsif @population_density >= 100\r\n population_scaling = 0.2\r\n elsif @population_density >= 50\r\n population_scaling = 0.1\r\n else\r\n population_scaling = 0.05\r\n end\r\n\r\n number_of_deaths = (@population * population_scaling).floor\r\n\r\n print \"#{@state} will lose #{number_of_deaths} people in this outbreak\"\r\n\r\n end", "title": "" }, { "docid": "368bc4809e11d5d65a6f649dacd5214e", "score": "0.66069555", "text": "def virus_effects\r\n predicted_deaths #(@population_density, @population, @state)\r\n speed_of_spread #(@population_density, @state)\r\n end", "title": "" }, { "docid": "fe7b05751fe9ded7400d5c611ded2716", "score": "0.6606699", "text": "def virus_effects\r\n predicted_deaths\r\n speed_of_spread\r\n end", "title": "" }, { "docid": "0b1cdf2a22d6f0da2591578a4ec6ddc9", "score": "0.6606282", "text": "def predicted_deaths\r\n # predicted deaths is solely based on population density\r\n number_of_deaths = (@population * calc_for_methods([0.4, 0.3, 0.2, 0.1, 0.05])).floor\r\n print \"#{@state} will lose #{number_of_deaths} people in this outbreak\"\r\n\r\n end", "title": "" }, { "docid": "abc1845f13093e91905edd98688e1672", "score": "0.6601954", "text": "def predicted_deaths_with_speed\n speed = 0.0\n\n case @population_density\n when @population_density >= 200\n rate = 0.4\n speed += 0.5\n when @population_density >= 150\n rate = 0.3\n speed += 1\n when @population_density >= 100\n rate = 0.2\n speed += 1.5\n when @population_density >= 50\n rate = 0.1\n speed += 2\n else \n rate = 0.05\n speed += 2.5\n end\n\n puts \"#{@state} will lose #{(@population * rate).floor} people in this outbreak and will spread across the state in #{speed} months.\\n\\n\"\n\n end", "title": "" }, { "docid": "e2e0c74f4ef1a001a39369c6602dfc8a", "score": "0.66017413", "text": "def virus_effects\n predicted_deaths\n speed_of_spread\n end", "title": "" }, { "docid": "725f8a845f38a2539a1fca52a6fbc94d", "score": "0.6598915", "text": "def virus_effects\r\n\r\n predicted_deaths\r\n \r\n speed_of_spread\r\n end", "title": "" }, { "docid": "2765718682c05fa0a317a9b66ad23829", "score": "0.6593304", "text": "def predicted_deaths\n # predicted deaths is solely based on population density\n if @very_dense\n number_of_deaths = death(0.4)\n #number_of_deaths = (@population * 0.4).floor\n elsif @dense\n number_of_deaths = death(0.3)\n # number_of_deaths = (@population * 0.3).floor\n elsif @medium_dense\n number_of_deaths = death(0.2)\n #number_of_deaths = (@population * 0.2).floor\n elsif @low_dense\n number_of_deaths = death(0.1)\n #number_of_deaths = (@population * 0.1).floor\n else\n number_of_deaths = death(0.05)\n #number_of_deaths = (@population * 0.05).floor\n end\n\n print \"#{@state} will lose #{number_of_deaths} people in this outbreak\"\n\n end", "title": "" }, { "docid": "0b4d4f1fcfefbf136d2fb7cf5961732c", "score": "0.6592286", "text": "def virus_effects\n predicted_deaths(@population_density, @population, @state)\n #speed_of_spread(@population_density, @state)\n end", "title": "" }, { "docid": "a0668af4b7b0c85282917b502114b4b0", "score": "0.65914345", "text": "def predicted_deaths_speed\n # predicted deaths is solely based on population density\n \n speed = 0.0\n \n if @population_density >= 200\n number_of_deaths = (@population * 0.4).floor\n speed += 0.5\n elsif @population_density >= 150\n number_of_deaths = (@population * 0.3).floor\n speed += 1\n elsif @population_density >= 100\n number_of_deaths = (@population * 0.2).floor\n speed += 1.5\n elsif @population_density >= 50\n number_of_deaths = (@population * 0.1).floor\n speed += 2\n else\n number_of_deaths = (@population * 0.05).floor\n speed += 2.5\n end\n puts \" and will spread across the state in #{speed} months.\\n\\n\"\n print \"#{@state} will lose #{number_of_deaths} people in this outbreak\"\n \n end", "title": "" }, { "docid": "64f88476a66d3ef81ce462a3ab90a0c0", "score": "0.65900683", "text": "def virus_effects\r\n predicted_deaths #(@population_density, @population, @state)\r\n speed_of_spread #(@population_density, @state)\r\n end", "title": "" }, { "docid": "64f88476a66d3ef81ce462a3ab90a0c0", "score": "0.65900683", "text": "def virus_effects\r\n predicted_deaths #(@population_density, @population, @state)\r\n speed_of_spread #(@population_density, @state)\r\n end", "title": "" }, { "docid": "64f88476a66d3ef81ce462a3ab90a0c0", "score": "0.65900683", "text": "def virus_effects\r\n predicted_deaths #(@population_density, @population, @state)\r\n speed_of_spread #(@population_density, @state)\r\n end", "title": "" }, { "docid": "64f88476a66d3ef81ce462a3ab90a0c0", "score": "0.65900683", "text": "def virus_effects\r\n predicted_deaths #(@population_density, @population, @state)\r\n speed_of_spread #(@population_density, @state)\r\n end", "title": "" }, { "docid": "64f88476a66d3ef81ce462a3ab90a0c0", "score": "0.65900683", "text": "def virus_effects\r\n predicted_deaths #(@population_density, @population, @state)\r\n speed_of_spread #(@population_density, @state)\r\n end", "title": "" }, { "docid": "351997d0ad577ab04e967258aea90cac", "score": "0.65768987", "text": "def virus_effects\r\n predicted_deaths\r\n speed_of_spread\r\n #print \"#{@state} will lose #{@number_of_deaths} people in this outbreak and will spread across the state in #{speed} months.\\n\\n\"\r\n end", "title": "" }, { "docid": "319c3e05522e77028dda628e935f4416", "score": "0.6573205", "text": "def virus_effects #HINT: What is the SCOPE of instance variables?\n # We removed unnecessary parameters from both predicted_deaths and speed_of_spread\n predicted_deaths\n speed_of_spread\n end", "title": "" }, { "docid": "c6b2014c2dd03cabb18ca627a3b42214", "score": "0.6569959", "text": "def virus_effects\n predicted_deaths(@population)\n speed_of_spread\n end", "title": "" }, { "docid": "3e8acf392022171c06c7a08a394c829c", "score": "0.6569752", "text": "def virus_effects #HINT: What is the SCOPE of instance variables? The scope of instance variables is one object. this sets up the variables to figure out the equation for how many numbers of deaths.\n predicted_deaths(@population_density, @population, @state)\n speed_of_spread(@population_density, @state)\n end", "title": "" }, { "docid": "2c11b6275e584f02437e5ea090376d5f", "score": "0.65690446", "text": "def virus_effects\n predicted_deaths\n speed_of_spread\nend", "title": "" }, { "docid": "c7c9254ae0c6617b96246b370d8927a3", "score": "0.6568763", "text": "def predicted_deaths\n # predicted deaths is solely based on population density\n death_toll = (@population * death_multiplier).floor\n puts \"#{@state} will lose #{death_toll} people in this outbreak\"\n end", "title": "" }, { "docid": "142d284a2838faebd6ffbd5a6c621a4a", "score": "0.6567966", "text": "def virus_effects #HINT: What is the SCOPE of instance variables?\n predicted_deaths\n speed_of_spread\n end", "title": "" }, { "docid": "142d284a2838faebd6ffbd5a6c621a4a", "score": "0.6567966", "text": "def virus_effects #HINT: What is the SCOPE of instance variables?\n predicted_deaths\n speed_of_spread\n end", "title": "" }, { "docid": "142d284a2838faebd6ffbd5a6c621a4a", "score": "0.6567966", "text": "def virus_effects #HINT: What is the SCOPE of instance variables?\n predicted_deaths\n speed_of_spread\n end", "title": "" }, { "docid": "142d284a2838faebd6ffbd5a6c621a4a", "score": "0.6567966", "text": "def virus_effects #HINT: What is the SCOPE of instance variables?\n predicted_deaths\n speed_of_spread\n end", "title": "" }, { "docid": "142d284a2838faebd6ffbd5a6c621a4a", "score": "0.6567966", "text": "def virus_effects #HINT: What is the SCOPE of instance variables?\n predicted_deaths\n speed_of_spread\n end", "title": "" }, { "docid": "142d284a2838faebd6ffbd5a6c621a4a", "score": "0.6567646", "text": "def virus_effects #HINT: What is the SCOPE of instance variables?\n predicted_deaths\n speed_of_spread\n end", "title": "" }, { "docid": "f652885150b6517a93fb4659b78e9f80", "score": "0.6565556", "text": "def virus_effects\r\n predicted_deaths(@population_density, @population, @state)\r\n speed_of_spread(@population_density)\r\n end", "title": "" }, { "docid": "58741ab4833af7c37d6edb57f212ec48", "score": "0.6563059", "text": "def virus_effects #HINT: What is the SCOPE of instance variables?\n predicted_deaths(@population_density, @population, @state)\n speed_of_spread(@population_density, @state)\n end", "title": "" }, { "docid": "58741ab4833af7c37d6edb57f212ec48", "score": "0.6563059", "text": "def virus_effects #HINT: What is the SCOPE of instance variables?\n predicted_deaths(@population_density, @population, @state)\n speed_of_spread(@population_density, @state)\n end", "title": "" }, { "docid": "58741ab4833af7c37d6edb57f212ec48", "score": "0.6563059", "text": "def virus_effects #HINT: What is the SCOPE of instance variables?\n predicted_deaths(@population_density, @population, @state)\n speed_of_spread(@population_density, @state)\n end", "title": "" }, { "docid": "58741ab4833af7c37d6edb57f212ec48", "score": "0.6563059", "text": "def virus_effects #HINT: What is the SCOPE of instance variables?\n predicted_deaths(@population_density, @population, @state)\n speed_of_spread(@population_density, @state)\n end", "title": "" }, { "docid": "58741ab4833af7c37d6edb57f212ec48", "score": "0.6563059", "text": "def virus_effects #HINT: What is the SCOPE of instance variables?\n predicted_deaths(@population_density, @population, @state)\n speed_of_spread(@population_density, @state)\n end", "title": "" }, { "docid": "58741ab4833af7c37d6edb57f212ec48", "score": "0.6563059", "text": "def virus_effects #HINT: What is the SCOPE of instance variables?\n predicted_deaths(@population_density, @population, @state)\n speed_of_spread(@population_density, @state)\n end", "title": "" }, { "docid": "58741ab4833af7c37d6edb57f212ec48", "score": "0.6563059", "text": "def virus_effects #HINT: What is the SCOPE of instance variables?\n predicted_deaths(@population_density, @population, @state)\n speed_of_spread(@population_density, @state)\n end", "title": "" }, { "docid": "58741ab4833af7c37d6edb57f212ec48", "score": "0.6563059", "text": "def virus_effects #HINT: What is the SCOPE of instance variables?\n predicted_deaths(@population_density, @population, @state)\n speed_of_spread(@population_density, @state)\n end", "title": "" }, { "docid": "58741ab4833af7c37d6edb57f212ec48", "score": "0.6563059", "text": "def virus_effects #HINT: What is the SCOPE of instance variables?\n predicted_deaths(@population_density, @population, @state)\n speed_of_spread(@population_density, @state)\n end", "title": "" }, { "docid": "0559cf42859278a7923218635eac687e", "score": "0.6550565", "text": "def virus_effects\n \n predicted_deaths\n speed_of_spread\n end", "title": "" }, { "docid": "11a2979e3563f1876685ee88e9f380a9", "score": "0.65455705", "text": "def virus_effects\n predicted_deaths\n speed_of_spread\n end", "title": "" }, { "docid": "197c4703d261b88c181e3841dd82e061", "score": "0.653938", "text": "def virus_effects\n predicted_deaths(@population_density, @population, @state)\n speed_of_spread(@population_density, @state)\n end", "title": "" }, { "docid": "197c4703d261b88c181e3841dd82e061", "score": "0.653938", "text": "def virus_effects\n predicted_deaths(@population_density, @population, @state)\n speed_of_spread(@population_density, @state)\n end", "title": "" }, { "docid": "197c4703d261b88c181e3841dd82e061", "score": "0.653938", "text": "def virus_effects\n predicted_deaths(@population_density, @population, @state)\n speed_of_spread(@population_density, @state)\n end", "title": "" }, { "docid": "197c4703d261b88c181e3841dd82e061", "score": "0.653938", "text": "def virus_effects\n predicted_deaths(@population_density, @population, @state)\n speed_of_spread(@population_density, @state)\n end", "title": "" }, { "docid": "197c4703d261b88c181e3841dd82e061", "score": "0.653938", "text": "def virus_effects\n predicted_deaths(@population_density, @population, @state)\n speed_of_spread(@population_density, @state)\n end", "title": "" }, { "docid": "197c4703d261b88c181e3841dd82e061", "score": "0.653938", "text": "def virus_effects\n predicted_deaths(@population_density, @population, @state)\n speed_of_spread(@population_density, @state)\n end", "title": "" }, { "docid": "197c4703d261b88c181e3841dd82e061", "score": "0.653938", "text": "def virus_effects\n predicted_deaths(@population_density, @population, @state)\n speed_of_spread(@population_density, @state)\n end", "title": "" }, { "docid": "197c4703d261b88c181e3841dd82e061", "score": "0.653938", "text": "def virus_effects\n predicted_deaths(@population_density, @population, @state)\n speed_of_spread(@population_density, @state)\n end", "title": "" }, { "docid": "197c4703d261b88c181e3841dd82e061", "score": "0.653938", "text": "def virus_effects\n predicted_deaths(@population_density, @population, @state)\n speed_of_spread(@population_density, @state)\n end", "title": "" }, { "docid": "197c4703d261b88c181e3841dd82e061", "score": "0.653938", "text": "def virus_effects\n predicted_deaths(@population_density, @population, @state)\n speed_of_spread(@population_density, @state)\n end", "title": "" }, { "docid": "197c4703d261b88c181e3841dd82e061", "score": "0.653938", "text": "def virus_effects\n predicted_deaths(@population_density, @population, @state)\n speed_of_spread(@population_density, @state)\n end", "title": "" }, { "docid": "197c4703d261b88c181e3841dd82e061", "score": "0.653938", "text": "def virus_effects\n predicted_deaths(@population_density, @population, @state)\n speed_of_spread(@population_density, @state)\n end", "title": "" }, { "docid": "197c4703d261b88c181e3841dd82e061", "score": "0.653938", "text": "def virus_effects\n predicted_deaths(@population_density, @population, @state)\n speed_of_spread(@population_density, @state)\n end", "title": "" }, { "docid": "197c4703d261b88c181e3841dd82e061", "score": "0.653938", "text": "def virus_effects\n predicted_deaths(@population_density, @population, @state)\n speed_of_spread(@population_density, @state)\n end", "title": "" }, { "docid": "197c4703d261b88c181e3841dd82e061", "score": "0.653938", "text": "def virus_effects\n predicted_deaths(@population_density, @population, @state)\n speed_of_spread(@population_density, @state)\n end", "title": "" }, { "docid": "197c4703d261b88c181e3841dd82e061", "score": "0.653938", "text": "def virus_effects\n predicted_deaths(@population_density, @population, @state)\n speed_of_spread(@population_density, @state)\n end", "title": "" }, { "docid": "197c4703d261b88c181e3841dd82e061", "score": "0.653938", "text": "def virus_effects\n predicted_deaths(@population_density, @population, @state)\n speed_of_spread(@population_density, @state)\n end", "title": "" }, { "docid": "197c4703d261b88c181e3841dd82e061", "score": "0.653938", "text": "def virus_effects\n predicted_deaths(@population_density, @population, @state)\n speed_of_spread(@population_density, @state)\n end", "title": "" }, { "docid": "197c4703d261b88c181e3841dd82e061", "score": "0.653938", "text": "def virus_effects\n predicted_deaths(@population_density, @population, @state)\n speed_of_spread(@population_density, @state)\n end", "title": "" }, { "docid": "197c4703d261b88c181e3841dd82e061", "score": "0.653938", "text": "def virus_effects\n predicted_deaths(@population_density, @population, @state)\n speed_of_spread(@population_density, @state)\n end", "title": "" }, { "docid": "ca94897246b66dfcff83729a2b48435d", "score": "0.65242374", "text": "def report_mortality_spread\n puts \"#{@state} will lose #{predicted_deaths} people in this outbreak, which will spread across the state in #{speed_of_spread} months.\\n\"\n end", "title": "" }, { "docid": "089a022d3ea3ddcc251031d75219702e", "score": "0.65015554", "text": "def virus_effects\n predicted_deaths\n speed_of_spread\n end", "title": "" }, { "docid": "089a022d3ea3ddcc251031d75219702e", "score": "0.65015554", "text": "def virus_effects\n predicted_deaths\n speed_of_spread\n end", "title": "" } ]
c09594fd8918955d778a156a6eb409b3
Update banner across all translations.
[ { "docid": "717b096f931eafc13d1447d51b26f876", "score": "0.6366463", "text": "def change_banner\n if !in_admin_mode?\n flash_error(:permission_denied.t)\n redirect_to(action: \"list_rss_logs\")\n elsif request.method == \"POST\"\n @val = params[:val].to_s.strip\n @val = \"X\" if @val.blank?\n time = Time.zone.now\n Language.all.each do |lang|\n if (str = lang.translation_strings.where(tag: \"app_banner_box\")[0])\n str.update!(\n text: @val,\n updated_at: (str.language.official ? time : time - 1.minute)\n )\n else\n str = lang.translation_strings.create!(\n tag: \"app_banner_box\",\n text: @val,\n updated_at: time - 1.minute\n )\n end\n str.update_localization\n str.language.update_localization_file\n str.language.update_export_file\n end\n redirect_to(action: \"list_rss_logs\")\n else\n @val = :app_banner_box.l.to_s\n end\n end", "title": "" } ]
[ { "docid": "51bbf43d3c6452a5b4af2fd0ac7a3dcf", "score": "0.6216502", "text": "def change_banner # :root: :norobots:\n if !is_in_admin_mode?\n flash_error(:permission_denied.t)\n redirect_to(action: \"list_rss_logs\")\n elsif request.method == \"POST\"\n @val = params[:val].to_s.strip\n @val = \"X\" if @val.blank?\n time = Time.now\n Language.all.each do |lang|\n if (str = lang.translation_strings.find_all_by_tag(\"app_banner_box\")[0])\n str.update_attributes!(\n text: @val,\n updated_at: (str.language.official ? time : time - 1.minute)\n )\n else\n str = lang.translation_strings.create!(\n tag: \"app_banner_box\",\n text: @val,\n updated_at: time - 1.minute\n )\n end\n str.update_localization\n str.language.update_localization_file\n str.language.update_export_file\n end\n redirect_to(action: \"list_rss_logs\")\n else\n @val = :app_banner_box.l.to_s\n end\n end", "title": "" }, { "docid": "5e224a27762375ff53cc1efac224a5b0", "score": "0.5766133", "text": "def title_banner_phase_update\n if @title_banners && !@title_banners.empty?\n if @tickdown == 200\n @title_banners.each {|banner| banner.move(-250,banner.y,100,20)}\n @header_banner.move(0,0,0,10)\n @tickdown += 1\n elsif @tickdown >= 225\n @tickdown = 0\n dispose_banners\n elsif @waiting > 0\n @waiting -= 1\n @header_banner.update_move\n return\n else\n update_banners \n @tickdown += 1\n end\n end\n end", "title": "" }, { "docid": "768fa92afae24b98ff7333375de7bd65", "score": "0.57465756", "text": "def update\n @banner = Banner.find(params[:id])\n \n respond_to do |format|\n if @banner.update(banner_params)\n format.html { redirect_to @banner, :notice => 'Banner was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @banner.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "353c10efe7d6a51aa20a5ac97cd163d4", "score": "0.5715877", "text": "def after_update(banner)\n expire_cache_for(banner)\n print \"banner sweeper!\"\n end", "title": "" }, { "docid": "2bcf1a19ea998769a21b8fa8fbb8b915", "score": "0.5709327", "text": "def update\n @banner = Banner.find(params[:id])\n\n respond_to do |format|\n if @banner.update_attributes(params[:banner])\n format.html { redirect_to admin_banner_path(@banner), notice: 'Banner was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { redirect_to edit_admin_banner_path(@banner), notice: @banner.errors.full_messages }\n format.json { render json: @banner.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "59a8745b9520375b092b905a95c4bf86", "score": "0.56680197", "text": "def update\n @banner = Banner.find(params[:id])\n\n respond_to do |format|\n if @banner.update_attributes(params[:banner])\n format.html { redirect_to(admin_banners_url, :notice => 'Banner Atualizado com Sucesso') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @banner.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "adf1676520bf2d60e130adf5fb79d8c1", "score": "0.5633502", "text": "def update\n @banner = Banner.find params[:id]\n if @banner.update banner_params\n redirect_to admin_banners_path\n else\n render :action => :edit\n end\n end", "title": "" }, { "docid": "dab972764fc508e0a15822dd9e9b18b1", "score": "0.55921197", "text": "def party_banner_phase_update\n if @banner_phase > 0\n update_banners\n end\n case @banner_phase \n when 1\n @tickdown += 1\n if @tickdown == 20\n @banner_phase = 2 \n transform_red; @tickdown = 0\n end\n when 2\n @tickdown += 1\n if @tickdown == 35 || @removed.empty?\n @banner_phase = 3\n dispose_reds; @tickdown = 0\n end\n when 3\n @tickdown += 1\n if @tickdown == 40\n collapse\n @banner_phase = 4\n @tickdown = 0\n end\n when 4\n @tickdown += 1\n if !@joiners.empty? && @tickdown == 17\n add_joiner(@joiners[0])\n Banner::EnterSound.play\n @tickdown = 0\n elsif @tickdown == 20\n $game_system.menu_disabled = false\n elsif @tickdown == 80\n @banner_phase = 5\n finale; @tickdown = 0\n end\n when 5\n @tickdown += 1\n if @tickdown == 18\n @banner_phase = 6\n banner_sweep; @tickdown = 0\n @header_banner.move(471,-26,255,10)\n end\n when 6\n @tickdown += 1\n if @tickdown == 13\n clear_banners\n $game_temp.remember_banner_phase = [0,0]\n $game_temp.remember_banners[1].clear\n $game_temp.remember_banners[2].clear\n @tickdown = 0\n @banner_phase = 0\n if @title_names && @title_actors\n show_title_banners(@title_names,@title_actors)\n end\n end\n end\n end", "title": "" }, { "docid": "b97dc9f485e66aba60b5e8c17b81bde9", "score": "0.55624336", "text": "def update!(**args)\n @glossary_translations = args[:glossary_translations] if args.key?(:glossary_translations)\n @translations = args[:translations] if args.key?(:translations)\n end", "title": "" }, { "docid": "47c36d5110c16db28da3d44c24ab0eb9", "score": "0.5515928", "text": "def update\n respond_to do |format|\n old_campaign = @banner.campaign\n if @banner.update(banner_params)\n @banner.exchange_attributes.delete_all if @banner.exchange_attributes\n exchange_attributes_params\n notice = 'Banner was successfully updated.' \n # Update bidder for old and new campaign \n if old_campaign and \n ( \n not @banner.campaign or # campaign removed\n not @banner.campaign.id.to_s.eql?(old_campaign.id.to_s) # campaign changed\n )\n then\n puts \"Update previous campaign #{old_campaign.id.to_s}\"\n old_campaign.update_bidder \n end\n if @banner.campaign and not @banner.campaign.update_bidder \n notice += ' <span class=\"text-danger\">Error on bidder synch process. Please try again.</span>'\n end \n format.html { redirect_to @banner, notice: notice }\n format.json { render :show, status: :ok, location: @banner }\n else\n format.html { render :edit }\n format.json { render json: @banner.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5de5c61c18ffdc85a98c26e792daa6d5", "score": "0.54962164", "text": "def update\n @banner = Banner.find(params[:id])\n\n respond_to do |format|\n if @banner.update_attributes(params[:banner])\n format.html { redirect_to admins_banners_url, notice: 'Banner was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @banner.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "be6801c13a90c3932371c056f64ead48", "score": "0.5390184", "text": "def update\n respond_to do |wants|\n if @banner.update_attributes(params[:banner])\n flash[:notice] = 'Страница сохранена.'\n wants.html { redirect_to(admin_banners_url) }\n wants.xml { head :ok }\n else\n wants.html { render :action => \"edit\" }\n wants.xml { render :xml => @banner.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "59697af9725db494af48a72b7fcfeaa5", "score": "0.5388802", "text": "def update\n respond_to do |format|\n if @banner.update(admin_banner_params)\n format.html { redirect_to admin_banners_url, notice: 'banner was successfully updated.' }\n format.json { render :show, status: :ok, location: @banner }\n else\n format.html { render :edit }\n format.json { render json: @banner.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "90e56da37598d8b4632e8bb26db43f2c", "score": "0.5388728", "text": "def translate\n self.translations.destroy\n\n if auto_translate\n google_translate\n bing_translate\n end\n end", "title": "" }, { "docid": "9f796e5afddf2374e0c45199c8d21e3f", "score": "0.53373885", "text": "def update\n params[\"banner\"][\"sale_event_id\"] = nil if params[\"banner\"][\"sale_event_id\"] == \"\"\n @banner = Banner.find(params[:id])\n @types = Banner::TYPES\n\n respond_to do |format|\n if @banner.update_attributes(params[:banner])\n format.html { redirect_to(admin_banners_path, :notice => 'Banner was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @banner.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7bc57bfa736557e05b09d92b9fb3dc11", "score": "0.5333454", "text": "def update\n @screen = session.active_screen\n @form_content_reuse = params[:form_content_reuse]\n\n @label = Label.find(params[:id])\n\n @label.update_attributes(params[:label])\n \n if @label.errors.empty?\n @captions = params[:captions]\n @captions.each do |language_id, caption_name|\n caption = Caption.find(:first ,\n :conditions => {\n :captions => { :label_id => @label.id , :language_id => language_id }\n }\n )\n caption.update_attributes(\n :name => caption_name\n )\n end\n end\n end", "title": "" }, { "docid": "335961c358398912a0fb0cb91e9b31b1", "score": "0.529703", "text": "def translations; end", "title": "" }, { "docid": "7b7dff319cd62f21a6f79433e8d423ad", "score": "0.52931553", "text": "def update\n @site_banner = SiteBanner.find(params[:id])\n\n respond_to do |format|\n if @site_banner.update_attributes(params[:site_banner])\n flash[:notice] = 'SiteBanner was successfully updated.'\n format.html { redirect_to(admin_site_banners_path) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @site_banner.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "06f899e1ad8ad9bf03f19160d1342682", "score": "0.5279561", "text": "def init_translations; end", "title": "" }, { "docid": "44dbc9bf4eb2b9ba200d151b7d8f462d", "score": "0.5238385", "text": "def update\n @bank = Bank.find(params[:id])\n\n @bank.assign_attributes(params[:bank])\n\n add_missing_translation_content(@bank.bank_translations)\n\n respond_to do |format|\n if @bank.save\n format.html { redirect_to admin_banks_path, notice: t('app.msgs.success_updated', :obj => t('activerecord.models.bank')) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bank.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6cdd1730141ab96965433dfa06c91fe3", "score": "0.5218756", "text": "def set_banner\n @banner = Banner.find(params[:id])\n end", "title": "" }, { "docid": "6cdd1730141ab96965433dfa06c91fe3", "score": "0.5218756", "text": "def set_banner\n @banner = Banner.find(params[:id])\n end", "title": "" }, { "docid": "6cdd1730141ab96965433dfa06c91fe3", "score": "0.5218756", "text": "def set_banner\n @banner = Banner.find(params[:id])\n end", "title": "" }, { "docid": "6cdd1730141ab96965433dfa06c91fe3", "score": "0.5218756", "text": "def set_banner\n @banner = Banner.find(params[:id])\n end", "title": "" }, { "docid": "6cdd1730141ab96965433dfa06c91fe3", "score": "0.5218756", "text": "def set_banner\n @banner = Banner.find(params[:id])\n end", "title": "" }, { "docid": "6cdd1730141ab96965433dfa06c91fe3", "score": "0.5218756", "text": "def set_banner\n @banner = Banner.find(params[:id])\n end", "title": "" }, { "docid": "dfe936229859ef1d8540a2c14e94815b", "score": "0.5178187", "text": "def set_banner\n @banner = Banner.find(params[:id])\n end", "title": "" }, { "docid": "dc6ab94f83e1e34f23e20f8e08a3a7e0", "score": "0.517648", "text": "def banner(text)\n @__banner = text.strip\n end", "title": "" }, { "docid": "3e8f6674f3128c739754f765f5424ae4", "score": "0.5174654", "text": "def update\n respond_to do |format|\n if @campaign_banner.update(campaign_banner_params)\n format.html { redirect_to campaign_banner_url(@campaign, @campaign_banner), notice: 'Campaign banner was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @campaign_banner.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "75bfab822c7a3ea7c02b1410d53daaee", "score": "0.51452076", "text": "def update\n respond_to do |format|\n if @ad_banner.update(ad_banner_params)\n format.html { redirect_to @ad_banner, notice: 'Ad banner was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ad_banner.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "60a9b1fe6a567efec988bcda1d86b637", "score": "0.5125622", "text": "def fillin_translations\n collection_types = Hyrax::CollectionType.all\n collection_types.each do |c|\n next unless c.title =~ /^translation missing/\n oldtitle = c.title\n c.title = I18n.t(c.title.gsub(\"translation missing: en.\", ''))\n c.save\n Rails.logger.debug \"#{oldtitle} changed to #{c.title}\"\n end\n end", "title": "" }, { "docid": "4d3c924ffd10331dce33b675259696bc", "score": "0.5098486", "text": "def update\n @home_banner = HomeBanner.find(params[:id])\n\n respond_to do |format|\n if @home_banner.update_attributes(params[:home_banner])\n \n expire_home_banner_caches\n \n flash[:notice] = 'Home Banner was successfully updated.'\n format.html { redirect_to(admin_home_banners_path) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @home_banner.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "da6710b65e92f3a0f7da9e6c9839d976", "score": "0.50944716", "text": "def set_banner\n @banner = Banner.find(params[:id])\n end", "title": "" }, { "docid": "1954eeb304817d37420c2ed3bd24b7ef", "score": "0.5080092", "text": "def place_ad_for_today\n copy_image\n update_page_heading\n end", "title": "" }, { "docid": "0e62958119fa4c96e4fec81faad73022", "score": "0.5073283", "text": "def set_admin_banner\n @banner = Banner.find(params[:id])\n end", "title": "" }, { "docid": "0e62958119fa4c96e4fec81faad73022", "score": "0.5073283", "text": "def set_admin_banner\n @banner = Banner.find(params[:id])\n end", "title": "" }, { "docid": "7bb699f02c94effe449d39597652c643", "score": "0.5046754", "text": "def update_files\n PhrasingPhrase.transaction do\n # 1) Get file contents as keys and values\n keys_and_values = yml_to_keys_and_values\n old_version_keys_and_values = keys_and_values.clone\n\n # 2) Update all translated values in keys_and_values\n puts \"Updating..\"\n phrasing_phrases.each do |phrase|\n print \".\"\n next if phrase.key == phrase.value\n\n @word_counter.update(keys_and_values[\"#{phrase.locale}.#{phrase.key}\"], phrase.yml_value)\n\n keys_and_values[\"#{phrase.locale}.#{phrase.key}\"] = phrase.yml_value\n end\n\n # 3) Update keys_and_values to same yml file\n if @word_counter.has_change?\n # Create last version file entry in releases\n create_to_recent_version_entry_for(old_version_keys_and_values)\n # Update root file to new version\n update_as_next_root_version(keys_and_values)\n end\n\n # 4) Delete All Database Records for lang\n # phrasing_phrases.delete_all\n\n display_word_count\n\n # Return true for successfull execution\n return @word_counter.has_change?\n end\n end", "title": "" }, { "docid": "b51de36645bbdaa197cc165a567becfd", "score": "0.5042578", "text": "def update\n update_notices_count\n update_notices_cache\n problem\n end", "title": "" }, { "docid": "045db57b07ca3a998cddda93957d576b", "score": "0.504241", "text": "def process_banner_input\n # ::Deepblue::LoggingHelper.bold_debug [ ::Deepblue::LoggingHelper.here,\n # ::Deepblue::LoggingHelper.called_from,\n # \"@collection.id = #{@collection.id}\",\n # \"\" ] if dashboard_collections_controller_debug_verbose\n return update_existing_banner if params[\"banner_unchanged\"] == \"true\"\n remove_banner\n uploaded_file_ids = params[\"banner_files\"]\n add_new_banner(uploaded_file_ids) if uploaded_file_ids\n end", "title": "" }, { "docid": "fb9accad010355df912ba9c37d3d7906", "score": "0.50264496", "text": "def auto_translate\n return unless MuckContents.configuration.enable_auto_translations\n begin\n translate(false)\n rescue => ex\n #TODO figure out a way to bubble up the error\n puts ex\n debugger\n # Translations failed, but update the default language\n translation = translation_for(self.locale)\n translation.update_attributes!(:title => self.title, :body => self.body) unless translation.blank?\n end\n end", "title": "" }, { "docid": "108ea9b613866606a3b921ed489b9b58", "score": "0.5023022", "text": "def banner\n checkConnection()\n @banner\n end", "title": "" }, { "docid": "108ea9b613866606a3b921ed489b9b58", "score": "0.5023022", "text": "def banner\n checkConnection()\n @banner\n end", "title": "" }, { "docid": "94e12d4edc93fe54587a7165dc2e9c00", "score": "0.50215775", "text": "def update_blurb(state, locale, key, value, overwrite = false)\n id = key\n key = \"projects:#{api_key}:#{state}_blurbs:#{key}\"\n \n current_value = redis.sismember(\"projects:#{api_key}:#{state}_blurb_keys\", id) ? JSON.parse(redis.get(key)) : {}\n phrase = Phrase.new(self, current_value)\n \n # A new value is only written if no previous translation was present, or overwriting is enabled.\n if overwrite || phrase[locale].text.nil?\n phrase[locale] = value\n \n redis.sadd \"projects:#{api_key}:#{state}_blurb_keys\", id\n redis.sadd \"projects:#{api_key}:locales\", locale\n redis.set key, phrase.to_hash.to_json\n redis.set \"projects:#{api_key}:#{state}_blurbs_etag\", Projects.random_key\n end\n end", "title": "" }, { "docid": "870123181162461a34f48cbff1a8e4f2", "score": "0.50108254", "text": "def update_translation( key, value, locale )\n \n # lock file\n filename = File::join RAILS_ROOT, \"config/locales\", File::basename( locale + \".yml\" )\n if( File.exists? filename )\n file = File.new( filename, \"r+\")\n else\n file = File.new( filename, \"w+\" ) \n end\n \n file.flock( File::LOCK_EX )\n \n begin \n # read project locale file\n data = YAML.load( file )\n unless data.is_a? Hash \n I18n.load_path << filename\n data = { locale => {} } unless data \n end\n \n tmp = data\n \n # create middle hash keys as needed\n key = locale + \".\" + key\n keys = key.split(/\\./)\n base_key = keys.pop\n \n while tmpkey = keys.shift\n unless tmp[tmpkey].class == Hash\n tmp[tmpkey] = {}\n end\n tmp = tmp[tmpkey]\n end\n \n # update or create value\n tmp[base_key] = value\n \n # save file\n file.truncate( 0 )\n file.rewind\n file.write( data.to_yaml )\n ensure\n # unlock and close file\n file.flock( File::LOCK_UN )\n file.close\n end\n \n I18n.reload!\n \n end", "title": "" }, { "docid": "4da923154032dad4e61501f5f6dc0515", "score": "0.5006488", "text": "def banner s; @order << [:text, s] end", "title": "" }, { "docid": "57860f5e04b7446aa3989e481bdd4e30", "score": "0.4998735", "text": "def update\n @group_banner = GroupBanner.find(params[:id])\n\n respond_to do |format|\n if @group_banner.update_attributes(params[:group_banner])\n format.html { redirect_to(@group_banner, :notice => l(:notice_successful_update)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group_banner.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f38ab80354751c8696ea1abc7d3b985d", "score": "0.49640942", "text": "def update\n files = Dir[Rails.root.join(\"config\", \"locales\", \"*.yml\").to_s]\n\n @languages = {}\n files.each do |f|\n ar = YAML.load_file f\n lang = ar.keys.first\n if @languages.has_key?(lang.to_s)\n @languages[lang.to_s] = @languages[lang.to_s].deep_merge(ar.first[1])\n else\n @languages[lang.to_s] = ar.first[1]\n end\n end\n\n sync(@languages[I18n.default_locale.to_s])\n end", "title": "" }, { "docid": "639295bc929b53610c7fa3abfedde1e7", "score": "0.49482372", "text": "def update\n @hbanner = Hbanner.find(params[:id])\n\n respond_to do |format|\n if @hbanner.update_attributes(params[:hbanner])\n flash[:notice] = 'Hbanner was successfully updated.'\n format.html { redirect_to(@hbanner) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @hbanner.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "034ac1a14159272d09f1e71184d64834", "score": "0.49434194", "text": "def reload!\n @initialized = false\n @translations = nil\n super\n end", "title": "" }, { "docid": "00983eaccd790ea8590a5b26cbb85581", "score": "0.49314424", "text": "def show_translation\n @translations = load_translations( @locale, @base_locale )\n render :partial => \"i18n_ui/translation_body\", :locals => { :key => params[:key], :tr => @translations[params[:key]]}, :layout => nil\n end", "title": "" }, { "docid": "1d9e6419c1248b786f6c8db342fd435a", "score": "0.4917041", "text": "def update_deployment(s_language)\n @ht_bdmroutines.each_pair do |s_bdmcomponent_name,ob_bdmroutine|\n ob_bdmroutine.send(:update_deployment,s_language)\n end # loop\n end", "title": "" }, { "docid": "c699d8b1528c9a7b1672cd9c920521c1", "score": "0.49137673", "text": "def update\n puts \"Updating tumblr\"\n refresh\n generate\n end", "title": "" }, { "docid": "4197c2e35135aa00f7cc3238b23cb5bd", "score": "0.49129653", "text": "def update_sources\n source_files_path = Dir['config/locales/**/*.en-EU.yml']\n source_files_path.each do |path|\n puts \"update #{path}\"\n @crowdin.update_file([{ dest: \"/#{File.basename(path).gsub('en-EU', 'en')}\",\n source: path }])\n end\n\n source_files_path = Dir['config/locales/main/en-EU.yml']\n source_files_path.each do |path|\n puts \"update #{path}\"\n @crowdin.update_file([{ dest: '/main.en.yml',\n source: path }])\n end\n end", "title": "" }, { "docid": "fc61e24438b7d4cb9d81c6a8fbb67f3e", "score": "0.49087578", "text": "def update_associations_translated_cache\n result = Array(translatable_options[:translatable_associations]).all? do |association|\n records = send(association)\n case records\n when ActiveRecord::Base\n # If it's a single record\n send(association).translation_complete?\n else\n # If it's a relation\n send(association).translation_incomplete.empty?\n end\n end\n # Save without triggering callbacks\n self.class.update_all({:associations_translated => result}, :id => self.id) if self.class.column_names.include? 'associations_translated'\n end", "title": "" }, { "docid": "7774509f7fdcb7c0220dc425539dc472", "score": "0.48958308", "text": "def update!(**args)\n @ads_appear_on = args[:ads_appear_on] if args.key?(:ads_appear_on)\n @description = args[:description] if args.key?(:description)\n @location = args[:location] if args.key?(:location)\n @site_language = args[:site_language] if args.key?(:site_language)\n end", "title": "" }, { "docid": "b12dd87ed118bd47f433d81e7d8f8c1d", "score": "0.48832628", "text": "def update_translations(locale, data)\n set_translations(locale, application.cache_translations(\n locale,\n key,\n data.is_a?(Hash) ? data['translations'] : data\n ))\n end", "title": "" }, { "docid": "6896d455328d3e0f0befaadae4cfdabb", "score": "0.4881484", "text": "def _update_counts_after_update\n unless Array(Thread.current[:skip_counter_culture_updates]).include?(self.class)\n super\n end\n end", "title": "" }, { "docid": "0552162ba3ff638080303a1743645573", "score": "0.48532525", "text": "def update\n @locale_entry.assign_attributes(update_params)\n\n @locale_entry.translated = true\n @locale_entry.translator = current_user\n\n @locale_entry.save\n respond_with @source_entry, @locale_entry, location: glossary_url\n end", "title": "" }, { "docid": "bf80711d720f8b0582e1f315f7468a8b", "score": "0.4836279", "text": "def update_tsbs_extra\n @focus_bg.update\n @cutin.update\n @battle_plane.update\n @one_anim.update\n end", "title": "" }, { "docid": "956c11dd1fedde593a88a6d184f9e825", "score": "0.48343894", "text": "def translate\n if self.products && self.products.first\n ContentTranslation.auto_translate(self, self.products.first.brand)\n end\n end", "title": "" }, { "docid": "5bfe16537c0bdd351621e476ffc070d5", "score": "0.48338073", "text": "def update\n autorize! :update, @catalogs_institution\n if @catalogs_institution.update(catalogs_institution_params)\n flash[:success] = t('notices.updated_successfully')\n index\n end\n end", "title": "" }, { "docid": "dabbe43af44d8fc004b2266722181582", "score": "0.48188937", "text": "def set_ad_banner\n @ad_banner = AdBanner.find(params[:id])\n end", "title": "" }, { "docid": "ba8089852f56b318efaa9b0c9edc3c2e", "score": "0.48077828", "text": "def update_key_status\n self.key.update_status(self.lang)\n end", "title": "" }, { "docid": "5bf07762c5fdaf52c40f57f338dbfe35", "score": "0.47978216", "text": "def update\n @indicator_category = IndicatorCategory.find(params[:id])\n\n @indicator_category.assign_attributes(params[:indicator_category])\n\n add_missing_translation_content(@indicator_category.indicator_category_translations)\n \n respond_to do |format|\n if @indicator_category.save\n format.html { redirect_to @indicator_category, notice: t('app.msgs.success_updated', :obj => t('app.common.indicator_category')) }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @indicator_category.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1338a2942c16d81f00ebd2c4216b2da3", "score": "0.47939378", "text": "def save_translations\n return true unless translation_cache\n \n translation_cache.each do |code, attrs|\n switch_language(code) do\n @attributes.update attrs\n update_translation\n end\n end\n true\n end", "title": "" }, { "docid": "b3101a6d42d56fabaac65c54727d4a91", "score": "0.4766941", "text": "def _update_counts_after_update\n _wrap_in_counter_culture_active do\n self.class.after_commit_counter_cache.each do |option|\n _update_counts option\n end\n end\n end", "title": "" }, { "docid": "88639d9155a53d01fe06d3fc7ad7133d", "score": "0.4741201", "text": "def create\n @banner = Banner.new(banner_params)\n exchange_attributes_params\n respond_to do |format|\n if @banner.save\n notice = 'Banner was successfully created.' \n notice += ' <span class=\"text-danger\">Error on bidder synch process. Please try again.</span>' if @banner.campaign and not @banner.campaign.update_bidder\n format.html { redirect_to @banner, notice: notice }\n format.json { render :show, status: :created, location: @banner }\n else\n format.html { render :new }\n format.json { render json: @banner.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "640cbf3079999fcfebd51f7cb43e15af", "score": "0.47251597", "text": "def update\n @platform = Platform.find(params[:id])\n banners = Banner.where(:id => params[:platform].delete(:banners))\n @platform.banners = banners\n\n respond_to do |format|\n if @platform.update_attributes(params[:platform])\n format.html { redirect_to @platform, notice: 'Platform was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @platform.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0f8388fa0455636addbafbdb09d8deb0", "score": "0.47181165", "text": "def update\n @gruppi_banner = GruppiBanner.find(params[:id])\n\n respond_to do |format|\n if @gruppi_banner.update_attributes(params[:gruppi_banner])\n format.html { redirect_to(@gruppi_banner, :notice => 'Gruppi banner was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @gruppi_banner.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8e75d83467b03ec1d2957b3b34e28fe7", "score": "0.471262", "text": "def set_campaign_banner\n @campaign_banner = CampaignBanner.find(params[:id])\n end", "title": "" }, { "docid": "7e795054189568330a63e70a2da9d4f1", "score": "0.47025928", "text": "def save_translations\n cache.each_translation do |translation|\n next unless translation.value.present?\n translation.id ? translation.save : model.send(\"add_#{association_name.to_s.singularize}\", translation)\n end\n end", "title": "" }, { "docid": "17617b9e6179a9528de6e2381de37bbe", "score": "0.47014096", "text": "def banner\n self.class.instance_variable_get(:@__banner)\n end", "title": "" }, { "docid": "3fde1f05e388c9193059052cf0ac19a6", "score": "0.46992394", "text": "def update\n\t\t\t\tprotect_runtime_errors do\n\t\t\t\t\tif @clear_history\n\t\t\t\t\t\t@history_cache = nil \n\t\t\t\t\t\tGC.start\n\t\t\t\t\tend\n\t\t\t\t\t# -- update files as necessary\n\t\t\t\t\t# need to try and load a new file,\n\t\t\t\t\t# as loading is the only way to escape this state\n\t\t\t\t\tdynamic_load @files[:body]\n\t\t\t\t\t\n\t\t\t\t\t@ui.update self, @wrapped_object, @window, turn_number()\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "43ba32581d306f824c8ec15524ff9f9a", "score": "0.46980155", "text": "def link_banner(banner)\n raise \"Zone must be saved\" if new_record?\n raise ArgumentError.new(\"Banner must be saved\")if banner.new_record?\n\n session = self.class.connection\n server = XmlrpcClient.new2(\"#{session.url}\")\n server.call(\"ox.linkBanner\", session, self.id, banner.id)\n end", "title": "" }, { "docid": "113c934b0488bdbe4c95867748c45d7e", "score": "0.46971324", "text": "def update_phrases\n if cookies[:phrase_id].present?\n @sequence = Phrase.order(\"sequence ASC\").last.sequence\n if @sequence == Phrase.count \n Phrase.reset_all\n else\n @last_phrase = Phrase.where(id: cookies[:phrase_id]).first\n @last_phrase.update(state: 'displayed', sequence: @sequence+1) \n end\n end \n end", "title": "" }, { "docid": "55f9e1d9dc17420faeb3113daf2b14a2", "score": "0.46829918", "text": "def banner\n if(@all_images.nil?)\n @all_images = Image.all\n end\n\n if(!@all_images.empty?)\n for img in @all_images\n if(img.picture_file_name == \"Company_Logo.png\")\n @imagelogo = img.picture.url\n end\n if(img.picture_file_name == \"Company_Banner.png\")\n @imagebanner = img.picture.url\n end\n end\n end\n end", "title": "" }, { "docid": "eb0ed1691c7bdc3a7f500b543e0153e5", "score": "0.46804518", "text": "def link_banner(banner)\n raise \"Zone must be saved\" if new_record?\n raise ArgumentError.new(\"Banner must be saved\")if banner.new_record?\n\n session = Base.connection\n server = XMLRPC::Client.new2(\"#{session.url}#{self.class.endpoint}\")\n server.call(\"linkBanner\", session.id, self.id, banner.id)\n end", "title": "" }, { "docid": "2c7022d06ad15223354119384065b6fb", "score": "0.46728358", "text": "def update\n @executor.start_section \"Vundle\"\n @executor.execute_interactive \"Updating Vim Bundles\", \"vim +BundleUpdate +qall\"\n end", "title": "" }, { "docid": "02a65d9081427c2e76bf476698782390", "score": "0.4669547", "text": "def update\n respond_to do |format|\n old_campaign = @banner_video.campaign\n if @banner_video.update(banner_video_params)\n @banner_video.exchange_attributes.delete_all\n exchange_attributes_params\n notice = 'Video was successfully updated.' \n # Update bidder for old and new campaign \n if old_campaign and \n ( \n not @banner_video.campaign or # campaign removed\n not @banner_video.campaign.id.to_s.eql?(old_campaign.id.to_s) # campaign changed\n )\n then\n puts \"Update previous campaign #{old_campaign.id.to_s}\"\n old_campaign.update_bidder \n end\n if @banner_video.campaign and not @banner_video.campaign.update_bidder \n notice += ' <span class=\"text-danger\">Error on bidder synch process. Please try again.</span>'\n end \n format.html { redirect_to @banner_video, notice: notice }\n format.json { render :show, status: :ok, location: @banner_video }\n else\n format.html { render :edit }\n format.json { render json: @banner_video.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6ab655c822d763604e5984f897fd46ff", "score": "0.46671385", "text": "def setup_mass_copy_translations\n end", "title": "" }, { "docid": "b2dc1363db3cfb85ef6a4eafabf03cad", "score": "0.46620843", "text": "def finale\n Banner::SweepSound.play\n @posx = 471\n @party_banners.each {|banner| banner.move(@posx,Banner::PosY[0],255,10)}\n end", "title": "" }, { "docid": "7c474fa7a8a196e75b1ba4b5937ad108", "score": "0.4660044", "text": "def update\n respond_to do |format|\n if @cms_home_banner.update(cms_home_banner_params)\n puts \"################## visible_start_at: #{@cms_home_banner.visible_start_at}\"\n puts \"################## visible_start_at utc: #{@cms_home_banner.visible_start_at.utc}\"\n puts \"################## visible_finish_at: #{@cms_home_banner.visible_finish_at}\"\n puts \"################## visible_finish_at utc: #{@cms_home_banner.visible_finish_at.utc}\"\n format.html { redirect_to @cms_home_banner, notice: 'Home banner was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @cms_home_banner.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6f3d74abfa64ab652f40c417d691dd5c", "score": "0.46581045", "text": "def refresh_choosed\n self.choosed_text = self.translated_texts.first\n self.save\n end", "title": "" }, { "docid": "d8f11367771b6eb403e1269a1b1dacce", "score": "0.46579444", "text": "def index \n @banners = Banner.for_admin\n end", "title": "" }, { "docid": "ff23a015560dba065f96ce5ae936e629", "score": "0.46385616", "text": "def draw_banner\n bmp = Cache.picture(@quest.banner) # Get Picture\n # Shift the hue if requested\n bmp.hue_change(@quest.banner_hue) unless @quest.banner_hue == 0\n x = (contents_width - bmp.rect.width) / 2\n if x < 0 # Stretch horizontally if the banner is too wide\n dest_rect = bmp.rect.dup\n dest_rect.width = contents_width\n contents.stretch_blt(dest_rect, bmp, bmp.rect)\n else\n contents.blt(x, @draw_y, bmp, bmp.rect)\n end\n bmp.dispose\n end", "title": "" }, { "docid": "2ead9ff64532fd16be4b40a00a0447f5", "score": "0.46369135", "text": "def update\n en_ee_ge_u\n if @sound.nil? && @page && !@page.sound.empty?\n @sound = RPG::BGS.new(@page.sound[0], volume(*@page.sound[1..2]), 100)\n @sound.play\n end\n if @sound\n @sound.volume = volume(@page.sound[1], @page.sound[2]) and @sound.play\n end\n end", "title": "" }, { "docid": "9e9a56a0ba33157f0d04a7488df08e42", "score": "0.46336678", "text": "def addConnectionDetailsTo(translation)\n @connection = Connection.find_by_lang2_id translation.id\n translation['rating'] = @connection.votes_for - @connection.votes_against\n translation['connection_id'] = @connection.id\n @user = current_user\n if @user\n if @user.voted_for? @connection\n translation['user_voted'] = 1\n elsif @user.voted_against? @connection\n translation['user_voted'] = -1\n else\n translation['user_voted'] = 0\n end\n end\n end", "title": "" }, { "docid": "cb2162d3a1fd3434effd12aa702f250f", "score": "0.46317402", "text": "def update() end", "title": "" }, { "docid": "0d22f925b7cc019bc5cced8610e58e2d", "score": "0.46289116", "text": "def show\n @translate\n @uploaded_text = ''\n translation_map = []\n end", "title": "" }, { "docid": "b5102ec036ad45116f6d76b61a2a9920", "score": "0.46280962", "text": "def update\n @article = Article.find(params[:id])\n if @article.update(article_params)\n translate_art\n redirect_to @article\n else\n render 'edit'\n end\n end", "title": "" }, { "docid": "9828f3d07c8f88122e6163a8eacbe063", "score": "0.46049657", "text": "def update_or_create_all_translations(attributes={})\n missing_locales.each { |locale| translations.build :locale => locale }\n translations.each do |translation|\n attrs = attributes[translation.code]\n unless translation.active? or attrs.nil?\n merger = translation.attributes.merge attrs\n translation.attributes = merger\n end\n translation.save!\n end\n end", "title": "" }, { "docid": "255a721d97335618a5131fa9d6a6b55d", "score": "0.46027464", "text": "def UpdateLocale params = {}\n \n APICall(path: 'locales.json',method: 'PUT',payload: params.to_json)\n \n end", "title": "" }, { "docid": "ebf549888a3698b96b156993adb5b0a3", "score": "0.45982316", "text": "def update\n @status_buttons.each do |i|\n i.update\n end\n end", "title": "" }, { "docid": "cf3c2862f732e7ec06808933a2c503dd", "score": "0.45878306", "text": "def banner\n @data['banner']\n end", "title": "" }, { "docid": "117a1473ea7d6ec5963792733ca080cf", "score": "0.4585061", "text": "def create_english_versions_of_article(article, statusOfArticles)\n I18n.locale = :en\n article.update!({\n title: \"En -#{Faker::Hipster.sentence(3, true, 4)}\",\n teaser: Faker::Hipster.paragraph(4),\n status: statusOfArticles.sample,\n body: fakerForBody\n })\n I18n.locale = :fr\nend", "title": "" }, { "docid": "7753422699f70d15890ac937811d4312", "score": "0.45755628", "text": "def clear_translations!\r\n @translation_caches = {}\r\n @stop_merging_translated_attributes = nil\r\n end", "title": "" }, { "docid": "40d946d1ee77af94e10563f12175c699", "score": "0.45751", "text": "def update_tsbs_extras\n @anim_state.update\n @anim_guard.update\n @shadow.update\n @spr_icon.update\n end", "title": "" }, { "docid": "92fa00e8e615debd3c80434de77fb68f", "score": "0.45704025", "text": "def label_translation; end", "title": "" }, { "docid": "e203201ca8c39630eeb4d954661e73d6", "score": "0.45657873", "text": "def update!(**args)\n @caption = args[:caption] if args.key?(:caption)\n @hd_transcode = args[:hd_transcode] if args.key?(:hd_transcode)\n @poster_art = args[:poster_art] if args.key?(:poster_art)\n @spotlight_art = args[:spotlight_art] if args.key?(:spotlight_art)\n @spotlight_review = args[:spotlight_review] if args.key?(:spotlight_review)\n @trailer = args[:trailer] if args.key?(:trailer)\n end", "title": "" }, { "docid": "8eba6d95581c21a5894ca0b39fd58a9f", "score": "0.4564468", "text": "def delete_translations\n end", "title": "" } ]
47d267c3ed3477af9b2f36b0e7b1cd57
define distance between two vectors
[ { "docid": "0bff5b6d53e438bbbf28312211cb31fd", "score": "0.6727952", "text": "def distance(v_)\n (self - v_).r\n end", "title": "" } ]
[ { "docid": "1e382c0174f308c7f74760f96be0c2c8", "score": "0.8082479", "text": "def distance(vector)\n end", "title": "" }, { "docid": "1e382c0174f308c7f74760f96be0c2c8", "score": "0.8082479", "text": "def distance(vector)\n end", "title": "" }, { "docid": "960abc98b997c8ad6f5b5229fbe420b7", "score": "0.7966063", "text": "def distance(vector1, vector2)\n sum = 0\n vector1.zip(vector2).each do |v1, v2|\n component = (v1 - v2)**2\n sum += component\n end\n Math.sqrt(sum)\nend", "title": "" }, { "docid": "988762c2c40f4a96d06fb4f6f9b5c609", "score": "0.7792219", "text": "def distance(v1, v2)\n v1.zip(v2).map { |a, b| (a - b)**2 }.sum\nend", "title": "" }, { "docid": "72efd32484e9b4929e3b7e236da719d3", "score": "0.7786728", "text": "def distance(v1, v2)\n sum = 0\n v1.each_with_index do |v1_val, idx|\n sum += (v1_val - v2[idx])**2\n end\n Math.sqrt(sum)\n end", "title": "" }, { "docid": "12f28e886b5623e5a92c99e56634398c", "score": "0.77838135", "text": "def distance_between(vector_x, vector_y)\n raise ArgumentError, 'Vectors with different length!' unless vector_x.size == vector_y.size\n\n d = 0\n vector_x.zip(vector_y).each { |x, y| d += (x - y) ** 2 }\n\n # add 1e-4 to distance to protect from vectors without distance between them\n 1.0 / Math.sqrt(d + 0.0001)\n end", "title": "" }, { "docid": "796f57f6c90f440bf0fb4ae4220d9b6a", "score": "0.76280975", "text": "def euclidean_distance(v1, v2)\n raise \"vectors are different sizes!\\n#{v1}\\n#{v2}\" if v1.size != v2.size\n\n Math.sqrt(v1.zip(v2).map{|a, b| ((b||0) - (a||0))**2}.sum)\nend", "title": "" }, { "docid": "d21503c55f0208bd91218ab84befebc5", "score": "0.7453083", "text": "def distance(a, b)\n (a[0] - b[0]).abs + (a[1] - b[1]).abs\n end", "title": "" }, { "docid": "1bb6cf2ed8f1e07559f5bfd8b2436214", "score": "0.7400272", "text": "def distance(x1, y1, x2, y2); end", "title": "" }, { "docid": "15b670e1e067bafe3d5a9ee44c3a6648", "score": "0.7302109", "text": "def distance(a, b)\n a.distance(b)\n end", "title": "" }, { "docid": "0db01d3c7195a27ea4fb01709a11cc07", "score": "0.7272308", "text": "def distance_to(vector)\r\n diff = self.clone.sub(vector)\r\n distance = diff.inject(0) do |distance_acc,value|\r\n distance_acc + value**2\r\n end\r\n Math.sqrt(distance)\r\n end", "title": "" }, { "docid": "45708db639c7d23a39653fc9f1bcc49d", "score": "0.72413075", "text": "def euclidean_distance(a, b)\n x = Vector[*(a.to_a)]\n y = Vector[*(b.to_a)]\n return (x - y).r\nend", "title": "" }, { "docid": "1e78badee9ee9ae8384c461e6e3626e9", "score": "0.7208159", "text": "def distance(u, v)\n x_diff = (v[0] - u[0])\n y_diff = (v[1] - u[1])\n return Math.sqrt((x_diff ** 2) + (y_diff ** 2))\nend", "title": "" }, { "docid": "0761925ceaad5e06befbebc43d8f2be4", "score": "0.7175914", "text": "def distance(a,b)\n dist = ((a[0]-b[0]).abs + (a[1]-b[1]).abs + (a[2]-b[2]).abs)/2\n return dist\n end", "title": "" }, { "docid": "4fea1a9de32d72ffe3ddd6352cdbfbb1", "score": "0.7160225", "text": "def distance(position1, position2) \n obstructed_distance(position1, position2){|x| nil}\n end", "title": "" }, { "docid": "0c97c1a2fbdca2aec92ad93be047a8d2", "score": "0.7108824", "text": "def dist vector\r\n Math.sqrt((self[:x] - vector.x)**2 + (self[:y] - vector.y)**2 + (self[:z] - vector.z)**2)\r\n end", "title": "" }, { "docid": "ff01be4486ab0fdff64efba8fc57a593", "score": "0.70774883", "text": "def distance_between_points(a, b)\n return Math.sqrt((a[0] - b[0])**2 + (a[1] - b[1])**2 )\nend", "title": "" }, { "docid": "1e548c013586ab87848a858a531636d3", "score": "0.69419515", "text": "def vectD(array1,array2)\r\n aux = 0.0\r\n sqrt= 0.0\r\n (0..(array1.size-1)).each do |v|\r\n aux = (array1[v] - array2[v]).abs\r\n sqrt += aux*aux\r\n end\r\n sqrt = Math.sqrt(sqrt) if !sqrt.nan?\r\n return sqrt\r\nend", "title": "" }, { "docid": "1e548c013586ab87848a858a531636d3", "score": "0.69419515", "text": "def vectD(array1,array2)\r\n aux = 0.0\r\n sqrt= 0.0\r\n (0..(array1.size-1)).each do |v|\r\n aux = (array1[v] - array2[v]).abs\r\n sqrt += aux*aux\r\n end\r\n sqrt = Math.sqrt(sqrt) if !sqrt.nan?\r\n return sqrt\r\nend", "title": "" }, { "docid": "1e548c013586ab87848a858a531636d3", "score": "0.69419515", "text": "def vectD(array1,array2)\r\n aux = 0.0\r\n sqrt= 0.0\r\n (0..(array1.size-1)).each do |v|\r\n aux = (array1[v] - array2[v]).abs\r\n sqrt += aux*aux\r\n end\r\n sqrt = Math.sqrt(sqrt) if !sqrt.nan?\r\n return sqrt\r\nend", "title": "" }, { "docid": "bfa684d5a1b41a184129c31f93e02c68", "score": "0.6934081", "text": "def distance(num1, den1, num2, den2)\n end", "title": "" }, { "docid": "306e269adbd223251f76554498c8b02d", "score": "0.68783927", "text": "def calculate_distance(a, b)\n Math.sqrt((a.first-b.first)**2 + (a.last-b.last)**2)\nend", "title": "" }, { "docid": "c768d84a13b4b36fe6e06ad661afec78", "score": "0.68760234", "text": "def euclidean_distance(a, b)\n Math.sqrt ( a.zip(b).map { |n| n.reduce(:-) }.map { |n| n**2 }.reduce(:+) )\nend", "title": "" }, { "docid": "dfff89d0f9b9fb2db62c3beabfc2758b", "score": "0.6874362", "text": "def dist(o1,o2)\n Math::hypot(o1.x - o2.x, o1.y - o2.y)\n end", "title": "" }, { "docid": "35d56491207436f7d4fa963ea09fd447", "score": "0.686618", "text": "def distance x1, y1, x2, y2\n dx = x1 - x2\n dy = y1 - y2\n sqrt(dx*dx + dy*dy)\nend", "title": "" }, { "docid": "56a189fc1369fcc6e5c7f1427b8cfa80", "score": "0.6859741", "text": "def get_distance(a, b)\n\n dist_x = (a[0] - b[0]).abs\n dist_y = (a[1] - b[1]).abs\n\n return Math::sqrt(dist_x**2 + dist_y**2)\n\n end", "title": "" }, { "docid": "87cecd7743893aaea790102d628d83a0", "score": "0.6850482", "text": "def distance(a, b)\n \t\tcase\n \t\twhen a.empty?\n\t\t\tb.length\n \t\twhen b.empty?\n\t\t\ta.length\n \t\telse\n\t\t\t[(a[0] == b[0] ? 0 : 1) + distance(a[1..-1], b[1..-1]),\n\t\t\t1 + distance(a[1..-1], b),\n\t\t\t2 + distance(a, b[1..-1])].min\n \t\tend\n \tend", "title": "" }, { "docid": "ef0d43f844848fd94132dce2c020ffbd", "score": "0.68497336", "text": "def d(v1, v2)\n sum = 0\n for i in 0..783\n sum += ((v2[i] - v1[i]) ** 2)\n end\n Math.sqrt(sum)\nend", "title": "" }, { "docid": "7b6196a649096cffaa467492b3422d96", "score": "0.6840515", "text": "def dist(a,b)\n if a - b < 0\n return b - a\n else\n return a - b\n end\nend", "title": "" }, { "docid": "46e6dd8bbfc2b1a5d777abadde16f305", "score": "0.68367124", "text": "def distance(pt_a, pt_b)\r\n Math.sqrt((pt_a.x - pt_b.x) * (pt_a.x - pt_b.x) + \r\n (pt_a.y - pt_b.y) * (pt_a.y - pt_b.y))\r\nend", "title": "" }, { "docid": "4f519a9a141e566c2e76f691e47bbcae", "score": "0.6832274", "text": "def distancia(a,b)\n\t#hacerlo con un loop \"iterar dos collections al mismo tiempo\"\n\tp (a[0]-b[0]).abs + (a[1]-b[1]).abs\nend", "title": "" }, { "docid": "6d5a9faca55e5301808a440ca05490f9", "score": "0.6832223", "text": "def distance( x1, y1, x2, y2 )\n ((x1 - x2)**2 + (y1 - y2)**2)**0.5\nend", "title": "" }, { "docid": "fb81a37577cab28923884503b6526379", "score": "0.6826445", "text": "def distance(other)\n Math.sqrt((@x-other.x)**2 + (@y-other.y)**2)\n end", "title": "" }, { "docid": "b50cc8737812aa430e1e85b27345f741", "score": "0.6823142", "text": "def distance(x0, y0, x1, y1)\n Math.sqrt((x1-x0)**2 + (y1-y0)**2)\n end", "title": "" }, { "docid": "4a52bd5d5a2591a9e2e7b4942047900d", "score": "0.6816859", "text": "def distance(other)\n Math.sqrt((@x - other.x)**2 + (@y - other.y)**2)\n end", "title": "" }, { "docid": "dfb802309caee60f6c002efbed031869", "score": "0.67988116", "text": "def vectD(array1,array2)\r\n aux = 0.0\r\n sqrt= 0.0\r\n (0..(array1.size-1)).each do |v|\r\n aux = (array1[v].to_f - array2[v].to_f).abs\r\n sqrt += aux*aux\r\n end\r\n sqrt = Math.sqrt(sqrt) if !sqrt.nan?\r\n return sqrt\r\nend", "title": "" }, { "docid": "dfb802309caee60f6c002efbed031869", "score": "0.67988116", "text": "def vectD(array1,array2)\r\n aux = 0.0\r\n sqrt= 0.0\r\n (0..(array1.size-1)).each do |v|\r\n aux = (array1[v].to_f - array2[v].to_f).abs\r\n sqrt += aux*aux\r\n end\r\n sqrt = Math.sqrt(sqrt) if !sqrt.nan?\r\n return sqrt\r\nend", "title": "" }, { "docid": "1d21fda4f5c0fa27f5e2dcf104e765d5", "score": "0.6765047", "text": "def dist_to(point_1, point_2)\n\tsum = 0\n\tbegin\n\t\tno_of_dimensions = point_1.size\n\t\t(0..no_of_dimensions-1).each do |cord|\n\t\t\tsum += (point_1[cord] - point_2[cord])**2\n\t\tend\n\trescue Exception => e\n\t\t$log.info \"\\n#{e.message}\\n\"\n\tend\n\treturn Math::sqrt(sum)\nend", "title": "" }, { "docid": "ca9d336b57adb18b5b6f2ba917e36be6", "score": "0.67545855", "text": "def distance_to(other)\n dx = @x - other.x\n dy = @y - other.y\n\n Math.sqrt(dx * dx + dy * dy)\n end", "title": "" }, { "docid": "625b11b62cf0544fd472457537e641f2", "score": "0.673451", "text": "def distance(x1,y1,x2,y2)\n Math.sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2))\n end", "title": "" }, { "docid": "625b11b62cf0544fd472457537e641f2", "score": "0.673451", "text": "def distance(x1,y1,x2,y2)\n Math.sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2))\n end", "title": "" }, { "docid": "cd422b211f5197dd69d79a424da91171", "score": "0.6714214", "text": "def distance_to(other)\n postgis_calculate(:distance, [self, other]).to_f\n end", "title": "" }, { "docid": "f5cb5b27539086056c5eb15653f8c03a", "score": "0.6711111", "text": "def distance_between\n x1, x2 = 1, 2\n y1, y2 = 3, 4\n\n Integer.sqrt((x1 - x2)**2 + (y1 - y2)**2)\nend", "title": "" }, { "docid": "99fe78ad3105fe5a70c2984c0b7e81a9", "score": "0.6704765", "text": "def distance(x1, y1, x2, y2)\n Math.sqrt((x2-x1)**2 + (y2-y1)**2)\nend", "title": "" }, { "docid": "07cf94eda86b21f54f747f396bf3359a", "score": "0.6702803", "text": "def gl_distance2d(other)\n Math.sqrt((@x-other.x)**2 + (@z-other.z)**2)\n end", "title": "" }, { "docid": "74bcf58a6e9d9ccf18815fd2d6c49f9e", "score": "0.6699635", "text": "def gl_distance2d(other)\n Math.sqrt((@x - other.x)**2 + (@z - other.z)**2)\n end", "title": "" }, { "docid": "41e903d277188819a6ac764346f56c63", "score": "0.6698514", "text": "def distance(x, y)\n x ** 2 + y ** 2\nend", "title": "" }, { "docid": "12ac1194240b100060f91a51f92268df", "score": "0.66899383", "text": "def dist_to other\n (other.i - i).abs + (other.j - j).abs\n end", "title": "" }, { "docid": "903da9fc8c353a1f262f4cdb07622e75", "score": "0.6689821", "text": "def distance_squared(vector)\n end", "title": "" }, { "docid": "903da9fc8c353a1f262f4cdb07622e75", "score": "0.6689821", "text": "def distance_squared(vector)\n end", "title": "" }, { "docid": "56ac717bd633ea1656426099049a1577", "score": "0.6687447", "text": "def distance(other)\n return Math.sqrt((other.x - self.x) ** 2 + (other.y - self.y) ** 2)\n end", "title": "" }, { "docid": "4812c17b8eca8efee28198702540d095", "score": "0.66817254", "text": "def sl_dist(stops, s1, s2)\n return (stops.index(s1) - stops.index(s2)).abs\nend", "title": "" }, { "docid": "43993a658459d92152d9199733286442", "score": "0.66708875", "text": "def distance(other)\n distance_sqr(other)**0.5\n end", "title": "" }, { "docid": "138e13a1b6f4778bad841b5a9178f684", "score": "0.6670408", "text": "def distance (x1, y1, x2, y2)\n\treturn Math.sqrt((x2 - x1)**2 + (y2 - y1)**2).round(3)\nend", "title": "" }, { "docid": "6cdd69c32e41781b3bd9c21e5db7f2d8", "score": "0.6666397", "text": "def distance(pt1, pt2)\n Math.sqrt((pt1.x - pt2.x)**2 + (pt1.y - pt2.y)**2) \nend", "title": "" }, { "docid": "9865d4a822adb6771ec1bc974a6508f1", "score": "0.666124", "text": "def distance(i1, i2)\n return i1.difference(i2)\nend", "title": "" }, { "docid": "02dd225f317c93ef04f08f2471a2db58", "score": "0.6656979", "text": "def distance(p1, p2)\n return ((p1.x-p2.x).abs + (p1.y-p2.y).abs)\n end", "title": "" }, { "docid": "e136f32655ce8bcea3924074e2158fef", "score": "0.665519", "text": "def distance(x, y)\n return (x - y).abs\nend", "title": "" }, { "docid": "86bff9ad4dfece525f3fc6741bcd1f5a", "score": "0.6651349", "text": "def euclidean_distance(a, b)\n sq = a.zip(b).map{|a,b| (a - b) ** 2}\n Math.sqrt(sq.inject(0) {|s,c| s + c})\nend", "title": "" }, { "docid": "7fad23446f802b73b1d250eacc21a1ca", "score": "0.66513216", "text": "def norm(a, b)\n return ((a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2) ** (0.5)\nend", "title": "" }, { "docid": "161bfd61149c11cec22f3f6d360a06ed", "score": "0.6632899", "text": "def distance(other)\n dx = @x - other.x\n dy = @y - other.y\n (dx * dx) + (dy * dy)\n end", "title": "" }, { "docid": "9abd80ee4b6b90f001e2f47af5e6633e", "score": "0.6627588", "text": "def distance_to(other)\n dx = @x - other.x\n dy = @y - other.y\n dz = @z - other.z\n\n Math.sqrt(dx * dx + dy * dy + dz * dz)\n end", "title": "" }, { "docid": "8153f5c8e53e199d69185f1ee8ff7b74", "score": "0.66254807", "text": "def distance_point_to_point2d(a,b)\n Math.sqrt((b.x-a.x)**2+(b.y-a.y)**2)\n end", "title": "" }, { "docid": "8e94d1668a1e95b2ba6d84554e1c40df", "score": "0.6621886", "text": "def euclidean(v1, v2)\n d = 0.0\n v1.each_with_index do |e, i|\n d += (v1[i] - v2[i]) ** 2\n end\n Math.sqrt(d)\n end", "title": "" }, { "docid": "e7feb27761bd0d205fab3d168f9b9ecd", "score": "0.6618496", "text": "def distance(a, b)\n case\n when a.empty?\n b.length\n when b.empty?\n a.length\n else\n [(a[0] == b[0] ? 0 : 1) + distance(a[1..-1], b[1..-1]),\n 1 + distance(a[1..-1], b),\n 2 + distance(a, b[1..-1])].min\n end\n end", "title": "" }, { "docid": "e15b9f80dcd8a64f927684872dd4c991", "score": "0.6614452", "text": "def distance_point_to_point2d(a, b)\n Math.sqrt((b.x - a.x)**2 + (b.y - a.y)**2)\n end", "title": "" }, { "docid": "f6bb368039d8913d188c9dc3b76e334e", "score": "0.6591215", "text": "def dist(x, y)\n\t\t\t(@x - x).abs + (@y - y).abs\n\t\tend", "title": "" }, { "docid": "6b9f9803076a44b697c8146522f8c3cf", "score": "0.6584293", "text": "def dist_between(a, b)\n 1.0\n end", "title": "" }, { "docid": "fdcff1c52b34f6e16d223119d2c7c0ae", "score": "0.65819764", "text": "def distance(point2)\n end", "title": "" }, { "docid": "6cc8fda99bc8a2e909f03e67cbaad7dc", "score": "0.6567295", "text": "def distance\n Math.sqrt(@x**2 + @y**2)\n end", "title": "" }, { "docid": "9f7295bbf6dc172909be292a3c04a95e", "score": "0.656013", "text": "def distance(point1, point2)\n distance = 0\n point1.each_index do |i|\n distance += (point1[i] - point2[i]) ** 2\n end\n\n distance.sqrt\n end", "title": "" }, { "docid": "83589a71ed3b416137f3c0733a15feae", "score": "0.6556339", "text": "def distance s1, s2\n analyze( s1, s2 ).distance\n end", "title": "" }, { "docid": "deb77d581ecffb8344d33f7337a3a04b", "score": "0.6545725", "text": "def distance(x,x2,y,y2)\n Math.sqrt(( x - x2)**2 + (y - y2)**2)\n end", "title": "" }, { "docid": "b667c10ec51a2857cceae40e207569bb", "score": "0.6531299", "text": "def distance_between(point1, point2, options = T.unsafe(nil)); end", "title": "" }, { "docid": "70430344e97cf06447693025ec34688c", "score": "0.65280664", "text": "def orthogonal_distance source, destination\r\n (source.x - destination.x).abs + (source.y - destination.y).abs\r\n end", "title": "" }, { "docid": "a6d3a025071b239ecc8fccd4ae13967b", "score": "0.6516751", "text": "def distance(coord_a, coord_b)\n 1\nend", "title": "" }, { "docid": "1c7f73151748fecf2dc98ea772a2e750", "score": "0.651247", "text": "def distance(p1, p2)\n if p1.size != p2.size\n raise \"dimension of the points is not same!\"\n end\n sum = 0.0\n p1.size.times do |i|\n sum += (p1[i] - p2[i])**2\n end\n #return Math::sqrt(sum)\n return sum\nend", "title": "" }, { "docid": "c001f69d8794b8a2f849744607cac0dd", "score": "0.6511816", "text": "def dist_2d(p0, p1)\n Math.sqrt(sqr(p0.x - p1.x) + sqr(p0.y - p1.y))\nend", "title": "" }, { "docid": "149d4f3e4dae8030f3685b3e94bd0123", "score": "0.6491928", "text": "def euclidean_distance(other)\n assert_equal_dimmensions(other)\n sum_pairwise(other) { |x, ox| (x - ox) ** 2 } ** 0.5\n end", "title": "" }, { "docid": "0c14d945f3423a2fd8216bb27e4ac629", "score": "0.6471646", "text": "def distance(point1,point2)\r\n xdist=(point1[0]-point2[0]).abs #row\r\n ydist=(point1[1]-point2[1]).abs #col\r\n manhattandistance = xdist+ydist\r\n return manhattandistance\r\n end", "title": "" }, { "docid": "6feb8f9226fc190a38f24f2e3cc2b100", "score": "0.646944", "text": "def euclidean_distance(x, y)\n sq = x.zip(y).map { |a, b| (a - b)**2 }\n Math.sqrt(sq.reduce(0) { |a, e| a + e })\nend", "title": "" }, { "docid": "a92effcd49a4bc6522b67135e6b69eca", "score": "0.64663756", "text": "def distance(another)\n return nil unless another.respond_to?(:coordinates) && another.dimensions == dimensions\n\n square_diff = 0\n coordinates.each_index do |i|\n square_diff += (coordinates[i] - another.coordinates[i]) ** 2\n end\n ::Math.sqrt(square_diff)\n end", "title": "" }, { "docid": "c40af294ae3b2e547f0d58f7366a3a8e", "score": "0.6460748", "text": "def dist(a, b)\n\t\t\n\t\tdmin = length(a,b)\n\t\t# puts dmin\n\t\tif dmin == -1\n\t\t\treturn Float::INFINITY\n\t\telse\n\t\t\treturn dmin\n\t\tend\t\t\n\tend", "title": "" }, { "docid": "1f061af6d363c15aa3ef8b1712ee7ef1", "score": "0.64587307", "text": "def distance(other)\n other = Point.new(other[0], other[1]) if other.is_a?(Array)\n raise TypeError, \"Distance between Ray and #{ other.class } is not defined\" unless other.is_a?(Point)\n\n return 0 if self.contains?(other)\n\n proj = Line.new(self.p1, self.p2).projection_point(other)\n if self.contains?(proj)\n return (other - proj).abs\n end\n \n (other - self.source).abs\n end", "title": "" }, { "docid": "6a87ac414a2ead6fd3895ed0e05c79ed", "score": "0.6457289", "text": "def distance_between_two(data1, data2)\n counter = count_to_value(data1) - count_to_value(data2)\n counter.abs\n end", "title": "" }, { "docid": "be89eaee8194de27a8e5fa44fb2ba964", "score": "0.6449728", "text": "def flat_distance(x1, x2, y1, y2)\n Math.hypot((x2-x1), (y2-y1))\nend", "title": "" }, { "docid": "4ad14c0c59e0c7b9743f81500a6e81a8", "score": "0.6448793", "text": "def distance(point1, point2) #INPUT: two points\n d = (point2.x - point1.x)**2 + (point2.z - point1.z)**2\n d = Math.sqrt(d)\n return d\n end", "title": "" }, { "docid": "2f70e3ab06de5ed3b04fb8523d452974", "score": "0.6447474", "text": "def distance(other)\n other = Point.new(other[0], other[1]) if other.is_a?(Array)\n raise TypeError, \"Distance between Segment and #{ other.class } is not defined\" unless other.is_a?(Point)\n\n vp1 = other - self.p1\n vp2 = other - self.p2\n\n dot_prod_sign_1 = self.direction.to_point.dot(vp1) >= 0\n dot_prod_sign_2 = self.direction.to_point.dot(vp2) <= 0\n\n if dot_prod_sign_1 && dot_prod_sign_2\n return Line.new(self.p1, self.p2).distance(other)\n end\n\n if dot_prod_sign_1 && !dot_prod_sign_2\n return vp2.abs\n end\n\n if !dot_prod_sign_1 && dot_prod_sign_2\n return vp1.abs\n end\n end", "title": "" }, { "docid": "f90707b10ad8d08195c66ddc47b32807", "score": "0.64431477", "text": "def distance(a, b)\n Geocoder::Calculations.distance_between(a, b)\n end", "title": "" }, { "docid": "3ca13489daf27a6472166ffdbeff7bff", "score": "0.6438998", "text": "def distance_between\n end", "title": "" }, { "docid": "845dc2eeb88201e1b54ad2546032cb73", "score": "0.64344525", "text": "def distance(a, b)\n dx = (a / rows - b / rows) * @col_factor\n dy = (a % rows - b % rows) * @row_factor\n\n Math.sqrt(dx**2 + dy**2)\n end", "title": "" }, { "docid": "a3b0e8e91dc1f1738b3e8941cff20f1d", "score": "0.6434209", "text": "def length\n vertex_1.distance_to(vertex_2)\n end", "title": "" }, { "docid": "d75013e1932cf68eebb1ef5d1dc743cc", "score": "0.64269936", "text": "def distance(location_a, location_b)\r\n\t\t(location_a.x - location_b.x).abs + (location_a.y - location_b.y).abs\r\n\tend", "title": "" }, { "docid": "b7a505538b2f1076dadb40c0735dcc37", "score": "0.64247006", "text": "def find_distance(a, b)\n x1, y1 = a\n x2, y2 = b\n (x1 - x2).abs + (y1 - y2).abs\nend", "title": "" }, { "docid": "da6e7e675dff9085fe8d2c82a3460b95", "score": "0.6414348", "text": "def CGPointDistance(point1, point2)\n\tCGPointLength(CGPointSubtract(point1, point2))\nend", "title": "" }, { "docid": "7d43ed5de374a0707134fb87b5c4661e", "score": "0.6411894", "text": "def distance(other)\n Math.sqrt(squared_distance(other))\n end", "title": "" }, { "docid": "b2715edd052ce20f980ac7258c57f50b", "score": "0.6398709", "text": "def dist2(other)\n (@x - other.x)*(@x - other.x) + (@y - other.y)*(@y - other.y)\n end", "title": "" }, { "docid": "bf32097eec2fe3235a664c7e221bc97a", "score": "0.639058", "text": "def distance(coord1, coord2)\n x1,y1 = coord1\n x2,y2 = coord2\n Math.sqrt((x1 - x2)**2 + (y1 - y2)**2)\nend", "title": "" }, { "docid": "2427e88483ba15a18a416284a0fd39d6", "score": "0.6389773", "text": "def distance(a, b)\n x = b['x'] - a['x']\n y = b['y'] - a['y']\n z = b['z'] - a['z']\n Math.sqrt((x ** 2) + (y ** 2) + (z ** 2))\nend", "title": "" }, { "docid": "d9a3bea4830e220b8ceface1c9bac30b", "score": "0.6386867", "text": "def distance_to(x, y)\n return Math.hypot(x - @x, y - @y)\n end", "title": "" } ]
a2295a5a61427526484e90106878c3a4
The "Subject" text field page element definition.
[ { "docid": "51a89b55cb3ed10a93428f34620032ec", "score": "0.72359544", "text": "def subject_element\n current_div.text_field(:id=>\"comp-subject\")\n end", "title": "" } ]
[ { "docid": "0aa1cc7584224f23051efac49931c5e7", "score": "0.7823229", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "0aa1cc7584224f23051efac49931c5e7", "score": "0.7823229", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "0aa1cc7584224f23051efac49931c5e7", "score": "0.7823229", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.7818261", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.7817746", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.7817746", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.7817746", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.7817746", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.7817746", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.7817746", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.7817746", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.7817746", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.7817746", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "7faada5dc2a3e533d1e8b13bf66999ee", "score": "0.76685387", "text": "def subject=(text)\n subject_element.set text\n end", "title": "" }, { "docid": "80d5fa595480d12757a2c519884f7b3f", "score": "0.7338371", "text": "def subject\n first_element_text('subject')\n end", "title": "" }, { "docid": "1f23f200a3e5878c4bd5453d4bf9dafe", "score": "0.72428215", "text": "def subject=(s)\n replace_element_text('subject', s)\n end", "title": "" }, { "docid": "6a26cb28e002fcdcabff93f31a7d3216", "score": "0.7117542", "text": "def subject=(subject)\n @content[pn(:Subject)] = pl(subject)\n end", "title": "" }, { "docid": "09fd44300aaaa367f6fa38dd31fcbb56", "score": "0.70523155", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "09fd44300aaaa367f6fa38dd31fcbb56", "score": "0.70523155", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "09fd44300aaaa367f6fa38dd31fcbb56", "score": "0.70523155", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "09fd44300aaaa367f6fa38dd31fcbb56", "score": "0.70523155", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "09fd44300aaaa367f6fa38dd31fcbb56", "score": "0.70523155", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "09fd44300aaaa367f6fa38dd31fcbb56", "score": "0.70523155", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "09fd44300aaaa367f6fa38dd31fcbb56", "score": "0.70523155", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "adab5fbcef94747391c4ce52e337047e", "score": "0.70438254", "text": "def subject=(subject)\n set_content_for :subject, subject\n end", "title": "" }, { "docid": "6e74d38982d77ab2d4f1247a232115b0", "score": "0.70402896", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "50f888854f638edf42618d35300fb025", "score": "0.70350784", "text": "def subject=( str )\n set_string_attr 'Subject', str\n end", "title": "" }, { "docid": "4ff9c58cae5e6739edda949291e18f0b", "score": "0.7013163", "text": "def subject=(text)\n self.subject_raw = SMail::MIME.encode_field(text)\n end", "title": "" }, { "docid": "23eff6c61a6c900432383b9130c65add", "score": "0.69970536", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "705f0c58b64c0240e72ea4241bb93fbe", "score": "0.69934535", "text": "def email_custsubj; det.form(:name, 'configSmtpEmail').text_field(:id, 'subject'); end", "title": "" }, { "docid": "dc0e2948b8652d7848b464a5ec15a020", "score": "0.69432956", "text": "def subject(string)\n self << \"SUBJECT\" << string\n end", "title": "" }, { "docid": "3595e96093bf4fdb3c90ed70810c54bc", "score": "0.6829086", "text": "def subject(string)\n return add_params(SUBJECT, string)\n end", "title": "" }, { "docid": "60a2d908c8044990c844333ae54c7235", "score": "0.6823483", "text": "def SetSubject(subject)\n #Subject of document\n @subject = subject\n end", "title": "" }, { "docid": "c14d27c2cd6a2119b115cff14268ed66", "score": "0.6769833", "text": "def subject\n @attributes[:subject]\n end", "title": "" }, { "docid": "c14d27c2cd6a2119b115cff14268ed66", "score": "0.6769833", "text": "def subject\n @attributes[:subject]\n end", "title": "" }, { "docid": "c14d27c2cd6a2119b115cff14268ed66", "score": "0.6769833", "text": "def subject\n @attributes[:subject]\n end", "title": "" }, { "docid": "fa33adbf1eecc39bcd457b78590d6d3f", "score": "0.67445284", "text": "def subject=(s)\n\t\t@subject = s\n\tend", "title": "" }, { "docid": "3017141db42381c7cc5da401735d5c9e", "score": "0.6718719", "text": "def subject\n read_content :subject\n end", "title": "" }, { "docid": "a88f0f72dc91909c2d67b95574182c34", "score": "0.66905653", "text": "def subject\n @msg['Subject']\n end", "title": "" }, { "docid": "a88f0f72dc91909c2d67b95574182c34", "score": "0.66905653", "text": "def subject\n @msg['Subject']\n end", "title": "" }, { "docid": "acf6d147f72804aba88819156ef816a8", "score": "0.66625035", "text": "def subject=(subject)\n @subject=subject\n end", "title": "" }, { "docid": "cd102ddfdeace0a98444703d0fae632d", "score": "0.6650707", "text": "def subject=(value)\n @children['subject'][:value] = value\n end", "title": "" }, { "docid": "7185a9834ff622fb3763f3463c66a402", "score": "0.6640029", "text": "def sms_custsubj; det.form(:name, 'configSmtpSms').text_field(:id, 'subject'); end", "title": "" }, { "docid": "a491d4566a49c2b86828dfb65165ac46", "score": "0.6629529", "text": "def subject\n @subject ||= Subject.new(@node.at('subject'))\n end", "title": "" }, { "docid": "d2f26cb27e81ae8b03fd141a0f231955", "score": "0.6628263", "text": "def subject=(subject); @message_impl.setSubject subject; end", "title": "" }, { "docid": "98da9102c01851fa213c08ba869b9856", "score": "0.6530576", "text": "def subject=(subject)\n @subject = subject\n end", "title": "" }, { "docid": "00b6a5821d086aac53df53d687eee6bd", "score": "0.6528071", "text": "def subject=(subject)\n Cproton.pn_message_set_subject(@impl, subject)\n end", "title": "" }, { "docid": "adc4d6f399275aa030fdd9d865497b26", "score": "0.6511307", "text": "def subject(subj)\n if not subj.instance_of? String\n STDERR.puts \"ELTmail::Mail: subject ERROR: requires a String\"\n exit 1\n end\n @subject=subj\n @message.header.subject=@subject\n end", "title": "" }, { "docid": "08611253a1d3cae6dfbc8b4238e247ee", "score": "0.6490431", "text": "def subject\n @subject = page.present? ? page.present_title(vars) : nil\n end", "title": "" }, { "docid": "0bb51af8e2fb83533ca430c259063010", "score": "0.6448776", "text": "def subject(subj = nil)\n set_multi_simple(:subject, subj)\n end", "title": "" }, { "docid": "de234bc160d6b9ea980e7d1cfb28d1e4", "score": "0.6366373", "text": "def subject\n SMail::MIME.decode_field(subject_raw)\n end", "title": "" }, { "docid": "94c2ae2e178cc2d49fa33b01bd66f87d", "score": "0.6366016", "text": "def subject_params\n params.require(:subject).permit(:subjectcode, :title, :description, :create_date)\n end", "title": "" }, { "docid": "9dfb96ef610a526869a40a23f0c90a91", "score": "0.6364299", "text": "def subject_raw=(text)\n self.header_set('subject', text)\n end", "title": "" }, { "docid": "086f3cabbe22eb51f456ff15266621f2", "score": "0.63459986", "text": "def subject=(s)\n msg = Message.new\n msg.subject = s\n send(msg)\n end", "title": "" }, { "docid": "74748f774b2086ad45b568e34137380b", "score": "0.6313675", "text": "def subject_params\n params.require(:subject).permit(:subject_name, :subject_code, :description, :course_id)\n end", "title": "" }, { "docid": "9f95361cf5e95156660c6c2cbddcb24a", "score": "0.62963605", "text": "def subject_and_body\n if subject.blank?\n body.blank? ? '' : body\n else\n body.blank? ? subject : \"#{subject} - #{body}\"\n end\n end", "title": "" }, { "docid": "725a3ae08b56656d5842ac79a92da542", "score": "0.62892044", "text": "def subject\n self[Solrizer.solr_name('subject_value')]\n end", "title": "" }, { "docid": "6140e73ee355af7cdcaa1bec13316266", "score": "0.6281734", "text": "def subject\n @subject ||= @email.subject.to_s\n end", "title": "" }, { "docid": "25344c982752c1189a85d381a85e9cf1", "score": "0.6253138", "text": "def subject_description\n lookup_ref_data_value(:subject_code, @subject_code)\n end", "title": "" }, { "docid": "da6f5013c14620f16d6102c72b3aa5ee", "score": "0.6236303", "text": "def subject_params\n params.require(:subject).permit(:name, :short_name, :description, :image, :image_css, :subject_type, :root_question_id)\n end", "title": "" }, { "docid": "d0e1de61fdd3b17c2381046c60ded7bd", "score": "0.62227684", "text": "def subject_name\n subject_full_name\n end", "title": "" }, { "docid": "4905fb24eb7d08bf9affdba320a4cacb", "score": "0.6205608", "text": "def event_subject=(value)\n @event_subject = value\n end", "title": "" }, { "docid": "26f526684818fec59c2e44292749f992", "score": "0.61928886", "text": "def subject_params\n params.require(:subject).permit(:forum_id, :title, :description, :username)\n end", "title": "" }, { "docid": "0fa56be84c0a8c0710dcc8f6cd82ea6e", "score": "0.61788356", "text": "def subject\n ::Registeruz::Subject.find(@subject_id)\n end", "title": "" }, { "docid": "75e4ae88ce617fd153e0a7564934bd04", "score": "0.61764216", "text": "def default_subject\n DEFAULT_SUBJECT\n end", "title": "" }, { "docid": "de562848e5cfcea7e6be7a43c0aab754", "score": "0.6168817", "text": "def subject_params\n params.require(:subject).permit(:name, :summary, :user_id)\n end", "title": "" }, { "docid": "d8decc4e6f01660c7e8f4bb726fe5ad1", "score": "0.61491597", "text": "def set_subject(s)\n self.subject = s\n self\n end", "title": "" }, { "docid": "80fb3df28d834220985a8394856e7b6b", "score": "0.6146859", "text": "def subject_params\n params.require(:subject).permit(:title, :definition)\n end", "title": "" }, { "docid": "18b111f45ada5085dece93ef7fd198d8", "score": "0.6146712", "text": "def topic_subject\n \"#{subject_topic} - #{name}\"\n end", "title": "" }, { "docid": "0d214ce6c70e5f2f96c759e4cff712c7", "score": "0.61429185", "text": "def subject\n fetch('educator.subject')\n end", "title": "" }, { "docid": "12a920b12a27ae3060716b90b4042f72", "score": "0.61113536", "text": "def subject_params\n params.require(:subject).permit(:subject, :image, :description)\n end", "title": "" }, { "docid": "ccb967a85d746059897d003cd53e5766", "score": "0.61030155", "text": "def subjects=(value)\n @subjects = value\n end", "title": "" }, { "docid": "64f31f2caedb4d33663770661eca842a", "score": "0.6097865", "text": "def subject_params\n #subject show page: outline, page, operation, version_id\n #subject edit: remove_picture, periods, number_of_outlines, tags\n params.permit(:name, :pk, :value, :tags, :version_id, :page, :order, :search, :number_of_outlines, :courses, :semesters, :periods, :auto_type, :outline, :operation, :remove_picture)\n params.require(:subject).permit(:name, :description, :year, :place, :semester_id, :uni_year_id, :course_id, :picture, :teachers)\n end", "title": "" }, { "docid": "622f6a368a43588da892b32d45dc8f05", "score": "0.60912", "text": "def add_subject\n add_subject_button.click\n end", "title": "" }, { "docid": "94504ddb25f9cb013e28e5774851d7e5", "score": "0.60779816", "text": "def subject=(subject)\n @subject = subject\n\n self.stored_subject = subject ? serialize(:subject, subject) : {}\n self.subject_id = subject ? subject.id : nil\n assign_type_for(:subject, subject)\n\n self.target = subject.target if subject.respond_to?(:target)\n self.creator = subject.creator if subject.respond_to?(:creator)\n\n subject\n end", "title": "" }, { "docid": "8ce192cb0eeac1cca7c1d5f1295be992", "score": "0.6069814", "text": "def subject\n @subject ||= convert(Mail::Encodings.decode_encode(message.subject || '', :decode))\n end", "title": "" }, { "docid": "25da83c993ce4cf1f7b9941e027ed63a", "score": "0.60667545", "text": "def subject\n email_message.subject\n end", "title": "" }, { "docid": "01df34cad757e9ffe18fd8399921934c", "score": "0.605457", "text": "def subject\n @config[\"subject\"]\n end", "title": "" }, { "docid": "cf2a25634b64117bc458dafa8c7f8602", "score": "0.6054157", "text": "def subject=(s)\n self.cached_alert_group = nil\n attribute_set(:subject, s)\n end", "title": "" }, { "docid": "cf38a7b0c25cdaf4caa7f669a2c81211", "score": "0.6051512", "text": "def subject_raw\n self.header('subject')\n end", "title": "" }, { "docid": "20e4267b6397ef5409d8d48a8cdac18d", "score": "0.60454625", "text": "def add_default_subject\n self.subject = 'IMPORTANT!!!'\n end", "title": "" }, { "docid": "0e679dd9a9eb0f4062d41f4be02e2f76", "score": "0.6040751", "text": "def subjects\n @subjects ||= {\n :price => t('subjects_price'),\n :questions => t('subjects_questions'),\n :marketing => t('subjects_marketing'),\n :design => t('subjects_design'),\n :hosting => t('subjects_hosting'),\n :other => t('subjects_other')\n }\n end", "title": "" }, { "docid": "0fac87d58c251019e52a079a0a8edc46", "score": "0.60371274", "text": "def subject_params\n params.require(:subject).permit(:section, :name)\n end", "title": "" }, { "docid": "d76dd73b7938497a8a545367f416ec29", "score": "0.60313416", "text": "def subject_params\n params.require(:subject).permit(:userid, :title, :author, :language, :comments)\n end", "title": "" }, { "docid": "2b0decb074fe87eb6851f249be929646", "score": "0.6029559", "text": "def subject_title\n self.title || self.project_doc_id || self.to_id\n end", "title": "" }, { "docid": "5b97accc2422140e68c3765af2839e19", "score": "0.6013289", "text": "def subject\n\n unless @subject\n subject = mail.subject.strip rescue \"\"\n ignores = config['ignore']['text/plain']\n if ignores && ignores.detect{|s| s == subject}\n @subject = \"\"\n else\n @subject = transform_text('text/plain', subject).last\n end\n end\n\n @subject\n end", "title": "" }, { "docid": "ba3d1ff009842a6cc6f281e2dfe486b3", "score": "0.5992545", "text": "def subject_params\n params.require(:subject).permit(:name)\n end", "title": "" }, { "docid": "860514d3f5affdcdf60c39362afd1f80", "score": "0.59891665", "text": "def parse_subject(attrs = {})\n self.parsed_subject = subject_template.render(\n attrs.deep_stringify_keys, strict_variables: true)\n end", "title": "" }, { "docid": "4d7342d452bc5c66b28da5aad29a9197", "score": "0.5986652", "text": "def external_subject_input(plan_subject)\n value = if plan_subject.subject.is_a?(ExternalSubject) || plan_subject.subject_id == 0\n plan_subject.subject[:label]\n else\n ''\n end\n tag('input', { 'type' => 'text', 'id' =>\n \"external_subject_detail_#{plan_subject.id}_label\",\n 'name' => \"plan_subject[#{plan_subject.id}][label]\", \"value\" => value})\n end", "title": "" }, { "docid": "244432063ff3c2638a279760c8a7374f", "score": "0.5983484", "text": "def title\n @subject.title\n end", "title": "" }, { "docid": "244432063ff3c2638a279760c8a7374f", "score": "0.5983484", "text": "def title\n @subject.title\n end", "title": "" }, { "docid": "841564f1f89e07cf2e1518a028750681", "score": "0.59807426", "text": "def check_subject(subject)\n subject.blank? ? \"(No Subject)\" : subject\n end", "title": "" }, { "docid": "76d5a43318efe8a9a5bf172825245b29", "score": "0.5978306", "text": "def page_subject_params\n params.require(:page_subject).permit(:page_id, :subject_id)\n end", "title": "" }, { "docid": "f4f2f9e7807c0f6f49352e629c2707aa", "score": "0.59779245", "text": "def subject_params\n params.fetch(:subject, {})\n end", "title": "" }, { "docid": "79c4a42d5ae41a1908ad22f8edf441f8", "score": "0.59768754", "text": "def subject=(subject)\n @subject = subject\n super\n end", "title": "" }, { "docid": "66758937e2a49c49126e2e512ecce35d", "score": "0.5960081", "text": "def subject_params\n params.require(:subject).permit(:title, :description, :user_id, :topic_ids => [])\n end", "title": "" }, { "docid": "b496693aef69c3bff62150e6f16c802c", "score": "0.5944769", "text": "def set_subject\n @subject = @forum.subjects.friendly.find(params[:id])\n end", "title": "" }, { "docid": "a66e263221adcbc8a96cc114c4d8371f", "score": "0.5937252", "text": "def subjects; end", "title": "" }, { "docid": "e2ce42004cc203ca0172d591bc0d47d0", "score": "0.5937248", "text": "def subject\n\t\t\tnil\n\t\tend", "title": "" }, { "docid": "fe4b87eb2ae8314e78a2b19cb5d4cd00", "score": "0.5931745", "text": "def subject_code=(value)\n a = value.split('>$<')\n @subject_code = a[0]\n @subject_domain = a[1]\n @srv_code = a[2]\n @wrk_refno = 1 # always 1 for RSTU\n end", "title": "" } ]
41488da96198763cca87c8ff569b2dd8
assists in user edit path
[ { "docid": "fe6e419f4f4591ddbe6f43110f179df0", "score": "0.0", "text": "def user_path\n \"users/#{@current_user.id}\"\n end", "title": "" } ]
[ { "docid": "3fb211158bbbef1f0ec5d5d4b4e11f9f", "score": "0.74137396", "text": "def user_edits\n redirect_to home_path if current_user != User.find(params[:id])\n end", "title": "" }, { "docid": "b238158da6dfc4ee53a70858e64413ff", "score": "0.71376675", "text": "def edit\n require_user\n end", "title": "" }, { "docid": "69a376ed53fb3ce6cbff299b2555a13f", "score": "0.7097632", "text": "def edit\n\t @user = User.find(params[:id])\n\t redirect_to root_path unless current_user.is_admin? or @user == current_user\n\tend", "title": "" }, { "docid": "412491815887359bae3b9cde59e77855", "score": "0.7087919", "text": "def edit\n # Listing 9.14: Finding the correct user is now handled by the correct_user before_action.\n end", "title": "" }, { "docid": "0b76950497d6fc28178660a4807b0869", "score": "0.7084128", "text": "def edit_user\n redirect_to(root_url) unless current_user.edit?\n end", "title": "" }, { "docid": "30a35c408a88afac79026337f9f2f71b", "score": "0.7062484", "text": "def edit\n if current_user.access == 2\n redirect_to \"/users/indexU\"\n end\n end", "title": "" }, { "docid": "9c1ad174872f39af448a6a0f2e119fac", "score": "0.7046539", "text": "def edit\n set_user\n end", "title": "" }, { "docid": "1cf29619e413c8bc7440ccc2851d8594", "score": "0.7028521", "text": "def edit\n # @user = User.find(params[:id])\n # already in correct_user\n end", "title": "" }, { "docid": "41df75b2e6086548dcf92d519a8ca875", "score": "0.6958928", "text": "def edit\n @user = User.friendly.find(params[:id])\n if not_owner_check(@user)\n redirect_to current_user\n end\n end", "title": "" }, { "docid": "369f61c3efa7da002be1498de084e3bb", "score": "0.69552124", "text": "def edit\n redirect_back_or_default(\"/\") if\n !@user&.admin && session[:real_user_id].blank?\n end", "title": "" }, { "docid": "e36c9d1f18623abc59b8c7958dd1a154", "score": "0.6931698", "text": "def edit\n redirect_to root_url and return unless current_user\n @user = current_user\n end", "title": "" }, { "docid": "77b3d250d1d7f75bbd0fc72a279ac868", "score": "0.6900126", "text": "def edit\n # @user = User.find(params[:id]) -- not needed bc of correct_user\n end", "title": "" }, { "docid": "15454d3657219a48086363cab47ad28f", "score": "0.68857104", "text": "def edit_current_user\n end", "title": "" }, { "docid": "6eebb1d80ec724215dbd2970f32430e9", "score": "0.68427396", "text": "def edit\n enforce_update_permission(@user)\n end", "title": "" }, { "docid": "ffab3d6129c5ebd2b3bade05254f64c3", "score": "0.68245506", "text": "def edit\r\n \t@user = current_user\r\n end", "title": "" }, { "docid": "6e341a0c25ca5bcffefb5bd92eb8ecc8", "score": "0.68001217", "text": "def edit\n user_store_url\n @user = current_user\n if params[:id] && params[:id] != \"current\" && @user.admin?\n @user = User.find(params[:id])\n end\n end", "title": "" }, { "docid": "056995ca85307dc58f28166aa51e1708", "score": "0.67828584", "text": "def edit\n get_user_for_edit\n end", "title": "" }, { "docid": "86fe8d204eee5ec021c2ee6f59cef401", "score": "0.67655396", "text": "def edit\n return redirect_to(@user) if @user != current_user\n end", "title": "" }, { "docid": "edfd33a3686e7a892df0c2f68a43319b", "score": "0.67068636", "text": "def edit\n # find the user by the user id in the route params\n # (this will likely be moved to its own before method)\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "8e10f9406df81c5cbead2424af63f787", "score": "0.66890484", "text": "def can_edit?(user)\n\n end", "title": "" }, { "docid": "7b45baf1d0baf230dbd886283923df60", "score": "0.6674745", "text": "def edit\n\t\t# admin is able to edit any user's page\n if current_user.is_admin?\n @user = User.find(params[:id])\n else\n @user = current_user\n end\n end", "title": "" }, { "docid": "af0bc86d7c01368410d856b19b9892cb", "score": "0.66472286", "text": "def user_profile_edit\n\n\n end", "title": "" }, { "docid": "95bd900c918f7bb2c32ae73a99e41460", "score": "0.66411567", "text": "def edit\n\t@user = User.find(params[:id])\n\t@title = \"Edit user\"\n end", "title": "" }, { "docid": "efa00f892e6a07e14d4ce4469fb66ce4", "score": "0.66316634", "text": "def edit\n add_breadcrumb @user.name, :backend_user_path\n add_breadcrumb I18n.t('integral.breadcrumbs.edit'), :edit_backend_user_path\n end", "title": "" }, { "docid": "c8e036f0fab169d2e01efea504c0cf18", "score": "0.66292405", "text": "def edit\n @update_welcome = 'You have accessed the update page'\n @user = User.find(params[:id])\n\n end", "title": "" }, { "docid": "ac569d34681ed0e1991e78b83a534cf2", "score": "0.66214174", "text": "def edit\n \t@user = current_user\n end", "title": "" }, { "docid": "4a1633e215b934f187c1e4bd97d253b6", "score": "0.66183037", "text": "def edit\n\t\tadd_breadcrumb \"Editar\"\n\t\tif @request.user_id != current_user.id\n\t\t\tredirect_to root_path, alert: \"Usted no es el creador de la solicitud, por lo que no puede modificarla. Contáctese con su administrador.\"\n\t\tend\n\tend", "title": "" }, { "docid": "1fa2318ac845ca596172f0055d3722c3", "score": "0.66139156", "text": "def edit\n #Lesson 9\n # @user = User.find(params[:id]) #commented out and moved down to correct_user\n end", "title": "" }, { "docid": "5a2d30293ae62e8fdc458c8e4faf9d67", "score": "0.6598541", "text": "def edit\n\n #Make sure only logged in admins can manipulate users\n\n if @loggedinuser && @loggedinuser.authorizationlevel >= 4\n \t@user = User.find(params[:id])\n else \n redirect_to '/'\n end\n end", "title": "" }, { "docid": "4d7d7083ff6d3df6ccd6a1caf2c20013", "score": "0.65881985", "text": "def edit\n\t\tif !current_user || !is_this_user\n\t\t\tredirect_to user_path(params[:id])\n\t\tend\n\tend", "title": "" }, { "docid": "d980fa79bcb7cef6e03307d8c9fec3d0", "score": "0.6568331", "text": "def edit\n load_user\n return if (@user.blank?)\n\n respond_to do|format|\n format.html\n end\n end", "title": "" }, { "docid": "56edd95333df24cac7d393cb4d89cef0", "score": "0.6559258", "text": "def edit\n @user = User.find(params[:id])\n\n deny_wrong_user if !current_user?(@user)\n end", "title": "" }, { "docid": "672d69a763d345e94e7e5a438e727e07", "score": "0.6552962", "text": "def edit\n @user = User.find(params[:id])\n logger.tagged(\"edit current user: \") {logger.debug @current_user.attributes}\n #TODO : make sure permissions are handled correctly\n can_edit_hash = Permissions.currentLoggedInOrHasMorePermissions(@current_user,@user)\n logger.tagged(\"edit user perm hash: \") {logger.debug can_edit_hash}\n if can_edit_hash[:has_permission]\n can_destroy_hash = Permissions.hasMorePermissions(@current_user,@user)\n @can_destroy = can_destroy_hash[:has_permission]\n else\n flash[:warning] = can_edit_hash[:permission_message]\n redirect_to user_path(@user)\n end\n\n end", "title": "" }, { "docid": "5754657852eb87eaf1ab7f4fd87981fd", "score": "0.65496576", "text": "def edit\n # @user は編集対象のユーザー\n # current_user はログインしているユーザー \n @user = User.find(params[:id])\n if (current_user != @user)\n redirect_to root_path\n end\n end", "title": "" }, { "docid": "b902e3daa8de14cae5a56bc36648dd38", "score": "0.6541699", "text": "def edit\n @user = User.all.deep.find(current_user.id)\n authorize! :edit, @user\n\n render 'users/settings'\n end", "title": "" }, { "docid": "e3edfdf50c167cbcafb899a54a738225", "score": "0.65391505", "text": "def edit_path(path)\n url('/e/' + path)\n end", "title": "" }, { "docid": "9c75e4ef7a4705121a31af8edb03f298", "score": "0.6538833", "text": "def edit\n @page_title = 'Edit user'\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "e1710b0e1b32fbaa7f360f8217dc391f", "score": "0.6537614", "text": "def edit\n @user = current_user\n end", "title": "" }, { "docid": "30f86208126e0172907d13577f8961b4", "score": "0.6529657", "text": "def edit\n\t\tthe_user_id = params[\"id\"]\n \t@user = User.find_by(:id => the_user_id)\n\tend", "title": "" }, { "docid": "f4c72c6ca89b78e0710d57bbf3781821", "score": "0.6522946", "text": "def edit\n \n @user = User.find(params[:id])\n \n end", "title": "" }, { "docid": "74e7019e7a8f398f0922eae162cad88e", "score": "0.652134", "text": "def edit\n __log_activity\n __debug_route\n id = identifier_list.first\n if id.is_a?(Integer)\n @item = User.find_record(id) or raise \"invalid selection #{id.inspect}\"\n else\n @item = current_user\n end\n super\n end", "title": "" }, { "docid": "448b6d0cf71c10e88c941bd36e028132", "score": "0.65150404", "text": "def edit\n #@user = User.find(params[:id]) \n #replced by the before_action at the top\n end", "title": "" }, { "docid": "23c14259c9a6a16c1303e1f65aa8e384", "score": "0.6514765", "text": "def edit\n reset_session_key(:user, @user_id, {})\n redirect_to wizard_path('identity')\n end", "title": "" }, { "docid": "8f03065e50b577aa393565d3daf8fff0", "score": "0.65144193", "text": "def edit \t\t\t\t\t\t\t #render user page \n \t@user = User.find(session[:user_id])\n end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6513778", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6513778", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6513778", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6513778", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6513778", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6513778", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6513778", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6513778", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6513778", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6513778", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6513778", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6513778", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6513778", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6513778", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6513778", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6513778", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6513778", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6513778", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6513778", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6513778", "text": "def edit; end", "title": "" }, { "docid": "7a50b8dde89fe9290163ca8e27a336fe", "score": "0.6513778", "text": "def edit; end", "title": "" }, { "docid": "ddc3813b8c288161c19e3c7f999fe8bd", "score": "0.651076", "text": "def edit\n # @user = User.find(params[:id]) <-- not needed; @user defined in correct_user\n end", "title": "" }, { "docid": "7d7157213799ebb243d23574f4a7cb41", "score": "0.6500447", "text": "def correct_user_to_edit\n not_allow if (@job.user.id != current_user.id) \n end", "title": "" }, { "docid": "272a9d821c8b3db8e5d638f8306965db", "score": "0.64950776", "text": "def edit\n @user = User.shod(params[:id])\n authorize! :update, @user\n end", "title": "" }, { "docid": "f544f82789ba4764f32a408d610ef823", "score": "0.6489215", "text": "def edit\n @title = \"Edit user\"\n @user = User.find(params[:id])\n\n end", "title": "" }, { "docid": "931a44f0099ec6620cce06998a6dc6c1", "score": "0.6465787", "text": "def edit_link(path)\n\t\tif user_signed_in? && current_user.editor?\n\t\t\tlink_to(\"<span class='glyphicon glyphicon-pencil'> Editar\".html_safe, path)\n\t\telse\t\n\t\t\t'<a data-toggle=\"modal\" data-target=\"#can-not-edit-modal\"> <span class=\"glyphicon glyphicon-pencil\"> Editar</a>'.html_safe\n\t\tend\n\tend", "title": "" }, { "docid": "0c00a760c9b58cbbe37fa4514378890d", "score": "0.6463973", "text": "def edit\n if @user != current_user\n flash[:error] = \"You cannot do that\"\n redirect_to users_path\n end\n end", "title": "" }, { "docid": "0e30f199ba20cbd26f31cb08bc0055f7", "score": "0.6461895", "text": "def edit\n @user = current_user\n end", "title": "" }, { "docid": "0e30f199ba20cbd26f31cb08bc0055f7", "score": "0.6461895", "text": "def edit\n @user = current_user\n end", "title": "" }, { "docid": "0e30f199ba20cbd26f31cb08bc0055f7", "score": "0.6461895", "text": "def edit\n @user = current_user\n end", "title": "" }, { "docid": "0e30f199ba20cbd26f31cb08bc0055f7", "score": "0.6461895", "text": "def edit\n @user = current_user\n end", "title": "" }, { "docid": "0e30f199ba20cbd26f31cb08bc0055f7", "score": "0.6461895", "text": "def edit\n @user = current_user\n end", "title": "" }, { "docid": "0e30f199ba20cbd26f31cb08bc0055f7", "score": "0.6461895", "text": "def edit\n @user = current_user\n end", "title": "" }, { "docid": "0e30f199ba20cbd26f31cb08bc0055f7", "score": "0.6461895", "text": "def edit\n @user = current_user\n end", "title": "" }, { "docid": "0e30f199ba20cbd26f31cb08bc0055f7", "score": "0.6461895", "text": "def edit\n @user = current_user\n end", "title": "" }, { "docid": "0e30f199ba20cbd26f31cb08bc0055f7", "score": "0.6461895", "text": "def edit\n @user = current_user\n end", "title": "" }, { "docid": "0e30f199ba20cbd26f31cb08bc0055f7", "score": "0.6461895", "text": "def edit\n @user = current_user\n end", "title": "" }, { "docid": "0e30f199ba20cbd26f31cb08bc0055f7", "score": "0.6461895", "text": "def edit\n @user = current_user\n end", "title": "" }, { "docid": "908e62503222d9eb22659e7ef3ebfcd4", "score": "0.64584017", "text": "def edit\r\n @user = current_user\r\n render :layout=>false\r\n end", "title": "" }, { "docid": "285bdc5c85017188ec354a89b150cb6f", "score": "0.6457749", "text": "def edit\n @user = current_user\n render 'edit'\n end", "title": "" }, { "docid": "59e65a6474a0800db5f42a85d57f7942", "score": "0.64548385", "text": "def edit\n # this finds the current user\n @user = User.find params[:id]\n end", "title": "" }, { "docid": "2dd8cf046fba082497ec9f28e571a16a", "score": "0.64540625", "text": "def edit\n # @user is already set by correct_user\n # @user = User.find(params[:id])\n end", "title": "" }, { "docid": "47c5e2ce8ddfa3afab767ecd001ae4b8", "score": "0.645176", "text": "def edit\n @title = \"Edit user\"\n end", "title": "" }, { "docid": "47c5e2ce8ddfa3afab767ecd001ae4b8", "score": "0.645176", "text": "def edit\n @title = \"Edit user\"\n end", "title": "" }, { "docid": "810c936b6a98b3ea83efdcc68d5e4dab", "score": "0.6450012", "text": "def edit\n authorize! :update, @user\n end", "title": "" }, { "docid": "50fe0ec4eaf758690a33e724107a6d7e", "score": "0.6442648", "text": "def edit\n @user = User.find(params[:id])\n # @user は編集対象のユーザー\n # current_user はログインしているユーザー \n\n end", "title": "" }, { "docid": "30bfa0378e23c67865f695434060a962", "score": "0.643309", "text": "def edit\n #similar to the NEW action, but instead of create a empty user, we will find a user by its id and than\n # send its params to the partial form, so the params can be edited. Please note the partial form\n # for details, as the column admin can be edited only buy logged users with admin privileges.\n #@user variable will be used in the partial form, when submitted goes to UPDATE action.\n @user = User.find(params[:id])\n #only admin can edit other users information, so we first check if the user is admin.\n unless current_user.admin?\n #if the user is not admin it can edit only its own information, so we redirect to edit its own information\n unless @user.id == current_user.id\n redirect_to edit_user_path (current_user)\n end\n end\n end", "title": "" }, { "docid": "5165ae3edc7087b8367f55e5142789e8", "score": "0.6431194", "text": "def edit\n if !(current_user.id == @user.id || is_admin?)\n indicate_illegal_request I18n.t('users.not-your-account')\n end\n end", "title": "" }, { "docid": "53a980bd843a85084389e5203da0db9a", "score": "0.6430855", "text": "def edit\n @user = User.find_by_id(params[:id])\n logged_in_user = session[:user_hash][\"username\"]\n if logged_in_user != @user.sunet and not \n User.is_power_user(logged_in_user)\n # permission denied\n flash[:error] = \"Your privileges don't allow you to edit profiles other than your own.\"\n redirect_to \"/users#/users/\"\n end\n @photos = Photo.find_all_by_user_id(params[:id])\n end", "title": "" }, { "docid": "53a980bd843a85084389e5203da0db9a", "score": "0.6430855", "text": "def edit\n @user = User.find_by_id(params[:id])\n logged_in_user = session[:user_hash][\"username\"]\n if logged_in_user != @user.sunet and not \n User.is_power_user(logged_in_user)\n # permission denied\n flash[:error] = \"Your privileges don't allow you to edit profiles other than your own.\"\n redirect_to \"/users#/users/\"\n end\n @photos = Photo.find_all_by_user_id(params[:id])\n end", "title": "" }, { "docid": "585b339ef8e870e8cdfda16d7de80714", "score": "0.64295167", "text": "def edit\n @user = @current_user\n end", "title": "" }, { "docid": "402b7726c0ce88b53d4efbf884842900", "score": "0.6421244", "text": "def edit\n @user= User.find_by_id(current_user.id)\n end", "title": "" }, { "docid": "f02eef39748b22492e1e71a904c76d62", "score": "0.6402536", "text": "def rails_admin_edit_user_link\n return nil unless @current_user.respond_to?(:email)\n abstract_model = RailsAdmin.config(@current_user.class).abstract_model\n return nil unless abstract_model\n return nil unless (edit_action = RailsAdmin::Config::Actions.find(:edit, controller: controller, abstract_model: abstract_model, object: @current_user)).try(:authorized?)\n get_edit_user_link @current_user, url_for(action: edit_action.action_name, model_name: abstract_model.to_param, id: @current_user.id, controller: 'rails_admin/main'.to_sym)\n end", "title": "" }, { "docid": "05a31d0c085ca84b50d01538521e7858", "score": "0.6400557", "text": "def link_user_edit\n return nil unless @user.is_a? User\n msg = 'impostazioni'\n link = { :controller => 'user', :action => 'edit' }\n link[:host] = @host_forum if @host_forum\n link[:only_path] = false if @host_forum\n s = link_to msg, link\n content_tag('span', s, :class => 'profile')\n end", "title": "" }, { "docid": "725e5fe0aac7ee8720dd551b60c84b63", "score": "0.639842", "text": "def edit\n \t@user = User.find params[:id]\n end", "title": "" }, { "docid": "dda4d3d61d9eae3fde2176ab8d6d4738", "score": "0.63943344", "text": "def edit\n # When a http GET request to '/users/1/edit' is received, have it render:\n # a view file with a form with user 1's information in the appropriate input field.\n @id = params[:id]\n @user = User.find(@id)\n end", "title": "" }, { "docid": "261c36f1f91e3af84ea86c6cb7322f2a", "score": "0.63918984", "text": "def edit\r\n jump_to(\"/profiles/#{session[:account_id]}/basic\")\r\n end", "title": "" } ]
49a5188949e5552e5256fcc72cc14174
This method takes a `Logstash::Event` object and converts it into a hash that is acceptable by the Timber API. Each event is converted into a JSON document that conforms to the Timber log event JSON schema: This realized by the following steps: 1. Timber will look for specific keys and map them to the appropriate keys as defined
[ { "docid": "4887d4b6906898d849ed1bc3241dec15", "score": "0.826364", "text": "def event_hash(e)\n timber_hash = {\"$schema\" => JSON_SCHEMA}\n event_hash = e.to_hash\n\n # Delete unused logstash specific attributes\n event_hash.delete(\"@version\")\n\n # Map the timber key first since we merge in values\n # later.\n timber = event_hash.delete(\"timber\")\n if timber.is_a?(Hash)\n timber_hash.merge!(timber)\n end\n\n # Map the timestamp\n timestamp = event_hash.delete(\"@timestamp\")\n\n if timestamp\n timber_hash[\"dt\"] ||= timestamp.utc.to_iso8601\n end\n\n # Map the host\n host = event_hash.delete(\"host\")\n\n if host\n timber_hash[\"context\"] ||= {}\n timber_hash[\"context\"][\"system\"] ||= {}\n timber_hash[\"context\"][\"system\"][\"hostname\"] ||= host\n end\n\n # Map the message\n message = event_hash.delete(\"message\")\n\n if message\n timber_hash[\"message\"] ||= message\n end\n\n # Move everything else to meta, merging to preseve previous meta values.\n if event_hash != {}\n timber_hash[\"meta\"] ||= {}\n timber_hash[\"meta\"].merge!(event_hash)\n end\n\n timber_hash\n end", "title": "" } ]
[ { "docid": "352ce6b50717c82d380dba3ce5b210a9", "score": "0.7012914", "text": "def event_to_hash(event)\n corrective_change = defined?(event.corrective_change) ? event.corrective_change : nil\n {\n \"status\" => event.status,\n \"timestamp\" => Puppet::Util::Puppetdb.to_wire_time(event.time),\n \"name\" => event.name,\n \"property\" => event.property,\n \"new_value\" => event.desired_value.to_s,\n \"old_value\" => event.previous_value.to_s,\n \"corrective_change\" => corrective_change,\n \"message\" => event.message,\n }\n end", "title": "" }, { "docid": "351e0f1c00905b38a8712e63bfcc6bea", "score": "0.69701266", "text": "def event_to_domo_hash(event)\n new_event = {}\n event.to_hash.each do |k, v|\n if v.is_a? LogStash::Timestamp\n v = DateTime.parse(v.to_s)\n v = v.strftime(\"%Y-%m-%d %H:%M:%S\")\n end\n unless k == \"@version\" or k == \"@timestamp\"\n if v.nil?\n new_event[k] = nil\n else\n new_event[k] = v.to_s\n end\n end\n end\n new_event\n end", "title": "" }, { "docid": "f37dcc2844b9453a5907fbbec85b7f8e", "score": "0.6878006", "text": "def format_hash(event)\n event.attributes.symbolize_keys\n end", "title": "" }, { "docid": "143f43f74e7a2da14fcb8fa7e7a865af", "score": "0.6818615", "text": "def enhanced_event_format(event)\n return event.keys.inject({}) do |h,e|\n # capital_to_snake_case\n new_name=e.\n gsub(/([A-Z]+)([A-Z][a-z])/,'\\1_\\2').\n gsub(/([a-z\\d])([A-Z])/,'\\1_\\2').\n gsub(/([a-z\\d])(usec)$/,'\\1_\\2').\n downcase\n value=event[e]\n value=value.to_i if IntegerFields.include?(e)\n value=value.eql?('Yes') ? true : false if BooleanFields.include?(e)\n h[new_name]=value\n h\n end\n end", "title": "" }, { "docid": "05df124ce0981e03bc17a930466f4489", "score": "0.67578495", "text": "def event_body(event)\n # TODO: Create an HTTP post data codec, use that here\n if @format == \"json\"\n LogStash::Json.dump(map_event(event))\n elsif @format == \"message\"\n event.sprintf(@message)\n elsif @format == \"json_batch\"\n LogStash::Json.dump(event.map {|e| map_event(e) })\n else\n encode(map_event(event))\n end\n end", "title": "" }, { "docid": "2deb25ee6441bc558bf9a820ceed9e3b", "score": "0.6707847", "text": "def event_body(event)\n # TODO: Create an HTTP post data codec, use that here\n if @format == \"json\"\n documents = []\n document = event.to_hash()\n documents.push(document)\n LogStash::Json.dump(documents)\n elsif @format == \"message\"\n event.sprintf(@message)\n else\n encode(map_event(event))\n end\n end", "title": "" }, { "docid": "014d091646b3e8435511fd023a47bcb4", "score": "0.6525913", "text": "def event_body(event)\n # TODO: Create an HTTP post data codec, use that here\n if @format == \"json\"\n LogStash::Json.dump(map_event(event))\n elsif @format == \"message\"\n event.sprintf(@message)\n else\n encode(map_event(event))\n end\n end", "title": "" }, { "docid": "ba0542719c3716e070d320d74286481b", "score": "0.6478218", "text": "def format_event(evt)\n parts = evt.split(\"\\n\").map do |entry|\n chunks = entry.split('=')\n key = chunks.shift.strip\n value = chunks.join.strip.sub(/^'/, '').sub(/'$/, '').strip\n [key, value]\n end\n event = Smash[parts]\n unless(event['ResourceProperties'].to_s.empty?)\n begin\n event['ResourceProperties'] = MultiJson.load(event['ResourceProperties'])\n rescue MultiJson::LoadError => e\n error \"Failed to load `ResourceProperties`: #{e.class} - #{e}\"\n debug \"#{e.class}: #{e}\\n#{e.backtrace.join(\"\\n\")}\"\n end\n else\n event['ResourceProperties'] = {}\n end\n Smash.new(Carnivore::Utils.symbolize_hash(event))\n end", "title": "" }, { "docid": "53f386344d7722ed871759b2e802929b", "score": "0.64647245", "text": "def parsed_event\n event = {\n 'payload' => Yajl::Encoder.encode(payload),\n 'public' => is_public\n }\n\n ['repo', 'actor', 'created_at', 'id', 'org', 'type'].each do |field|\n # Don't include the field in the return event if it's empty.\n value = self.send(field)\n next if value.nil? || value.empty?\n event[field] = value\n end\n\n # Worst. Code. Ever.\n event['other'] = Yajl::Encoder.encode(other) if !other.empty?\n\n return event\n end", "title": "" }, { "docid": "8f7e39154f38ba200a2b7023d696de51", "score": "0.64429563", "text": "def flatten_event_payload(event)\n case event.type\n when 'CreateEvent'\n return YAML::dump({ 'ref_type' => event.payload.ref_type, 'description' => event.payload.description })\n when 'DeleteEvent'\n return YAML::dump({ 'ref_type' => event.payload.ref_type })\n when 'DeploymentEvent'\n return YAML::dump({ 'name' => event.payload.name })\n when 'ForkEvent'\n return YAML::dump({ 'forkee' => event.payload.forkee['full_name'] })\n when 'GollumEvent'\n ## TODO: pages[][page_name]\n return YAML::dump({ 'action' => event.payload.action })\n when 'IssuesEvent'\n return YAML::dump({ 'action' => event.payload.action, 'issue' => event.payload.issue['url'] })\n when 'IssueCommentEvent'\n return YAML::dump({ 'action' => event.payload.action, 'issue' => event.payload.issue['url'] })\n when 'MemberEvent'\n return YAML::dump({ 'action' => event.payload.action, 'member' => event.payload.member['login'] })\n when 'MembershipEvent'\n return YAML::dump({ 'action' => event.payload.action, 'member' => event.payload.member['login'], 'team' => event.payload.team['name'], 'scope' => event.payload.scope })\n when 'PullRequestEvent'\n return YAML::dump({ 'action' => event.payload.action, 'pull_request' => event.payload.pull_request['url'] })\n when 'PullRequestReviewCommentEvent'\n return YAML::dump({ 'action' => event.payload.action, 'pull_request' => event.payload.pull_request['url'] })\n when 'PushEvent'\n return YAML::dump({ 'size' => event.payload.size })\n when 'ReleaseEvent'\n return YAML::dump({ 'action' => event.payload.action, 'release' => event.payload.release['url'] })\n when 'RepositoryEvent'\n return YAML::dump({ 'action' => event.payload.action, 'repository' => event.payload.repository['full_name'] })\n when 'StatusEvent'\n return YAML::dump({ 'state' => event.payload.state, 'sha' => event.payload.sha })\n when 'TeamAddEvent'\n return YAML::dump({ 'team' => event.payload.team['name'], 'repository' => event.payload.repository['full_name'] })\n when 'WatchEvent'\n return YAML::dump({ 'action' => event.payload.action })\n else\n # CommitCommentEvent\n # DeploymentStatusEvent\n # DownloadEvent - No longer exists\n # FollowEvent - No longer exists\n # ForkApplyEvent - No longer exists\n # GistEvent - No longer exists\n # PageBuildEvent\n # PublicEvent\n return ''\n end\n end", "title": "" }, { "docid": "347746dff762bf6fe0e9cc1863951a2a", "score": "0.6412376", "text": "def keys_to_strs(event)\n return event unless event.is_a? Hash\n\n out = {}\n\n event.each do |key, value|\n out[key.to_s] = keys_to_strs value\n end\n\n out\n end", "title": "" }, { "docid": "2d3fe6966a414e324dc7e7bc0c9f8bfe", "score": "0.6308271", "text": "def convert(event)\n @convert.each do |field, type|\n converter = method(CONVERT_PREFIX + type)\n\n case original = event.get(field)\n when NilClass\n next\n when Hash\n @log.error(\"cannot convert hash\", field: field, value: original)\n when Array\n event.set(field, original.map{|v| converter.call(v)})\n else\n event.set(field, converter.call(original))\n end\n end\n end", "title": "" }, { "docid": "f346aa523ccb4413e3ca26bcde8ef391", "score": "0.6262674", "text": "def to_h\n {\n event: event,\n subject: subject,\n mentions: mentions,\n tags: tags,\n time: time\n }\n end", "title": "" }, { "docid": "0cdeeafb7dd23ea33d4f86d0ac6ccee8", "score": "0.6173583", "text": "def apply_event_to_hash(event, hash)\n hash.clone.each_with_object({}) do |(k, v), ret|\n if v.is_a? Hash\n ret[event.sprintf(k)] = apply_event_to_hash(event, v)\n else\n event_value = event.get(v)\n ret[event.sprintf(k)] = event_value.nil? ? v : event_value\n end\n end\n end", "title": "" }, { "docid": "91fbd749a11968635303e61d21013a75", "score": "0.6097817", "text": "def event_body(event)\n LogStash::Json.dump(cfapi([event]))\n end", "title": "" }, { "docid": "5e94c9001cdb687a6c721574f6315935", "score": "0.60510045", "text": "def call(event)\n resolver = lambda do |key, old_val, new_val|\n if old_val.nil?\n new_val\n elsif old_val.is_a?(Hash) && new_val.is_a?(Hash)\n old_val.merge(new_val, &resolver)\n elsif old_val.is_a?(Array) && new_val.is_a?(Array)\n old_val | new_val\n else\n old_val\n end\n end\n\n fields = Rackstash::Fields::Hash(@default_fields).to_h\n event.merge!(fields, &resolver)\n end", "title": "" }, { "docid": "449f0ab852455f142a8e4ad46b32f285", "score": "0.60240275", "text": "def to_hash\n {\n :time => @time,\n :event => @event\n }\n end", "title": "" }, { "docid": "e3ba03d3db26f3ed0286dee473f5a48e", "score": "0.59070605", "text": "def to_audit_event\n {\n user_name: to_s,\n user_email: email\n }\n end", "title": "" }, { "docid": "e819b718e412a1d2e382768dfd735da2", "score": "0.5880998", "text": "def process_events events\n @events = Hash.new\n\n # Organize the event based on type\n # http://developer.github.com/v3/activity/events/types/ lists event types.\n events.each do |event|\n @events[event.type] ||= Array.new\n @events[event.type] << event\n end\n @event_types = Hash.new\n @events.each do |key,value|\n @event_types[key.underscore.humanize.sub(' event', '')] = value.count\n end\n end", "title": "" }, { "docid": "9e7cc7c2efc6bf8729abc3b360e7cd8d", "score": "0.58696514", "text": "def filter(event)\n # process each field\n events = []\n @fields.each do |field|\n if event.get(field)\n val=event.get(field)\n hash=OpenSSL::HMAC.hexdigest(@digest, @key, val.to_s).force_encoding(Encoding::UTF_8)\n p=LogStash::Event.new();\n p.set('value',val);\n p.set('key',hash);\n p.tag(@tag);\n #spawn event\n events.push(p)\n #override original value\n event.set(field,hash);\n end\n\n end\n events.push(event)\n return events\nend", "title": "" }, { "docid": "fc509746e27656d7362849e0b03d95db", "score": "0.58054256", "text": "def call(event)\n tags = Rackstash::Fields::Tags(event[FIELD_TAGS])\n tags.merge!(@default_tags)\n\n event[FIELD_TAGS] = tags.to_a\n event\n end", "title": "" }, { "docid": "92f149f3314df1e340147d25be537a92", "score": "0.5770294", "text": "def hash\n @events.hash\n end", "title": "" }, { "docid": "988bf9fb79fbe54de3ecae59ee81c710", "score": "0.5721005", "text": "def events\n events = {}\n @db.each do |key, _|\n timestamp, object = parse_event(key)\n events[object] ||= []\n events[object].push(timestamp)\n end\n events\n end", "title": "" }, { "docid": "4ae1f05d3a03dc67613136426b6bd20e", "score": "0.57163537", "text": "def trace_event_info(event)\n {\n stamp: Time.now,\n event: event[0]\n }.merge(\n send(:\"event_props_#{event[0]}\", event)\n )\n end", "title": "" }, { "docid": "6f7ec2c13aab23cadbd6a3295acb5c5e", "score": "0.57021916", "text": "def to_hash(options = {})\n options ||= {}\n hash = {\n :level => level,\n :dt => formatted_dt,\n :message => message\n }\n\n if !tags.nil? && tags.length > 0\n hash[:tags] = tags\n end\n\n if !event.nil?\n hash.merge!(event)\n end\n\n if !context_snapshot.nil? && context_snapshot.length > 0\n hash[:context] = context_snapshot\n end\n\n if options[:only]\n hash.select do |key, _value|\n options[:only].include?(key)\n end\n elsif options[:except]\n hash.select do |key, _value|\n !options[:except].include?(key)\n end\n else\n hash\n end\n end", "title": "" }, { "docid": "eed8989af0638c5815d7377c8b2eb522", "score": "0.5693499", "text": "def events\n events = super\n types = self.class.events\n Hash[types.zip(events.values_at(*types))]\n end", "title": "" }, { "docid": "0cb07fae40541c7dd3a427783470b2b7", "score": "0.56564116", "text": "def http_message\n {\n data: {\n type: \"events\",\n id: event.id,\n attributes: {\n updated_at: event.updated_at,\n }\n }\n }.to_json\n end", "title": "" }, { "docid": "86b1fdc40bc8c3e20bc50515befc5a35", "score": "0.5630492", "text": "def event_params\n res = ActiveModelSerializers::Deserialization.jsonapi_parse(params)\n res\n end", "title": "" }, { "docid": "b1109ddb81201017cc4ef582fd09d67d", "score": "0.55798304", "text": "def element_to_result(e)\n result = Hash.new\n result['date'] = e.updated_at.strftime(\"%d-%m-%Y %H:%M\")\n result['user'] = e.user.email\n result['interaction'] = e.interaction.resource_type\n result\n end", "title": "" }, { "docid": "ee6cbc4feb920007af31cf7fe56e31fa", "score": "0.55342025", "text": "def build_event_hash\n\t\t@event_hash = {}\n\t\t\n\t\teach_event { |event| @event_hash[event.id] = event }\n\tend", "title": "" }, { "docid": "632c4d8d16fc61dcca422956be550010", "score": "0.55213565", "text": "def event_params\n params[:event][:payload] = JSON.parse(@json_payload)\n params[:event][:name] = request.headers['X-GitHub-Event']\n params[:event][:guid] = request.headers['X-GitHub-Delivery']\n params.require(:event).permit(:name, :guid, payload: {})\n end", "title": "" }, { "docid": "cb16737b6fd0a05559b200996a2e4f64", "score": "0.5513285", "text": "def build_event_metadata record, tags\n return unless record.try(:type_event?) && record.try(:date).present? && record.try(:coordinates).present?\n\n {\n '@type' => 'Event',\n '@context' => 'http://schema.org',\n 'publisher' => build_organization_metadata,\n 'name' => tags['og:title'],\n 'description' => tags['og:description'],\n 'startDate' => record.date.to_s(:db),\n 'image' => tags['og:image'],\n 'video' => tags['og:video'],\n # 'location' => {}, # TODO: Define this - https://developers.google.com/search/docs/data-types/event\n }\n end", "title": "" }, { "docid": "f67e3756eb01e9004fdae7d1cdf0f951", "score": "0.5508785", "text": "def get_todays_event_hash(event_type)\n todays_event_users = get_todays_event_users(event_type)\n recipients_to_email = get_recipients_to_email(event_type)\n matched_role_recipients = RoleRecipientsManager.match_recipients_to_event(event_type, recipients_to_email, todays_event_users)\n matched_team_recipients = TeamRecipientsManager.match_recipients_to_event(event_type, recipients_to_email, todays_event_users)\n # The following 'merge' merges two hashes and also with the pipe '|' does\n # union of arrays(the values of the two hashes).\n matched_team_recipients.merge(matched_role_recipients){|key, a_val, b_val| a_val | b_val }\n end", "title": "" }, { "docid": "67e555ff6b7df596f5dcc6faf0bcdaad", "score": "0.54435456", "text": "def event_data(matching)\n event = {}\n event[:priority] = matching[1].to_i\n event[:syslog_version] = matching[2].to_i\n event[:emitted_at] = nil?(matching[3]) ? nil : Time.parse(matching[3]).utc\n event[:hostname] = interpret_nil(matching[4])\n event[:appname] = interpret_nil(matching[5])\n event[:proc_id] = interpret_nil(matching[6])\n event[:msg_id] = interpret_nil(nil)\n event[:structured_data] = interpret_nil(matching[7])\n event[:message] = interpret_nil(matching[8])\n event[:original] = matching[0]\n event\n end", "title": "" }, { "docid": "996c969d1ae83129c7a1bf324957e01e", "score": "0.54406047", "text": "def to_json\n hash = {}\n self.instance_variables.each do |var|\n hash[var.to_s.sub(/^@/, '')] = self.instance_variable_get var\n end\n '{\"event\":' + hash.to_json + '}'\n end", "title": "" }, { "docid": "e5de1e982442a19420a01b1f23b5afd7", "score": "0.54145205", "text": "def parse_hash(patient_hash)\n patient_record = {}\n patient_record['first'] = patient_hash['first']\n patient_record['patient_id'] = patient_hash['patient_id']\n patient_record['last'] = patient_hash['last']\n patient_record['gender'] = patient_hash['gender']\n patient_record['patient_id'] = patient_hash['patient_id']\n patient_record['birthdate'] = patient_hash['birthdate']\n patient_record['race'] = patient_hash['race']\n patient_record['ethnicity'] = patient_hash['ethnicity']\n patient_record['languages'] = patient_hash['languages']\n patient_record['addresses'] = patient_hash['addresses']\n event_hash = {}\n patient_hash['events'].each do |key, value|\n event_hash[key.intern] = parse_events(value)\n end\n process_events(patient_record, event_hash)\n end", "title": "" }, { "docid": "1a00bc6e16cc3d378e7db9846ea096aa", "score": "0.5407785", "text": "def event_params\n {\n 'ToUserName' => 'FAKE_VALID_USERNAME',\n 'FromUserName' => 'FAKE_VALID_FROMUSERNAME',\n 'CreateTime' => '1501489767',\n 'MsgType' => 'event',\n 'Event' => 'click',\n 'EventKey' => 'ping', # will send a pong\n }\nend", "title": "" }, { "docid": "5bede346945e96ad16def985e647211b", "score": "0.5402663", "text": "def process_fields(event)\n h = Hash.new\n h[:url] = event['url']\n h[:event_title] = event['title']\n\n h[:city] = ''\n\n if event['venue'].nil?\n address = ''\n glink = ''\n else\n address, glink = build_address(event['venue'])\n h[:city] = event['venue']['city']\n end\n\n h[:address] = address\n h[:glink] = glink\n\n if event['description'].nil?\n h[:desc] = ''\n else\n h[:desc] = filter_description(event['description'],\n 'Read more about this Meetup',\n h[:url])\n end\n\n h[:photo] = event['photos']\n h[:time] = event_date(event)\n h[:formatted_time] = format_date(h[:time])\n\n h[:chapter] = event['chapter']\n\n if h[:chapter] == \"Sanfrancisco\"\n h[:chapter] = \"San Francisco\"\n end\n\n result = h\n\n if h[:city] == \"Seoul\" || h[:city] == \"서울\"\n if /papers we love/.match(h[:event_title].downcase).nil?\n result = nil\n end\n end\n\n result\nend", "title": "" }, { "docid": "6e95714bb2e134780cf462bc8c32d6f5", "score": "0.5394737", "text": "def prep_event(tweet)\n # From the tweet text get date and time\n date = date(tweet.full_text)\n time = time(tweet.full_text)\n {\n place: tweet.place,\n date: date,\n time: time,\n keywords: tweet.full_text,\n username: tweet.username,\n id: tweet.tweet_id\n }\n end", "title": "" }, { "docid": "c7e7c3d47d7d662a6bc21271d5fe1638", "score": "0.5384214", "text": "def convert_message_event message_event\n message_event_proto =\n TraceProtos::Span::TimeEvent::MessageEvent.new \\\n type: message_event.type,\n id: message_event.id,\n uncompressed_size_bytes: message_event.uncompressed_size,\n compressed_size_bytes: message_event.compressed_size\n TraceProtos::Span::TimeEvent.new \\\n time: convert_time(message_event.time),\n message_event: message_event_proto\n end", "title": "" }, { "docid": "c579faddcf3a94b5179889de2b84d85b", "score": "0.53794336", "text": "def hash\n [key, name, event_code, event_type, district, city, state_prov, country, start_date, end_date, year, short_name, event_type_string, week, address, postal_code, gmaps_place_id, gmaps_url, lat, lng, location_name, timezone, website, first_event_id, first_event_code, webcasts, division_keys, parent_event_key, playoff_type, playoff_type_string].hash\n end", "title": "" }, { "docid": "65510999e35675b280b4226db9e0f31e", "score": "0.5372785", "text": "def event_data\n {\n user_kyc_detail: @user_kyc_detail.get_hash,\n admin: @user_kyc_detail.get_last_acted_admin_hash\n }\n end", "title": "" }, { "docid": "d836a692bc9c547555f3df3ac71fa519", "score": "0.5370218", "text": "def meta_events_tracking_attributes_for(input_attributes, event_tracker = meta_events_tracker)\n # See if we've even got an event...\n return input_attributes unless input_attributes && (input_attributes[:meta_event] || input_attributes['meta_event'])\n\n # If so, let's start populating our set of output attributes.\n # #with_indifferent_access dups the Hash even if it already has indifferent access, which is important here\n output_attributes = input_attributes.with_indifferent_access\n event_data = output_attributes.delete(:meta_event)\n\n # A little error-checking...\n unless event_data.kind_of?(Hash)\n raise ArgumentError, \":meta_event must be a Hash, not: #{event_data.inspect}\"\n end\n\n event_data.assert_valid_keys(%w{category event properties})\n\n # Grab our event data...\n category = event_data[:category]\n event = event_data[:event]\n properties = event_data[:properties] || { }\n\n unless category && event\n raise ArgumentError, \"You must supply :category and :event in your :meta_event attributes, not: #{event_data.inspect}\"\n end\n\n # Ask the Tracker to compute the set of properties we should be firing with this event...\n props_data = event_tracker.effective_properties(category, event, properties)\n\n # Add our class to the +:class+ attribute -- Rails supports declaring +:class+ as an Array, and so we'll use\n # that here. It works fine even if +:class+ is a string of space-separated class names.\n classes = Array(output_attributes.delete(:class) || [ ])\n classes << meta_events_prefix_attribute(\"trk\")\n output_attributes[:class] = classes\n\n # Set the data attributes we'll be looking for...\n output_attributes[\"data-#{meta_events_prefix_attribute('evt')}\"] = props_data[:external_name]\n output_attributes[\"data-#{meta_events_prefix_attribute('prp')}\"] = props_data[:properties].to_json\n\n # And we're done!\n output_attributes\n end", "title": "" }, { "docid": "22c500ee5683cc8eb22cdc9ec173472a", "score": "0.53643334", "text": "def event_to_state(event)\n to_states = {}\n self.states_events_config.each { |se| to_states[se[:event]] = se[:to_state] }\n to_states[event]\n end", "title": "" }, { "docid": "9bc0b28ed0d6983098874bb1b34bafa3", "score": "0.53561854", "text": "def to_hash\n fields.inject({type: type}) do |table, name|\n table.tap do\n if val = send(name)\n val = val.iso8601(3) if name == :timestamp\n table[name] = val\n end\n end\n end\n end", "title": "" }, { "docid": "82751207f35283ad4ab53482e0cadf21", "score": "0.53511137", "text": "def event_params(value, context=nil)\n unless value.is_a? Hash\n raise ArgumentError, \"Expected Hash but got #{value.class}\"\n end\n value.inject({}) do |memo, (key, val)|\n case val\n when String, Integer, TrueClass, FalseClass\n memo[key.to_s] = val\n when Float\n if val.finite?\n memo[key.to_s] = val\n else\n memo[key.to_s] = nil\n end\n when Symbol\n memo[key.to_s] = val.to_s\n end\n memo\n end\n rescue => error\n log_failure(value.class, 'valid event params', context, error)\n {}\n end", "title": "" }, { "docid": "0f532f1cc3503e90cec125f7e2567a7b", "score": "0.5347088", "text": "def create_log_event(level, message, data=nil)\n event = {}\n event[:timestamp] = Time.now.strftime(\"%Y-%m-%dT%H:%M:%S.%6N%z\")\n event[:level] = level\n event[:message] = message\n if data.is_a?(Hash)\n event.merge!(data)\n end\n# MultiJson.dump(event)\n Oj.dump(event)\n end", "title": "" }, { "docid": "2698e4f2f7fa6ad2c39de3b7935931fb", "score": "0.5341335", "text": "def save\n event = params\n # This assumes that all keys exists. Yay no error handling...\n toSave = Event.new(update_type: event[:event],\n start_time: event[:payload][:event][:start_time_pretty],\n end_time: event[:payload][:event][:end_time_pretty],\n location: event[:payload][:event][:location],\n invitee_name: event[:payload][:invitee][:name],\n duration: event[:payload][:event_type][:duration],\n event_kind: event[:payload][:event_type][:kind])\n toSave.save\n render json: {}, status: 200\n end", "title": "" }, { "docid": "15d7fe6dcc3c13aa8ae00da356a53c4c", "score": "0.53172106", "text": "def events\n metadata['events'].sort_by! { |event| event['timestamp'] }\n end", "title": "" }, { "docid": "4a87c1beceeba59d26bc051254538f04", "score": "0.53019285", "text": "def entry_as_json(entry)\n data = {}\n set_attribute(data, @time_key, entry.time) unless @time_key.nil?\n set_attribute(data, @severity_key, entry.severity_label) unless @severity_key.nil?\n set_attribute(data, @progname_key, entry.progname) unless @progname_key.nil?\n set_attribute(data, @pid_key, entry.pid) unless @pid_key.nil?\n set_attribute(data, @message_key, entry.message) unless @message_key.nil?\n\n tags = entry.tags\n if @custom_keys.size > 0\n tags = (tags.nil? ? {} : tags.dup)\n @custom_keys.each do |name, key|\n set_attribute(data, key, tags.delete(name.to_s))\n end\n end\n\n unless @tags_key.nil?\n tags ||= {}\n set_attribute(data, @tags_key, tags)\n end\n\n data = @formatter.format(data) if @formatter\n data\n end", "title": "" }, { "docid": "98e12016d48c4c4576426d8c5e7f1338", "score": "0.5291245", "text": "def to_hash(*a)\n {\n 'name' => name,\n 'weight' => weight,\n 'events' => events.to_a,\n }\n end", "title": "" }, { "docid": "fc1e4227ebcd43158cf1696709f1065e", "score": "0.5287392", "text": "def map_from_events(events)\n events = [*events]\n existing = fetch_existing_map(events)\n events.each.with_object({}) do |evt, hash|\n hash[evt] = new(\n id: evt.meetup_event_id,\n last_update: evt.meetup_last_update,\n existing_event: existing.fetch(evt.meetup_event_id, nil))\n end\n end", "title": "" }, { "docid": "9581ffb680afe74c112411f34845da9e", "score": "0.5284661", "text": "def filter(event)\n\n input_log = event.get(@source_field)\n\n # tag if field isn't present\n if input_log.nil?\n event.set(\"VALID\", '0')\n event.tag(\"source_field_is_nil\")\n return [event]\n end\n\n if input_log.empty?\n event.set(\"VALID\", '0')\n event.tag(\"source_field_is_empty\")\n return [event]\n end\n\n # parsing\n parsed_log = parse_mail_log(input_log)\n\n # drop if not valid log\n if parsed_log.nil?\n event.set(\"VALID\", '0')\n event.tag(\"parsed_unavailable\")\n return []\n end\n\n # mc 필드는 반드시 값이 있어야 함\n if parsed_log[\"MC\"].nil?\n event.set(\"VALID\", '0')\n event.tag(\"parsed_unavailable\")\n return []\n end\n\n # set event\n parsed_log.keys.each do |key_field|\n # 원래 필드명의 소문자명과 해당 값을 키-밸류로 매핑하여 event에 입력\n event.set(\"#{key_field.downcase}\", parsed_log[key_field])\n end\n event.set(\"VALID\", '1')\n\n # puts \"---- test ----\"\n # puts \">> parsed_log :\\n#{parsed_log}\"\n\n # return event\n [event]\nend", "title": "" }, { "docid": "15ad132a009265766974a378d5936767", "score": "0.52796143", "text": "def setup_region_events\n @region_events = {}\n # Region events from map note-tag\n @map.region_events.each do |region_id, event_id|\n @region_events[region_id] = event_id\n end\n # Region events from events on the map\n @map.events.each do |id, event|\n data = event.region_event\n if data.region_id != -1\n @region_events[data.region_id] = id\n end\n end\n end", "title": "" }, { "docid": "26d28c85a5c374367ccd7cbbbb2acee7", "score": "0.52787215", "text": "def test_hash\n {\n \"eventID\"=>\"36385\",\n \"eventOrgID\"=>\"4516\",\n \"eventName\"=>\"Weekly Mobile Adoption Event!!!\",\n \"eventStart\"=>\"1/22/2011 10:00 AM\",\n \"eventEnd\"=>\"1/22/2011 3:00 PM\",\n \"eventUrl\"=>\"\",\n \"eventDescription\"=>\"Come meet some of our fabulous dogs. Find yourself a new best friend or help us save a life by fostering! If you're interested in a particular dog, please email us and let us know so we can be sure she or he is there!\",\n \"eventLocationID\"=>\"10422\",\n \"eventSpecies\"=>[\"Dog\"],\n \"locationName\"=>\"Pet Food Express\",\n \"locationUrl\"=>\"\",\n \"locationAddress\"=>\"Dolores and Market St.\",\n \"locationCity\"=>\"San Francisco \",\n \"locationState\"=>\"CA\",\n \"locationPostalcode\"=>\"94114\",\n \"locationCountry\"=>\"United States\",\n \"locationPhone\"=>\"\",\n \"locationPhoneExt\"=>\"\",\n \"locationEvents\"=>\"0\"\n }\n end", "title": "" }, { "docid": "8183b602e19ec767a2ca2c6953bb8861", "score": "0.5262839", "text": "def process_events(patient_record, entries)\n patient_record['measures'] = {}\n @measure_importers.each_pair do |measure_id, importer|\n patient_record['measures'][measure_id] = importer.parse(entries)\n end\n\n entries.each_pair do |key, value|\n patient_record[key] = value.map do |e|\n if e.usable?\n e.to_hash\n else\n nil\n end\n end.compact\n end\n\n patient_record\n end", "title": "" }, { "docid": "3e7f7acc523c16451ac2d860bd6f669f", "score": "0.52468914", "text": "def to_task_hash\n {\n mydevices: true,\n deviceid: rhizome.particle_device.device_id,\n event: \"#{event_type}/#{event_id}\",\n url: \"#{endpoint}/hooks/v1/#{event_type}\",\n json: self.class.send(\"#{self.class.event_to_json(event_type)}_task_json\")\n }\n end", "title": "" }, { "docid": "f33f2bf566548aa723e25305a2329d71", "score": "0.52461976", "text": "def to_h\n {\n runtime_guid: tracer.guid,\n span_guid: context.id,\n trace_guid: context.trace_id,\n span_name: operation_name,\n attributes: tags.map {|key, value|\n {Key: key.to_s, Value: value}\n },\n oldest_micros: start_micros,\n youngest_micros: end_micros,\n error_flag: false,\n dropped_logs: dropped_logs_count,\n log_records: log_records\n }\n end", "title": "" }, { "docid": "054ad2633dd66099b1c1a71c5c6b34cf", "score": "0.5244219", "text": "def to_pusher_event\n user_name = if user.present? then user.name else nil end\n user_name = guest_name unless user_name.present?\n\n { session_id: session_id,\n scene_id: scene_id,\n href: \"/scenes/#{ scene_id }/with/#{ session_id }\",\n score: score,\n query_results: query_results,\n updated_at: updated_at,\n user_id: user_id || guest_uid,\n user_name: user_or_guest.name,\n profile_image: user_or_guest.image_url }\n end", "title": "" }, { "docid": "672e01e858a5a4131df3506a1bfb3def", "score": "0.5239963", "text": "def event_filter query\n filter = { _t: {} }.tap do |filter|\n if query.has_key? :after\n filter[:_t][:gt] = to_timestamp query.delete(:after)\n query.delete(:from)\n elsif query.has_key? :from\n filter[:_t][:gte] = to_timestamp query.delete(:from)\n end\n\n if query.has_key? :before\n filter[:_t][:lt] = to_timestamp query.delete(:before)\n query.delete(:upto)\n elsif query.has_key? :upto\n filter[:_t][:lte] = to_timestamp query.delete(:upto)\n end\n # sel['_id'] = Regexp.new(query.delete(:id)) if query[:id]\n query.each_pair{ |key, val| filter[:_d] ||= {} ; filter[:_d][key] = val }\n end\n end", "title": "" }, { "docid": "03522a2f51bc05ffc3c6b0075a9e5f54", "score": "0.5212231", "text": "def event_file_data\n { hosts: options[:host],\n description: options[:desc],\n severity: options[:severity],\n tags: options[:evtag] }.to_json\n end", "title": "" }, { "docid": "9ca0847b59e60067f29d194c869829dc", "score": "0.51956004", "text": "def mapOfAllEvents\n events = self.getAllEvents\n result = Hash.new\n\n events.each do |sport, evs|\n evs.each do |eventID, event|\n result[eventID] = event\n end\n end\n result\n end", "title": "" }, { "docid": "9695e6d11fbd3a13cb08b3a711bc80d7", "score": "0.5193579", "text": "def filter(event)\n\n # Map of cassandra table names to logstash reference names\n field_hash = {\n \"name\"\t\t\t\t=> \"[parsed_message][customers][name]\",\n \"id\"\t\t\t\t=> \"[parsed_message][customers][id]\",\n \"address\"\t\t\t\t=> \"[parsed_message][customers][address]\",\n \"visits\"\t\t\t\t=> \"[parsed_message][customers][visits]\" }\n\n # Loop over the above list of fields\n # Set fields if they are not null or \"\"\n field_hash.each do |name, ref|\n unless (event.get(ref).nil? || event.get(ref) == \"\")\n event.set(name, event.get(ref))\n end\n end \n\n # Calculate the total amount spent for a customer\n unless (event.get(\"visits\").nil? || event.get(\"visits\") == \"\")\n calculate_total(\"total_spent\", \"visits\", event)\n fav_flavor(\"favorite_flavor\", \"visits\", event)\n end\n\n return [event]\nend", "title": "" }, { "docid": "a70386d880a45820436691aef1add420", "score": "0.51820517", "text": "def to_h\n {\n runtime_guid: tracer.guid,\n span_guid: span_context.id,\n trace_guid: span_context.trace_id,\n span_name: operation_name,\n attributes: tags.map {|key, value|\n {Key: key.to_s, Value: value}\n },\n oldest_micros: start_micros,\n youngest_micros: end_micros,\n error_flag: false,\n dropped_logs: dropped_logs_count,\n log_records: log_records\n }\n end", "title": "" }, { "docid": "cfc362c5d86b40cc5ed2834aee79ff8b", "score": "0.51738805", "text": "def hash\n # We don't use metadata because == does not use metadata\n [event_type, event_id, data].hash ^ self.class.hash\n end", "title": "" }, { "docid": "b6f3536e44e8189cc699608eec829d41", "score": "0.5173835", "text": "def event\n params.payload[:event].to_sym\n end", "title": "" }, { "docid": "4869ab85ea26f8a8b79b1c574f41b879", "score": "0.5157226", "text": "def prepare_create document\n raise Error.new('Events must be Hash-like to create') unless document.is_a?(Hash)\n document.symbolize_keys!\n receive!(time: document.delete(:time), body: document)\n self\n end", "title": "" }, { "docid": "8737ea7887e77750628ffd3c6a54eb69", "score": "0.514759", "text": "def event_context\n {\n service: service,\n category: category,\n name: name,\n data: data,\n timestamp: Time.now.utc,\n uuid: SecureRandom.uuid\n }\n end", "title": "" }, { "docid": "e9cfd2bf873908de4d85456f3c70e273", "score": "0.51469326", "text": "def format_conversion\n { account_id: self.account_id.to_s, app_id: self.app_id.to_s, actor_id: self.actor_id.to_s, properties: self.properties, time: self.updated_at}\n rescue => e\n Rails.logger.error(\"**** ERROR **** #{e.message}\")\n {}\n end", "title": "" }, { "docid": "ee9678b1eae066d0ae2b784f5b3b7e14", "score": "0.51259375", "text": "def event_params\n json_params = ActionController::Parameters.new( JSON.parse(request.body.read) )\n json_params.require(:event).permit(:creator_id, :name, :address, :latitude, :longitude, :creator_id, {:tags_ids => []})\n end", "title": "" }, { "docid": "fca38bb39c7aa60f4e66df94e204db51", "score": "0.5123526", "text": "def objectify_episode (episode)\n {\n :id => episode.id,\n :name => episode.name,\n :timestep => episode.timestep,\n :states => objectify_json(episode.states),\n :diff_states => objectify_json(episode.diff_states),\n :commands => objectify_json(episode.commands),\n :simulator_logs => objectify_json(episode.simulator_logs),\n :created_at => episode.created_at,\n :updated_at => episode.updated_at,\n }\n end", "title": "" }, { "docid": "f25d3551130cefbdc3bfdcf3e502d63c", "score": "0.51217705", "text": "def normalize_hash(hash)\n normalized_hash = {}\n hash.each do |k, v|\n case k \n when \"error\"\n raise FacebookError.new(\"#{v['type']} - #{v['message']}\")\n when \"id\"\n if (v == v.to_i.to_s)\n normalized_hash[k.to_sym] = v.to_i \n else\n normalized_hash[k.to_sym] = v \n end\n when /_time$/\n normalized_hash[k.to_sym] = Time.parse(v)\n else\n data = extract_data(v)\n case data\n when Hash\n normalized_hash[k.to_sym] = normalize_hash(data)\n when Array\n normalized_hash[k.to_sym] = normalize_array(data)\n else\n normalized_hash[k.to_sym] = data\n end\n end\n end\n normalized_hash\n end", "title": "" }, { "docid": "92925ad94a7ae67d28083c8d7670540b", "score": "0.5117438", "text": "def set_audit_informations\n self.event_id = routing_key.split('.')[-3, 2].join(':')\n self.log_type = routing_key.split('.').slice(1, 2).join('.')\n self.routing_type = routing_key.split('.')[3]\n end", "title": "" }, { "docid": "59a56aeb77b82cdd0e02c7c0d16a2f60", "score": "0.5107254", "text": "def get_event(row, obj_identifier)\n obj_id = @new_id_for[row['intellectual_object_id']]\n gf_id = @new_id_for[row['generic_file_id']]\n inst_id = @new_id_for[row['institution_id']]\n new_event_type = transform_event_type(row['event_type'], row['outcome_detail'])\n raise \"No event type for #{row[identifier]}\" if new_event_type.nil?\n event = {}\n event['intellectual_object_id'] = obj_id\n event['generic_file_id'] = gf_id\n event['institution_id'] = inst_id\n event['identifier'] = row['identifier']\n event['event_type'] = new_event_type\n event['date_time'] = row['date_time']\n event['detail'] = row['detail']\n event['outcome'] = ucfirst(row['outcome'])\n event['outcome_detail'] = row['outcome_detail']\n event['outcome_information'] = row['outcome_information']\n event['object'] = row['object']\n event['agent'] = row['agent']\n event['generic_file_identifier'] = row['generic_file_identifier']\n event['intellectual_object_identifier'] = obj_identifier\n event\n end", "title": "" }, { "docid": "74c55fec263c307b53abc2dcdfbc6009", "score": "0.5100921", "text": "def to_substitution_hash\n {\n 'eventbooking' => self,\n 'event' => event,\n 'invoice' => businessdocument,\n 'businessdocument' => businessdocument\n }\n end", "title": "" }, { "docid": "9520c351b082da6d5975325a74cc58ff", "score": "0.5100693", "text": "def events\n @events ||= Array(context[:events]).reverse.map { |event| Concierge::SafeAccessHash.new(event) }\n end", "title": "" }, { "docid": "bd8afa19aaf648a17ea1a3fea0c758b7", "score": "0.5100692", "text": "def create_stack_events(event, page_stacks)\n new_events = {}\n # first event\n first_stack = page_stacks.shift\n ev = RPG::Event.new(event.x, event.y)\n ev.id = event.id\n ev.pages = first_stack[1]\n new_events[ev.id] = ev\n \n max_id = @events.keys.max\n # rest of the events \n page_stacks.each do |stack_id, pages|\n max_id += 1\n ev = RPG::Event.new(event.x, event.y)\n ev.id = max_id\n ev.pages = pages\n new_events[max_id] = ev\n end\n return new_events\n end", "title": "" }, { "docid": "9aea41b4baf5dd5e969b1f7679cbefb0", "score": "0.5097947", "text": "def extract_and_set_fields\n @type = raw_event['type']\n @is_public = raw_event['public']\n @payload = raw_event['payload']\n @id = raw_event['id']\n # https://github.com/igrigorik/gharchive.org/blob/c9ae11426e5bcc30fe15617d009dfc602697ecde/bigquery/schema.js#L17-L38\n @repo = parse_repo\n\n # https://github.com/igrigorik/gharchive.org/blob/c9ae11426e5bcc30fe15617d009dfc602697ecde/bigquery/schema.js#L39-L70\n @actor = parse_actor\n\n # https://github.com/igrigorik/gharchive.org/blob/c9ae11426e5bcc30fe15617d009dfc602697ecde/bigquery/schema.js#L71-L102\n @org = parse_org\n\n @created_at = parse_created_at\n end", "title": "" }, { "docid": "ee6873afe3101e211296096261377215", "score": "0.5097638", "text": "def event_type_to_json(event_type)\n et = event_type.to_json(\n only: [:id, :name, :description, :recipients, :program, :created_at, :updated_at, :goal, \n :duration, :faq, :elevator_pitch, :learnings, :takeaways, :subtitle, :csd_eligible, :is_kleer_certification, \n :external_site_url, :deleted, :noindex, :lang, :cover, :side_image, :brochure, :new_version, :extra_script], \n methods: %i[slug canonical_slug], include: [:categories, \n next_events: {only: [\n :id, :date, :place, :city, :country_id, :list_price, :eb_price, :eb_end_date, :registration_link, \n :is_sold_out, :duration, :start_time, :end_time, :time_zone_name, :currency_iso_code, :address, :finish_date], methods: :trainers} ])\n et = \"#{et[0..-2]},\\\"testimonies\\\":#{event_type.testimonies.where(selected: true).first(10).to_json(\n only: [:fname, :lname, :testimony, :profile_url, :photo_url]\n )}}\"\n end", "title": "" }, { "docid": "aa927c1c66233458761e854540c78b5a", "score": "0.5094359", "text": "def parse_events(event_list)\n event_list.collect do |event|\n if event.class==String.class\n # skip String elements in the event list, patient randomization templates\n # introduce String elements to simplify tailing-comma handling when generating\n # JSON using ERb\n nil\n else\n QME::Importer::Entry.from_event_hash(event)\n end\n end.compact\n end", "title": "" }, { "docid": "1d1e9fdca6eb0eecea9adc1f58bee71a", "score": "0.50831175", "text": "def process_events(events)\n process_join events['join'] if events.key? 'join'\n process_invite events['invite'] if events.key? 'invite'\n process_leave events['leave'] if events.key? 'leave'\n end", "title": "" }, { "docid": "07a7531ce3310e62110b3dc2e5bda909", "score": "0.5082815", "text": "def process_elasticsearch(target)\n {\n :schema => 'iglu:com.snowplowanalytics.snowplow.storage/elastic_config/jsonschema/1-0-0',\n :data => {\n :name => target['name'],\n :host => target['host'],\n :index => target['database'],\n :port => target['port'],\n :type => target['table'],\n :nodesWanOnly => target['es_nodes_wan_only'],\n :purpose => 'FAILED_EVENTS'\n }\n }\nend", "title": "" }, { "docid": "d63c0cac7f254a983a6faeb0281768c4", "score": "0.50800294", "text": "def write(event)\n ls_event= data2logstash_event(event)\n \n sync do\n logstash_device.write(ls_event.to_json+\"\\n\")\n logstash_device.flush\n end\n self\n end", "title": "" }, { "docid": "35dbb70d3dab8f34d7a92bec143ffb8f", "score": "0.50718397", "text": "def to_str\n body={\n id: @id,\n event: @event,\n data: @data,\n }\n if errors.any?\n body[:errors_count]=@errors.count\n body[:errors]=@errors\n end\n body.to_json\n end", "title": "" }, { "docid": "47abbab472eb09f49a9f4c27a4ea6391", "score": "0.50716436", "text": "def normalize_hash(hash)\n normalized_hash = {}\n hash.each do |k, v|\n case k\n when /_time$/\n normalized_hash[k.downcase.to_sym] = Time.parse(v)\n else\n data = extract_data(v)\n normalized_hash[k.downcase.to_sym] = case data\n when Hash\n normalize_hash(data)\n when Array\n normalize_array(data)\n else\n data\n end\n end\n end\n normalized_hash\n end", "title": "" }, { "docid": "ad94ea4576381801425a0ebeaced400d", "score": "0.5068598", "text": "def filter(event)\n context = event.get(\"context\")\n if not context.is_a?(Hash)\n context = {}\n end\n\n context[@field] = event.get(@field)\n event.set(\"context\", context)\n event.remove(@field)\n\n [event]\nend", "title": "" }, { "docid": "0a2fb653af86d177cd0307e0650958ab", "score": "0.50677085", "text": "def parse_post(event, args)\n props = Hash.new\n if args[:metadata] then\n props = args[:metadata]\n end\n if args[:date] then\n t = args[:date]\n else\n t = Time.now\n end\n post = {\n 'username' => @username,\n 'auth_method' => 'challenge',\n 'lineendings' => 'unix',\n 'event' => event,\n 'subject' => args[:subject],\n 'year' => t.year,\n 'mon' => t.month,\n 'day' => t.day,\n 'hour' => t.hour,\n 'min' => t.min\n }\n if args[:journal]\n journal = args[:journal]\n if @usejournals.include?(journal)\n post['usejournal'] = journal\n else\n raise LjException.new(LJERR_INVALID_JOURNAL,\n \"Invalid journal name '#{journal}'\")\n end\n end\n props['opt_preformatted'] = bool(args[:preformatted]) if args[:preformatted]\n props['opt_nocomments'] = !bool(args[:comments]) if args[:comments]\n props['opt_noemail'] = !bool(args[:email]) if args[:email]\n security = args[:security]\n if security\n level = security.downcase\n post['security'] = case level\n when 'public' then level\n when 'private' then level\n when 'friends'\n post['allowmask'] = 1\n 'usemask'\n else\n post['allowmask'] = get_mask level\n 'usemask'\n end\n end\n screening = args[:screening]\n if screening\n props['opt_screening'] =\n case screening.downcase\n when 'all', 'a' then 'A'\n when 'none', 'n' then 'N'\n when 'anonymous', 'r' then'R'\n when 'non-friends', 'f' then 'F'\n else\n raise LjException.new(LJERR_BAD_SCREEN,\n \"Screening must be 'all', 'none', 'anonymous' or 'non-friends'\")\n end\n end\n props.delete_if { |k,v| v.nil? }\n post['itemid'] = args[:itemid] if args[:itemid]\n post['props'] = props unless props.empty?\n post['auth_challenge'], post['auth_response'] = getchallenge\n # puts post.inspect\n return post\n end", "title": "" }, { "docid": "a6936416b85e881202c2715e9f5e36e7", "score": "0.50665903", "text": "def chargable\n event_class = @event.type.constantize\n chargable_hash = {}\n avaliable_fields = event_class.stored_attributes[:resource_parameters]\n\n if avaliable_fields\n chargable_events_params = chargable_params\n avaliable_fields.each do |key|\n chargable_hash[key] = event_class.public_send(['chargable', key.to_s].join('_'), chargable_events_params)\n end\n end\n\n chargable_hash\n end", "title": "" }, { "docid": "73d6f9710758f420259709cf4a356bf5", "score": "0.50654006", "text": "def store_event( event )\n\t\ttime = event.delete( '@timestamp' )\n\t\ttype = event.delete( '@type' )\n\t\tversion = event.delete( '@version' )\n\n\t\tdata = JSON.generate( event )\n\t\theaders = {\n\t\t\ttime: time,\n\t\t\ttype: type,\n\t\t\tversion: version,\n\t\t\tcontent_type: 'application/json',\n\t\t\tcontent_encoding: data.encoding.name,\n\t\t\ttimestamp: Time.now.to_f,\n\t\t}\n\n\t\t@amqp_exchange.value.publish( data, headers )\n\tend", "title": "" }, { "docid": "606a5960b7dac06823161706406a8032", "score": "0.5064806", "text": "def log_entry(line)\n raw = line.split(@@break)\n map = Hash.new\n raw.each do |keys|\n parts = keys.split(@@value)\n map.store(parts[0],parts[1])\n end\n #unless USEMEMCACHE != true\n # if Staticentry.get_cache(Digest::MD5.hexdigest(map['data'] + map['logtype_id'].to_s)).nil?\n # static = Logtype.find(map['logtype_id']).staticentries.new\n # static.data = map['data']\n # static.save\n # end\n #else\n static = Logtype.find(map['logtype_id']).staticentries.new\n static.data = map['data']\n static.save\n #end\n unless USEMEMCACHE != true\n static = Staticentry.get_cache(Digest::MD5.hexdigest(map['data'] + map['logtype_id'].to_s))\n else\n static = Staticentry.find(Digest::MD5.hexdigest(map['data'] + map['logtype_id'].to_s))\n end\n event = static.events.new\n event.etime = map['etime'].to_i\n event.loglevel_id = map['loglevel_id'].to_i\n event.payload = map['payload']\n event.logtype_id = map['logtype_id'].to_i\n event.agent_id = map['agent_id'].to_i\n begin\n a = Agent.find(map['agent_id'])\n l = Logtype.find(map['logtype_id'])\n if a.logtypes.member?(l)\n if check_key(a, map['authkey']) \n event.save\n else\n ActiveRecord::Base.logger.error \"Event dropped -- invalid agent authkey sent for #{a.name}\"\n send_data \"1\"\n end\n else\n ActiveRecord::Base.logger.error \"Event dropped -- Agent #{a.name} is not a member of logtype #{l.name}\"\n send_data \"2\"\n end\n rescue ActiveRecord::RecordNotFound\n ActiveRecord::Base.logger.error \"Event dropped -- invalid agent_id or logtype_id specified\"\n send_data \"3\"\n end\n port, ip = Socket.unpack_sockaddr_in(get_peername)\n host = Socket.getaddrinfo(ip, 0, Socket::AF_UNSPEC, Socket::SOCK_STREAM, nil, Socket::AI_CANONNAME)[0][2]\n ActiveRecord::Base.logger.debug \"New event logged from #{host} \\n -- Log data: #{line}\"\n end", "title": "" }, { "docid": "f0c022eed0ccc3cf91286d0d87b4915c", "score": "0.5059162", "text": "def cfapi(events)\n messages = []\n\n # For each event\n events.each do |event|\n # Create an outbound event; this can be serialized to json and sent\n event_hash = {\n 'timestamp' => timestamp_in_milliseconds(event.get('@timestamp')),\n 'text' => (event.get('message') or ''),\n }\n\n # Map fields from the event to the desired form\n event_hash['fields'] = merge_hash(event.to_hash)\n .reject { |key,value| @adjusted_fields.has_key?(key) and @adjusted_fields[key] == nil } # drop banned fields\n .map {|k,v| [ @adjusted_fields.has_key?(k) ? @adjusted_fields[k] : k,v] } # rename fields\n .map {|k,v| { 'name' => (safefield(k)), 'content' => v } } # Convert a hashmap {k=>v, k2=>v2} to a list [{name=>k, content=>v}, {name=>k2, content=>v2}]\n\n messages.push(event_hash)\n end # events.each do\n\n { 'events' => messages } # Framing required by CFAPI.\n end", "title": "" }, { "docid": "7708e4b08e422037c7fd7b79dc183112", "score": "0.5058137", "text": "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", "title": "" }, { "docid": "747fc2b9df82e900f97b3ddb5e639acc", "score": "0.5058023", "text": "def hash\n [id, user, client, remote_ip, service_name, event_date, message, action, entity, entity_type, property_changes, context].hash\n end", "title": "" }, { "docid": "0dc6ceba25e424876131b1c83292f674", "score": "0.5057713", "text": "def transform_hash(obj)\n if obj.is_a?(Array)\n obj.map { |m| transform_hash(m) }\n elsif obj.is_a?(Hash)\n obj.each do | k, v |\n if v.class == Time\n t = v.strftime(\"%FT%T\")\n if v.nsec > 0\n t << v.strftime(\".%3N\")\n end\n t << (v.utc? ? 'Z' : v.strftime(\"%:z\"))\n\n obj[k] = t\n else\n obj[k] = transform_hash(v)\n end\n end\n end\n\n obj\n end", "title": "" }, { "docid": "f8d502a1829a4d550e771de0afeca101", "score": "0.50556475", "text": "def to_h\n {\n :name => @name,\n :type => @type,\n :metaData => @meta_data,\n :timestamp => @timestamp.iso8601(3)\n }\n end", "title": "" }, { "docid": "17bc037518cf007dd3e4f4b8d30f57a3", "score": "0.50440806", "text": "def to_h\n {\n id: id,\n uuid: uuid,\n aggregate_id: aggregate_id,\n type: type,\n body: body,\n version: version,\n created_at: created_at,\n correlation_id: correlation_id,\n causation_id: causation_id,\n }\n end", "title": "" }, { "docid": "5c7f39dc79894e86c0015269b25a95bf", "score": "0.50435674", "text": "def to_hash\n # fields\n result = {\n 'rcpt' => @timeline.recipient_id,\n 'routing' => @routing_kind,\n 'activity' => @activity.to_hash,\n }\n\n result['meta'] = @meta.stringify_keys unless @meta.blank?\n\n result\n end", "title": "" }, { "docid": "359ff6675b8db48cf1adcb48caeff015", "score": "0.5038825", "text": "def store_event_in_db(event_hash)\n newEvent = Event.new(name: event_hash[\"name\"], date: event_hash[\"dates\"][\"start\"][\"localDate\"], city: event_hash[\"_embedded\"][\"venues\"][0][\"city\"][\"name\"], state: event_hash[\"_embedded\"][\"venues\"][0][\"state\"][\"name\"], venue_name: event_hash[\"_embedded\"][\"venues\"][0][\"name\"])\n newEvent.save \n newEvent\nend", "title": "" }, { "docid": "06b69a3128e2ae2d6b65fab1054314e4", "score": "0.5037118", "text": "def processedJsonListener\n allEvents = params[:event]\n eventCounter = 0\n saveCounter = 0\n Event.delete_all\n Address.delete_all\n EventDateTime.delete_all\n\n for event in allEvents\n begin\n newevent = Event.new\n newevent.name = nil_or_string(event[:name])\n newevent.description = nil_or_string(event[:description])\n newevent.imagepath = nil_or_string(event[:imagePath])\n newevent.source = nil_or_string(event[:source])\n newevent.location = nil_or_string(event[:location])\n newevent.datetime = nil_or_string(event[:datetime])\n\n #newevent.dump = nil_or_string(event[:dump])\n\n newevent.price = flatten(event[:pPrice])\n newevent.ptime = flatten(event[:time])\n newevent.pdate = flatten(event[:date])\n\n if newevent.save\n saveCounter+=1\n if event[:addresses][:addresses] != nil and event[:addresses][:addresses].count > 0\n for address in event[:addresses][:addresses]\n newaddy = Address.new\n newaddy.event_id = newevent.id\n newaddy.full_address = nil_or_string(address[:full_address])\n newaddy.city = nil_or_string(address[:city])\n newaddy.region = nil_or_string(address[:region1])\n\n newaddy.save\n end\n end\n if event[:datetime_structs] != nil and event[:datetime_structs].count > 0\n for datetime in event[:datetime_structs]\n eventDate = EventDateTime.new\n eventDate.event_id = newevent.id\n eventDate = setDateTime(eventDate, datetime[:date][:start_date][:full_date], datetime[:time][:start_time], nil_or_string(datetime[:time][:end_time]))\n eventDate.save\n\n\n if datetime[:date][:end_date] != nil and nil_or_string(datetime[:date][:end_date][:full_date]) != nil\n startDate = DateTime.parse(datetime[:date][:start_date][:full_date])\n endDate = DateTime.parse(datetime[:date][:end_date][:full_date])\n endInt = endDate.to_time.to_i\n currDate = startDate+1\n currDateInt = currDate.to_time.to_i\n while currDateInt <= endInt do\n eventDate = EventDateTime.new\n eventDate.event_id = newevent.id\n eventDate = setDateTime(eventDate, currDate, datetime[:time][:start_time], nil_or_string(datetime[:time][:end_time]))\n eventDate.save\n currDate = currDate + 1\n currDateInt = currDate.to_time.to_i\n end\n end\n end\n end\n end\n\n rescue\n #do nothing\n ensure\n eventCounter+=1\n end\n end\n\n statistic = Statistic.new\n statistic.num_sent = eventCounter\n statistic.total_events = saveCounter\n statistic.num_addresses = (Address.count(:all, :group => :event_id)).count()\n \n statsAllEvents = Event.all\n \n statistic.num_pdate = clean_and_count(statsAllEvents.pluck(:pdate))\n statistic.num_ptime = clean_and_count(statsAllEvents.pluck(:ptime))\n statistic.num_price = clean_and_count(statsAllEvents.pluck(:price))\n statistic.save()\n\n responseString = '{\"total\": \"'+eventCounter.to_s+'\", \"saved\":\"'+saveCounter.to_s+'\"}'\n respond_to do |format|\n format.html { render :html => responseString }\n format.json { render :json => responseString }\n \n end\n end", "title": "" }, { "docid": "bc232a91d47e2f37716c1e597391bb6b", "score": "0.5023356", "text": "def group_event_params\n\t begin\n\t\tjson_params = ActionController::Parameters.new( JSON.parse(request.body.read) )\n\t\treturn group_event_params_return(json_params)\n\t rescue\n\t\tlogger.error \"No JSON params found\"\n\t end\n\t group_event_params_return(params)\n end", "title": "" } ]
5092af8daf91b3fb0f19395b835dfa48
select a specific element on the page. You may implement selector_for in your subclass
[ { "docid": "f155c55ab71c76307e4386f50de0c5f1", "score": "0.7014355", "text": "def select(*a)\n page.select selector_for(*a)\n end", "title": "" } ]
[ { "docid": "c6839d8b10fa31d4cea3714ac4c820dc", "score": "0.7340588", "text": "def select(*selector)\n self.class.selector_framework.new(self, *selector)\n end", "title": "" }, { "docid": "8caff2f4ed1a648125e28210603deacf", "score": "0.7164567", "text": "def element(selector)\n @element = @browser.element(css: selector)\nend", "title": "" }, { "docid": "a9dd71cc44cfe308c27a6a604f8d81d7", "score": "0.70806015", "text": "def select_by_selector(selector)\n execute(\"select-by-selector:#{selector}\")\n end", "title": "" }, { "docid": "1c09761e3354a8fbccab3d15c9437640", "score": "0.70375234", "text": "def select (selector)\n selector = selector.is_a?(Selector) ? selector : Selector.new(selector)\n return selector.find(self)\n end", "title": "" }, { "docid": "e6b17d27e664443c69997d04b5395e62", "score": "0.7004266", "text": "def element(selector)\n @doc.at(selector)\n end", "title": "" }, { "docid": "28be7567f00c421c20f326b9fedc57a1", "score": "0.6985729", "text": "def select_element(match)\n select_element_in(@page, match)\n end", "title": "" }, { "docid": "f47c4c97450bd45e0eb296523d9a002c", "score": "0.6978179", "text": "def simple_selectors(selector); end", "title": "" }, { "docid": "e2eddd96be8930563ed49e1fbd5be31c", "score": "0.69690627", "text": "def select\n `#{self}.__element__.select()`\n self\n end", "title": "" }, { "docid": "7028e14c15fa4d362ae855bbf21c98d8", "score": "0.69504315", "text": "def locator\n @selector\n end", "title": "" }, { "docid": "b4b6543afc24b21605edd71279c3bf34", "score": "0.68735826", "text": "def css_selector; end", "title": "" }, { "docid": "646482677d6756703d786bf03d8fe55a", "score": "0.6833978", "text": "def element(doc, selector)\n doc.css(selector)\n end", "title": "" }, { "docid": "1caee7ba6fa0ead8a6cf429d14bedd4d", "score": "0.68300617", "text": "def selector\n @selector || \n Selector.current\n end", "title": "" }, { "docid": "c48eb61a216c2fedb7052815221472bb", "score": "0.6828161", "text": "def document_selector; end", "title": "" }, { "docid": "c48eb61a216c2fedb7052815221472bb", "score": "0.6828161", "text": "def document_selector; end", "title": "" }, { "docid": "c48eb61a216c2fedb7052815221472bb", "score": "0.6828161", "text": "def document_selector; end", "title": "" }, { "docid": "c48eb61a216c2fedb7052815221472bb", "score": "0.6828161", "text": "def document_selector; end", "title": "" }, { "docid": "c48eb61a216c2fedb7052815221472bb", "score": "0.6828161", "text": "def document_selector; end", "title": "" }, { "docid": "c48eb61a216c2fedb7052815221472bb", "score": "0.6828161", "text": "def document_selector; end", "title": "" }, { "docid": "c48eb61a216c2fedb7052815221472bb", "score": "0.6828161", "text": "def document_selector; end", "title": "" }, { "docid": "c48eb61a216c2fedb7052815221472bb", "score": "0.6828161", "text": "def document_selector; end", "title": "" }, { "docid": "c48eb61a216c2fedb7052815221472bb", "score": "0.6828161", "text": "def document_selector; end", "title": "" }, { "docid": "c48eb61a216c2fedb7052815221472bb", "score": "0.6828161", "text": "def document_selector; end", "title": "" }, { "docid": "c48eb61a216c2fedb7052815221472bb", "score": "0.6828161", "text": "def document_selector; end", "title": "" }, { "docid": "c48eb61a216c2fedb7052815221472bb", "score": "0.6828161", "text": "def document_selector; end", "title": "" }, { "docid": "c48eb61a216c2fedb7052815221472bb", "score": "0.6828161", "text": "def document_selector; end", "title": "" }, { "docid": "c48eb61a216c2fedb7052815221472bb", "score": "0.6828161", "text": "def document_selector; end", "title": "" }, { "docid": "c48eb61a216c2fedb7052815221472bb", "score": "0.6828161", "text": "def document_selector; end", "title": "" }, { "docid": "c48eb61a216c2fedb7052815221472bb", "score": "0.6828161", "text": "def document_selector; end", "title": "" }, { "docid": "c48eb61a216c2fedb7052815221472bb", "score": "0.6828161", "text": "def document_selector; end", "title": "" }, { "docid": "c48eb61a216c2fedb7052815221472bb", "score": "0.6828161", "text": "def document_selector; end", "title": "" }, { "docid": "c48eb61a216c2fedb7052815221472bb", "score": "0.6828161", "text": "def document_selector; end", "title": "" }, { "docid": "c48eb61a216c2fedb7052815221472bb", "score": "0.6828161", "text": "def document_selector; end", "title": "" }, { "docid": "c48eb61a216c2fedb7052815221472bb", "score": "0.6828161", "text": "def document_selector; end", "title": "" }, { "docid": "c48eb61a216c2fedb7052815221472bb", "score": "0.6828161", "text": "def document_selector; end", "title": "" }, { "docid": "c48eb61a216c2fedb7052815221472bb", "score": "0.6828161", "text": "def document_selector; end", "title": "" }, { "docid": "c48eb61a216c2fedb7052815221472bb", "score": "0.6828161", "text": "def document_selector; end", "title": "" }, { "docid": "c48eb61a216c2fedb7052815221472bb", "score": "0.6828161", "text": "def document_selector; end", "title": "" }, { "docid": "c48eb61a216c2fedb7052815221472bb", "score": "0.6828161", "text": "def document_selector; end", "title": "" }, { "docid": "c48eb61a216c2fedb7052815221472bb", "score": "0.6828161", "text": "def document_selector; end", "title": "" }, { "docid": "c48eb61a216c2fedb7052815221472bb", "score": "0.6828161", "text": "def document_selector; end", "title": "" }, { "docid": "c48eb61a216c2fedb7052815221472bb", "score": "0.6828161", "text": "def document_selector; end", "title": "" }, { "docid": "c48eb61a216c2fedb7052815221472bb", "score": "0.6828161", "text": "def document_selector; end", "title": "" }, { "docid": "c48eb61a216c2fedb7052815221472bb", "score": "0.6828161", "text": "def document_selector; end", "title": "" }, { "docid": "41a471c02ae6b8aaa0d5adb3b98a9321", "score": "0.678906", "text": "def selector\n selector = self[:selector] || definition_class.selector\n raise PageMagic::InvalidConfigurationException, INVALID_SELECTOR_MSG unless validate_selector?(selector)\n\n Element::Selector.find(selector.keys.first).build(type, selector.values.first, options: options)\n end", "title": "" }, { "docid": "fec5d624d69f3fb31935dcd62261121d", "score": "0.6650284", "text": "def selector(name, select = nil, &block)\r\n tor '@selector', name, select, &block\r\n end", "title": "" }, { "docid": "bcaee25c60d57352dab9d5ed8ddfa1b0", "score": "0.66137534", "text": "def selector; end", "title": "" }, { "docid": "bcaee25c60d57352dab9d5ed8ddfa1b0", "score": "0.66137534", "text": "def selector; end", "title": "" }, { "docid": "bcaee25c60d57352dab9d5ed8ddfa1b0", "score": "0.66137534", "text": "def selector; end", "title": "" }, { "docid": "bcaee25c60d57352dab9d5ed8ddfa1b0", "score": "0.66137534", "text": "def selector; end", "title": "" }, { "docid": "bcaee25c60d57352dab9d5ed8ddfa1b0", "score": "0.66137534", "text": "def selector; end", "title": "" }, { "docid": "bc92d4b391bb5e76ec720c0df3bfcc28", "score": "0.66003036", "text": "def find!\n require_selector!\n new(Capybara.current_session.find(@selector))\n end", "title": "" }, { "docid": "bc92d4b391bb5e76ec720c0df3bfcc28", "score": "0.66003036", "text": "def find!\n require_selector!\n new(Capybara.current_session.find(@selector))\n end", "title": "" }, { "docid": "65ebe8a688e73a0720ddc07c76cb1886", "score": "0.6575508", "text": "def select(element, option)\n browser.select(\"jquery=#{element}\", option)\n end", "title": "" }, { "docid": "611cc71693bafb706f911d3e80529de7", "score": "0.6563141", "text": "def select(target)\n use_selector(Selector.new(target))\n end", "title": "" }, { "docid": "e9722b8d957db48a7e6245bc28ba95fc", "score": "0.6551537", "text": "def selector\n @selector\n end", "title": "" }, { "docid": "e9722b8d957db48a7e6245bc28ba95fc", "score": "0.6551537", "text": "def selector\n @selector\n end", "title": "" }, { "docid": "64d28190f87dd73589c30074d9193498", "score": "0.64746964", "text": "def find(selector, &block)\n\t\t\tdata = selector.split('=', 2)\n\t\t\ttype = data[0]\n\t\t\targ = data[-1]\n\t\t\tunless data.length == 2 and type =~ /^[a-z_]+$/i\n\t\t\t\ttype = @default\n\t\t\t\targ = selector\n\t\t\tend\n\t\t\traise ArgumentError, \"Invalid selector type '#{type}'\" unless Context::selectors.include? type\n\t\t\t\n\t\t\tcustom_selectors = Context::selectors(false)\n\t\t\treturn send(type , arg, &block) if custom_selectors.include? type\n\t\t\treturn send(type+'_selector', arg, &block) if custom_selectors.include? type+'_selector'\n\t\t\tselenium_find(type, arg, &block)\n\t\tend", "title": "" }, { "docid": "9bd590403a3c978f2111b1034ebe292f", "score": "0.64663446", "text": "def get_selector\n # Interface method\n end", "title": "" }, { "docid": "07e5d0dcba7239a3b08176552919c0ab", "score": "0.6456384", "text": "def selector=(value)\n @selector = value\n end", "title": "" }, { "docid": "f4ec29f80c820ccf94a4184502d856d5", "score": "0.6411563", "text": "def selector\n @selector = @outer_has_tag ? @outer_has_tag.selector : ''\n\n @selector << \"//#{@tag}#{id_selector}#{class_selector}\"\n @selector << @attributes.map{|a, v| \"[@#{a}=\\\"#{v}\\\"]\"}.join\n end", "title": "" }, { "docid": "1f5e8923bdbc0b4cca3084b665d97d15", "score": "0.6409519", "text": "def selector(symbol=nil)\n result = Toolkit.selector(self.lookup_class.selectable_lookup, symbol)\n puts \"Selector:\"\n puts result.inspect\n result\n end", "title": "" }, { "docid": "bd59590f4d7d04c29402fbc57a037e78", "score": "0.6401872", "text": "def find_element_with_selector(selector)\n ensure_current_page_exists\n driver.execute_script(\"return $('#{selector}')[0]\")\n return self\n end", "title": "" }, { "docid": "5252916dba9888a5fda162f04b2c9561", "score": "0.64011735", "text": "def selector\n return @selector\n end", "title": "" }, { "docid": "21053aecd9b33b0f29479370abb0749f", "score": "0.6397867", "text": "def find(selector)\n # Interface method\n end", "title": "" }, { "docid": "be8651c48a240604b5d7a5a0f8b6deea", "score": "0.6391073", "text": "def selector\n @selector ||= document.atomic_selector\n end", "title": "" }, { "docid": "3fa7e783afd36bdebb954eb859f6cd8c", "score": "0.63873935", "text": "def select(*args, &block)\n browser.within(component.within) do\n browser.select(*args, &block)\n end\n end", "title": "" }, { "docid": "591b95498d083701b53c8dbdcc4ed4e8", "score": "0.63623405", "text": "def selector_for(locator)\n case locator\n\n when \"the page\"\n \"html > body\"\n\n # Add more mappings here.\n # Here is an example that pulls values out of the Regexp:\n #\n # when /^the (notice|error|info) flash$/\n # \".flash.#{$1}\"\n\n # You can also return an array to use a different selector\n # type, like:\n #\n # when /the header/\n # [:xpath, \"//header\"]\n\n # This allows you to provide a quoted selector as the scope\n # for \"within\" steps as was previously the default for the\n # web steps:\n when /^\"(.+)\"$/\n $1\n\n else\n raise \"Can't find mapping from \\\"#{locator}\\\" to a selector.\\n\" +\n \"Now, go and add a mapping in #{__FILE__}\"\n end\n end", "title": "" }, { "docid": "1db99df2ee0b0b4c47830380c3b5e04b", "score": "0.6356461", "text": "def matching selector\n self\n end", "title": "" }, { "docid": "d5221c5b47d0616c5a598ee1a69b8f23", "score": "0.63447946", "text": "def title_id_selector\n $tracer.trace(__method__)\n return GameInformerCRMSelector.new(div.className(\"page\").div.id(\"main\").div.className(\"row\").select, __method__)\n\n end", "title": "" }, { "docid": "ac6f070550810f202cd250ce733a297f", "score": "0.6344646", "text": "def selector_for(locator)\n case locator\n\n when \"the page\"\n \"html > body\"\n\n # Add more mappings here.\n # Here is an example that pulls values out of the Regexp:\n #\n # when /^the (notice|error|info) flash$/\n # \".flash.#{$1}\"\n\n # You can also return an array to use a different selector\n # type, like:\n #\n # when /the header/\n # [:xpath, \"//header\"]\n\n # This allows you to provide a quoted selector as the scope\n # for \"within\" steps as was previously the default for the\n # web steps:\n when /^\"(.+)\"$/\n $1\n\n else\n raise \"Can't find mapping from \\\"#{locator}\\\" to a selector.\\n\" +\n \"Now, go and add a mapping in #{__FILE__}\"\n end\n end", "title": "" }, { "docid": "e46874c1512cd74af3736b81b2428d80", "score": "0.6336268", "text": "def selector(s)\n @selector = s\n end", "title": "" }, { "docid": "e46874c1512cd74af3736b81b2428d80", "score": "0.6336268", "text": "def selector(s)\n @selector = s\n end", "title": "" }, { "docid": "04c13b5dbf463297f54063512a2d3570", "score": "0.6315155", "text": "def select *args\n SingletonBrowser.instance.browser.send :select, *args\n end", "title": "" }, { "docid": "bf10bcae2e2bc1689571f4bd9f42da54", "score": "0.6315015", "text": "def GetElement(selector)\n\treturn JQueryElement.GetElement(self, selector)\n end", "title": "" }, { "docid": "fce4f76379826d89974e30be925a36ed", "score": "0.6274998", "text": "def click_selector(selector)\n ensure_current_page_exists\n elements = driver.find_elements(:css, selector)\n if elements.empty?\n raise(HeadlessBrowserError, \"CSS selector #{selector} has no matches\")\n end\n elements.first.click\n return self\n end", "title": "" }, { "docid": "b1f129f2e92ca866faca8cb63486dc80", "score": "0.6267037", "text": "def find(selector, method = :at_xpath)\n self.class.new(node.public_send(method, selector))\n end", "title": "" }, { "docid": "5d8edd66cdb92fc3eba0e8dcc715d09b", "score": "0.62218577", "text": "def find (selector)\n select(selector).first\n end", "title": "" }, { "docid": "8c7739877f74d6cf3db4d7088455af7a", "score": "0.6213998", "text": "def select_by_element(element)\n execute(\"select-by-element:#{element}\")\n end", "title": "" }, { "docid": "06766fe454f95ce5d7797a762d87e7a2", "score": "0.61998475", "text": "def select_node; end", "title": "" }, { "docid": "06766fe454f95ce5d7797a762d87e7a2", "score": "0.61998475", "text": "def select_node; end", "title": "" }, { "docid": "985fe7eb582891f3273bdce19998f007", "score": "0.61778516", "text": "def css(selector)\n raise NotImplementedError, 'query by CSS selector unsupported'\n end", "title": "" }, { "docid": "0d73dc2d997c4a741ae517da50b2ee2b", "score": "0.61675894", "text": "def capybara_element\n scope.capybara_element.find selector, options\n end", "title": "" }, { "docid": "b9ef78d83b2a4a5b53777282266f3a41", "score": "0.6108606", "text": "def within(selector_or_object, &block)\n if selector_or_object.is_a?(String)\n super\n else\n super('#' + dom_id(selector_or_object), &block)\n end\n end", "title": "" }, { "docid": "9a65a7e92dbbebbc081e767f8a8550f1", "score": "0.607064", "text": "def find(selector_type, selector_value)\n case selector_type\n when :button then buttons[selector_value]\n when :text then texts[selector_value]\n when :textfield then textfields[selector_value]\n when :id then find_element id: selector_value\n when :xpath then find_element xpath: selector_value\n else raise ArgumentError, \"Unknown selector type: #{selector_type}\"\n end\n end", "title": "" }, { "docid": "5ef61a22023e2dcf6e5bd31bcc8aa04b", "score": "0.6064802", "text": "def select(element, option)\n tap_on(element)\n tap_on(option)\n end", "title": "" }, { "docid": "2885fda8a01ecdd2b2c6eabb5e6812e8", "score": "0.6050999", "text": "def selector_nested_type(selector_type, parent, args)\n\n case selector_type\n when :id then parent.find_element id: args[:id]\n when :xpath then parent.find_element xpath: args[:xpath]\n else raise ArgumentError, \"Unknown selector type: #{selector_type}\"\n end\n end", "title": "" }, { "docid": "2de187395ddca907aab928922609370b", "score": "0.6049098", "text": "def selector(value, selector)\n value.selector = selector\n value\n end", "title": "" }, { "docid": "2de187395ddca907aab928922609370b", "score": "0.6049098", "text": "def selector(value, selector)\n value.selector = selector\n value\n end", "title": "" }, { "docid": "257341559c497ca8966618d81df76d23", "score": "0.60446143", "text": "def find(selector, options={})\n raise NotImplementedError.new\n end", "title": "" }, { "docid": "dcf0ab866882fbb9cc3a1ed789e7bb5b", "score": "0.60445505", "text": "def search_by_element_class(options)\r\n @page = @page.css(options)\r\n end", "title": "" }, { "docid": "41003826fd84a033b38f251ef5f70160", "score": "0.60378283", "text": "def xpath(selector)\n document.xpath(selector)\n end", "title": "" }, { "docid": "41003826fd84a033b38f251ef5f70160", "score": "0.60378283", "text": "def xpath(selector)\n document.xpath(selector)\n end", "title": "" }, { "docid": "c1741e2493ca9c52c8d147617c10595b", "score": "0.6020756", "text": "def search(selector)\n Nokogiri::HTML.parse(@driver.page_source).search selector\n end", "title": "" }, { "docid": "e89f9f78d9d936e13ba4a1e54d22f203", "score": "0.6020188", "text": "def page_selector(element, content_name, options = {}, select_options = {})\n default_options = {\n :page_attribute => :id,\n :global => false,\n :prompt => _t('Choose page'),\n :order_by => :name\n }\n options = default_options.merge(options)\n content = element.content_by_name(content_name)\n if options[:global] || options[:only].present?\n pages = Page.where({\n :language_id => session[:language_id],\n :layoutpage => options[:global] == true,\n :public => options[:global] == false\n })\n if options[:only].present?\n pages = pages.where({:page_layout => options[:only]})\n end\n pages_options_tags = pages_for_select(pages.order(options[:order_by]), content ? content.ingredient : nil, options[:prompt], options[:page_attribute])\n else\n pages_options_tags = pages_for_select(nil, content ? content.ingredient : nil, options[:prompt], options[:page_attribute])\n end\n options.update(:select_values => pages_options_tags)\n if content.nil?\n render_missing_content(element, content_name, options)\n else\n render_essence_editor(content, options)\n end\n end", "title": "" }, { "docid": "c66d1dc8c3f716723b4b768634a9fd95", "score": "0.60075754", "text": "def to_selector(from)\n self.get_item(from, :selectors) do #if not matches\n # If a selector can't be found the argument is returned\n from \n end\n end", "title": "" }, { "docid": "abdb4f8eb297767aade1c6e9f9a231fe", "score": "0.6006145", "text": "def selector_for(locator)\n case locator\n\n when \"the page\"\n \"html > body\"\n when \"current user\"\n \"#session .name\"\n\n when /^the (menu|header)$/\n \"div.navbar\"\n\n when /^the sidebar disks? list$/\n \"#sidebar ul.disks\"\n\n when /^the sidebar director(?:ies|y) list$/\n \"#sidebar ul.directories\"\n\n when /^the torrents? list$/\n \"ul#torrents\"\n\n when /^the #{capture_nth} (torrent)$/\n selector_for(\"the #{$2.pluralize} list\") + \" li#{Numerals[$1]}\"\n\n when /^the #{capture_nth} row$/\n \"tr#{Numerals[$1]}\"\n\n when /^the director(y|ies) list$/\n \"table.directories\"\n\n when \"the footer\"\n raise \"no footer\"\n \"div[data-role='footer']\"\n\n when 'the spinner'\n '#spinner > .spinner'\n\n when 'the modal box'\n 'div.modal'\n\n when 'the queue'\n '#queue'\n\n when 'the breadcrumbs'\n 'ul.breadcrumb'\n\n when 'the sidebar'\n '#sidebar'\n\n when 'a row'\n '.row-fluid'\n\n when 'a label'\n 'span.label' # bootstrap\n\n when /^(?:the )?item of #{capture_model}$/\n \"##{ model!($1).decorate.item_id }\"\n\n when /^the (\\w+) link$/\n \"a.#{$1}\"\n\n # TODO move to jquery_mobile\n when /^(?:a )?flash (notice|alert)$/\n \".flash.alert-#{$1}\"\n\n when /^the (\\w+)$/\n \"##{$1}\"\n\n when /^the (\\w+) section$/\n \"section.#{$1}\"\n when /the progress( pie)?/\n \".progress-pie\"\n when /^the (up|down) rate$/\n \".#{$1}\"\n when /^the transfer of #{capture_model}$/\n \"#transfer_torrent_#{model!($1).id}\"\n\n when 'the window title'\n \"title\"\n\n when 'the page title'\n \"h1#title\"\n\n # Add more mappings here.\n # Here is an example that pulls values out of the Regexp:\n #\n # when /^the (notice|error|info) flash$/\n # \".flash.#{$1}\"\n\n # You can also return an array to use a different selector\n # type, like:\n #\n # when /the header/\n # [:xpath, \"//header\"]\n\n # This allows you to provide a quoted selector as the scope\n # for \"within\" steps as was previously the default for the\n # web steps:\n when /^\"(.+)\"$/\n $1\n\n else\n raise \"Can't find mapping from \\\"#{locator}\\\" to a selector.\\n\" +\n \"Now, go and add a mapping in #{__FILE__}\"\n end\n end", "title": "" }, { "docid": "c5f3c161044316df527be4a5bd54342d", "score": "0.5978077", "text": "def css_selector\n target = attribute_class_name\n prefix = case target\n when /cell/ # s_cell or cell\n \".s_#{self.param_value.page_layout_id}_#{self.param_value.section_param.section_root_id} td, .s_#{self.param_value.page_layout_id}_#{self.param_value.section_param.section_root_id} th\"\n when /^s\\_/\n target = target[2..-1]\n \".s_#{self.param_value.page_layout_id}_#{self.param_value.section_param.section_root_id}\"\n when /page|sidr/\n \"#page\"\n when 'content_layout','first_child','last_child'\n \".c_#{self.param_value.page_layout_id}\"\n #when /(label|input|img|button|block)/ # product_atc, product_quantity, block_hover\n # \".s_#{self.param_value.page_layout_id}_#{self.param_value.section_param.section_root_id}\"\n #when 'as_h','a_h','a','th','td','li'\n # \".s_#{self.param_value.page_layout_id}_#{self.param_value.section_param.section_root_id}\"\n else\n \".s_#{self.param_value.page_layout_id}_#{self.param_value.section_param.section_root_id}\"\n end\n\n # it has to apply to inner, for root, outer is body, it include editor panel, some css would affect it.\n selector = case target\n when /content_layout/,'block','block_h',/cell/,'page'\n \"\"\n when /block_/ #block_hovered\n \".#{target}\"\n when /inner/\n \"> .inner\"\n when 'as_h','a_sel' #selected:hover, selected\n \" a.selected\"\n when 'a_una' # unavailable, unclickable\n \" a.unavailable\"\n when 'a','a_h'\n \" a\"\n #when 'first_child','last_child'\n # # it is not right way to center content,\n # # in html, we may add form to wrap each child, first-child do not work in this case.\n # # padding,margin is applied to inner, it also affect width of outer div\n # \":#{target[/[a-z]+/]} \"\n when /\\_h$/ #button_h\n \" #{target.delete('_h')}\"\n when 'error' #s_error\n \" label.error\"\n when 'table','label','input','li','img','button','td','th','h6','dt','dd'\n # product quantity,atc section_piece content just input,add a <span> wrap it.\n # product images content thumb and main images so here should be section_id,\n \" #{target}\"\n when /pagination/\n \" #{target.sub('-',' ')}\"\n else #noclick, selected\n \" .#{target}\"\n end\n#Rails.logger.debug \"css selector:#{prefix+selector}, #{attribute_name}:#{attribute_value}\"\n prefix+selector\n end", "title": "" }, { "docid": "f55901ec63254fa5dba0064e872fcce2", "score": "0.5960344", "text": "def selector_parse(selector); end", "title": "" }, { "docid": "5756aaf70f23ffa6c4d095ba3117ceb7", "score": "0.5959512", "text": "def match_selector(page, css_selector)\n title_nodes = page.css(css_selector)\n\n if title_nodes.length > 0\n title_nodes[0].text\n else\n \"ERROR: Couldn't parse CSS selector.\"\n end\nend", "title": "" }, { "docid": "d24488bafa4fe00ab332ee7311c77278", "score": "0.59489596", "text": "def select_element_in(contents, match)\n result = (contents.respond_to?(:/) ? contents : Hpricot(contents.body)) / match\n if result.blank?\n report_error(\"Tried to find element matching #{match}, but couldn't\")\n else\n result\n end\n end", "title": "" } ]
834382127c933280e559a19016eac14a
TOOD: Rails 4 upgrade, remove when tests pass def title for PaperTrailManager's RSS output taxt end
[ { "docid": "5bea77bb33399aa4b062666dc84d9a47", "score": "0.0", "text": "def update_taxt_from_editable editable_taxt\n update_attributes taxt: Taxt.from_editable(editable_taxt)\n rescue Taxt::ReferenceNotFound => e\n errors.add :base, \"The reference '#{e}' could not be found. Was the ID changed?\"\n end", "title": "" } ]
[ { "docid": "ccf7ccf6ffe845787718c5467070dbb6", "score": "0.7637508", "text": "def title_name; end", "title": "" }, { "docid": "d0b3e2be6e8f69b3a3d4c0459644f520", "score": "0.7611759", "text": "def page_title; end", "title": "" }, { "docid": "018eeb80f07f7ec1877c9cae04f8f449", "score": "0.75283694", "text": "def page_title\n end", "title": "" }, { "docid": "e4d08ff156ae44c2ce1a9a33962d30e9", "score": "0.7456302", "text": "def title; end", "title": "" }, { "docid": "e4d08ff156ae44c2ce1a9a33962d30e9", "score": "0.7456302", "text": "def title; end", "title": "" }, { "docid": "e4d08ff156ae44c2ce1a9a33962d30e9", "score": "0.7456302", "text": "def title; end", "title": "" }, { "docid": "e4d08ff156ae44c2ce1a9a33962d30e9", "score": "0.7456302", "text": "def title; end", "title": "" }, { "docid": "e4d08ff156ae44c2ce1a9a33962d30e9", "score": "0.7456302", "text": "def title; end", "title": "" }, { "docid": "e4d08ff156ae44c2ce1a9a33962d30e9", "score": "0.7456302", "text": "def title; end", "title": "" }, { "docid": "e4d08ff156ae44c2ce1a9a33962d30e9", "score": "0.7456302", "text": "def title; end", "title": "" }, { "docid": "e4d08ff156ae44c2ce1a9a33962d30e9", "score": "0.7456302", "text": "def title; end", "title": "" }, { "docid": "e4d08ff156ae44c2ce1a9a33962d30e9", "score": "0.7456302", "text": "def title; end", "title": "" }, { "docid": "e4d08ff156ae44c2ce1a9a33962d30e9", "score": "0.7456302", "text": "def title; end", "title": "" }, { "docid": "e4d08ff156ae44c2ce1a9a33962d30e9", "score": "0.7456302", "text": "def title; end", "title": "" }, { "docid": "e4d08ff156ae44c2ce1a9a33962d30e9", "score": "0.7456302", "text": "def title; end", "title": "" }, { "docid": "e4d08ff156ae44c2ce1a9a33962d30e9", "score": "0.7456302", "text": "def title; end", "title": "" }, { "docid": "e4d08ff156ae44c2ce1a9a33962d30e9", "score": "0.7456302", "text": "def title; end", "title": "" }, { "docid": "e4d08ff156ae44c2ce1a9a33962d30e9", "score": "0.7456302", "text": "def title; end", "title": "" }, { "docid": "e4d08ff156ae44c2ce1a9a33962d30e9", "score": "0.7456302", "text": "def title; end", "title": "" }, { "docid": "e4d08ff156ae44c2ce1a9a33962d30e9", "score": "0.7456302", "text": "def title; end", "title": "" }, { "docid": "e4d08ff156ae44c2ce1a9a33962d30e9", "score": "0.7456302", "text": "def title; end", "title": "" }, { "docid": "efd7cbf6b9ea8da1f2cd28324246c100", "score": "0.7434884", "text": "def title\n \"\"\n end", "title": "" }, { "docid": "4cc0d2fe2fa3c60604d57246223e5fb6", "score": "0.7406373", "text": "def title\n base_title = \"Syamantak Mukhopadhyay - Weblog\"\n if @title.nil?\n base_title\n else\n \"#{@title}\"\n end\n end", "title": "" }, { "docid": "d33a8a3333f7c9a905acb51aedf35f97", "score": "0.7398524", "text": "def title\n\t\tbase_title = title_extend\n\t\tif @title.nil?\n\t\t\tbase_title\n\t\telse\n\t\t\t\"#{base_title} | #{@title}\"\n\t\tend\n\tend", "title": "" }, { "docid": "a47a9c8c08d67b418a444c55c0796953", "score": "0.73875153", "text": "def get_title\n @title\n end", "title": "" }, { "docid": "c438fcd38a8afa94e0e4de4197a72f94", "score": "0.7355968", "text": "def get_title()\n @title\n end", "title": "" }, { "docid": "f5f90883fee7d0c30c4722f525c0dad8", "score": "0.7352288", "text": "def page_title() nil end", "title": "" }, { "docid": "9a1edfd1e9a05eb6a9cd780e7e585512", "score": "0.7334485", "text": "def title\n super.first || \"\"\n end", "title": "" }, { "docid": "9a1edfd1e9a05eb6a9cd780e7e585512", "score": "0.7334485", "text": "def title\n super.first || \"\"\n end", "title": "" }, { "docid": "614ad945461b6fc81c2c36ce101026ab", "score": "0.7332836", "text": "def get_title\n @title\n end", "title": "" }, { "docid": "cef90abd88844eac126b4d1f006be82f", "score": "0.7327433", "text": "def title\n base_title = \"Reseau Social ESMT\"\n if @title.nil?\n base_title\n else\n \"#{base_title} | #{@title}\"\n end\n end", "title": "" }, { "docid": "be6d9edb4ba4046ea3b09f4f527772df", "score": "0.73208934", "text": "def title\n return @title\n end", "title": "" }, { "docid": "be6d9edb4ba4046ea3b09f4f527772df", "score": "0.73208934", "text": "def title\n return @title\n end", "title": "" }, { "docid": "32a8fc20555c271b6685c788a2344266", "score": "0.73060465", "text": "def title\n super.first || ''\n end", "title": "" }, { "docid": "32a8fc20555c271b6685c788a2344266", "score": "0.73060465", "text": "def title\n super.first || ''\n end", "title": "" }, { "docid": "32a8fc20555c271b6685c788a2344266", "score": "0.73060465", "text": "def title\n super.first || ''\n end", "title": "" }, { "docid": "31e95b3452c5425aef024190f14ef22b", "score": "0.7302357", "text": "def get_title()\n return @title\n end", "title": "" }, { "docid": "0705d6c00fa70cadf0a13d40ca07ee46", "score": "0.72958386", "text": "def title\n if @title.nil?\n BASE_TITLE\n else\n \"#{BASE_TITLE} | #{@title}\"\n end\n end", "title": "" }, { "docid": "95755ef7c6bc4dab6917fb134d2f7dde", "score": "0.7294122", "text": "def title\n\t\tbase_title = \"RailsTest\"\n\t\tif @title.nil?\n\t\tbase_title\n\t\telse\n\t\t\t\"#{base_title} | #{@title}\"\n\t\tend\n\tend", "title": "" }, { "docid": "74663c9ead0bbf36e904e4c306160045", "score": "0.72903836", "text": "def title\n return nil\n end", "title": "" }, { "docid": "ccc814f247be4e9d84644f24bba9bc71", "score": "0.72900915", "text": "def\n get_title()\n @title\n end", "title": "" }, { "docid": "4741eafb7a67101d62963ec5e2b45932", "score": "0.72711027", "text": "def title\n base_title = \"Digital Library Management Tool\"\n if @title.nil?\n base_title\n else\n \"#{base_title}|#{@title}\"\n end\n end", "title": "" }, { "docid": "16442e63f4bebccd4f71aac00a590c0c", "score": "0.7268811", "text": "def title\n base_title = \"Railstwitterclone\"\n if @title.nil?\n base_title\n else\n \"#{base_title} - #{@title}\"\n end\n end", "title": "" }, { "docid": "f6f7822983398bb5913840acc2e8eb3a", "score": "0.7264174", "text": "def title\n ''\n end", "title": "" }, { "docid": "8074a595d64cd76a0fcc2908f56d1fb9", "score": "0.72635067", "text": "def title\n base_title = \"An Andy Sharkey Production\"\n if @title.nil?\n base_title\n else\n \"#{base_title} | #{@title}\"\n end\n end", "title": "" }, { "docid": "3fd987f204407738ad60520a9beefb91", "score": "0.7260626", "text": "def title\n base_title = \"StkUp - Simple, Purposeful Comparisons\"\n @title.nil? ? base_title : \"#{base_title} | #{@title}\"\n end", "title": "" }, { "docid": "1904ccec3478b1e02f060f3cac3475a1", "score": "0.7259005", "text": "def title\n end", "title": "" }, { "docid": "48908c17827d0af955e4f0014c430a95", "score": "0.7256925", "text": "def augmented_title\n return self.title\n end", "title": "" }, { "docid": "fb6f45b3ac759617291fcaf6965a365f", "score": "0.72542787", "text": "def title\n nil\n end", "title": "" }, { "docid": "4c0b1cb1af62f7ac2c4f2aede604c699", "score": "0.7241325", "text": "def title\n return @title\n end", "title": "" }, { "docid": "b1c2f0d6d7771e20d547679471b1c9a3", "score": "0.7240253", "text": "def title\n base_title = \"Team DIET Tracker\"\n if @title.nil?\n base_title\n else\n \"#{base_title} | #{@title}\"\n end\n end", "title": "" }, { "docid": "05636a18e92209f7a87f9922d81e40d3", "score": "0.7230053", "text": "def title\n base_title = \"Temple Baptist Church, White House, TN\"\n if @title.nil?\n base_title\n else\n \"#{base_title} | #{@title}\"\n end\n end", "title": "" }, { "docid": "e3b2ea78946c784125922b05af386757", "score": "0.72198147", "text": "def title\n base_title = \"S.Hukin ltd - Sheffield, UK. Speciality wholesale foods.\"\n if @title.nil?\n base_title\n else\n \"#{base_title} | #{@title}\"\n end\n end", "title": "" }, { "docid": "2beca59144f240b4b08362b3fde9130a", "score": "0.7211503", "text": "def check_title\n if self.title.blank? && st = (url && Site.by_link(self.url))\n self.title = (st.yield :Title, st.sampleURL)[:Title] || \"\"\n self.title = self.trimmed_title\n else\n self.title\n end\n end", "title": "" }, { "docid": "a3466aa51d721f6658e6cdb3b20a208f", "score": "0.7209553", "text": "def get_title\n base_title = get_name_or_logo\n @title.nil? ? base_title : \"#{base_title} | #{@title}\"\n end", "title": "" }, { "docid": "9423c64ac0de8d0102c951d2579100b5", "score": "0.7180775", "text": "def title\n # strip some non-breaking space at the end\n @title ||= details.at(\"h1[itemprop='name']\").children.first.text.strip.gsub(' ', '') rescue nil\n end", "title": "" }, { "docid": "861c0f2339706203242f947394a8742f", "score": "0.71804625", "text": "def title\n @title\n end", "title": "" }, { "docid": "861c0f2339706203242f947394a8742f", "score": "0.71804625", "text": "def title\n @title\n end", "title": "" }, { "docid": "861c0f2339706203242f947394a8742f", "score": "0.71804625", "text": "def title\n @title\n end", "title": "" }, { "docid": "861c0f2339706203242f947394a8742f", "score": "0.71804625", "text": "def title\n @title\n end", "title": "" }, { "docid": "861c0f2339706203242f947394a8742f", "score": "0.71804625", "text": "def title\n @title\n end", "title": "" }, { "docid": "aa16cc5d3ab86f4bdf899f94c6f470e4", "score": "0.7178535", "text": "def title\n @title\n end", "title": "" }, { "docid": "42a0361f29a5a27d744148dcea5a0d52", "score": "0.7172376", "text": "def title\n base_title = \"Operation Paws for Homes\"\n if @title.nil?\n base_title\n else\n \"#{base_title} | #{@title}\"\n end\n end", "title": "" }, { "docid": "c5328b238b04f6213e28b807b988e96f", "score": "0.71710056", "text": "def episode_title; end", "title": "" }, { "docid": "2de4091738cb00c79c305649a8d4bba7", "score": "0.71707463", "text": "def handle_title(name, attrs) \n \n end", "title": "" }, { "docid": "f51b8a31db3513376ec3b2f29794641c", "score": "0.7167312", "text": "def page_title \n %(<title>#{page_title_raw}My Blog</title>) # Customize this for your blog\n end", "title": "" }, { "docid": "3eb9558ec92d40a312b4a44af842ceb4", "score": "0.71619797", "text": "def title\n base_title = \"Bejben\"\n if @title.nil?\n base_title\n else\n \"#{base_title} | #{@title}\"\n end\n end", "title": "" }, { "docid": "2442a32bf882581cf4be076ee1fd2401", "score": "0.716139", "text": "def title\nbase_title = \"Ruby on Rails Tutorial Sample App\"\nif @title == nil\n@title = base_title\nelse\n@title = base_title + \" | \" + @title\nend\nend", "title": "" }, { "docid": "06d7e3a787b8557aed8a9003f7c66f1c", "score": "0.71596223", "text": "def title\n base_title = \"My Site\"\n unless @title.nil?\n \"#{base_title} | #{@title}\"\n else\n base_title\n end\n\n end", "title": "" }, { "docid": "ad604e7140b07c12f3b0f351b367a6be", "score": "0.71393955", "text": "def title(title = nil)\n @title = title if title\n @title\n end", "title": "" }, { "docid": "63f295cf74a10c8dbdb05a178c828ccc", "score": "0.71381974", "text": "def title\n name\n end", "title": "" }, { "docid": "63f295cf74a10c8dbdb05a178c828ccc", "score": "0.71381974", "text": "def title\n name\n end", "title": "" }, { "docid": "bc4757d204679a67726fbc47a1019ff4", "score": "0.7133363", "text": "def title\n base_title = 'Statustar'\n if @title.nil?\n base_title\n else\n \"#{base_title} | #{@title}\"\n end\n end", "title": "" }, { "docid": "596499b57cb1f5c4009505a7e3073823", "score": "0.7132716", "text": "def content_for_rss_title\n content_for_rss_meta(\"title\")\n end", "title": "" }, { "docid": "5ca37d10edbc2e5e7fe9cfeddfcf79e9", "score": "0.71239394", "text": "def title\n\t base_title = \"Most epic website of all time, also celebrating beer.\"\n\t if @title.nil?\n\t base_title\n\t else\n\t \"#{base_title} | #{@title}\"\n\t end\n end", "title": "" }, { "docid": "857415bb695acb71b53ac74698eb36d2", "score": "0.71235186", "text": "def title\n base_title = \"LoveALLogy\"\n if @title.nil?\n base_title\n else\n \"#{base_title} | #{@title}\"\n end\n end", "title": "" }, { "docid": "8b83428a82372c99c57206513bd94f45", "score": "0.71209496", "text": "def title\n @title ||= self.class.non_namespaced_classname\n end", "title": "" }, { "docid": "1c3dd9bf9d78ce37611d3b009f20b5a8", "score": "0.7109823", "text": "def title\n self.attributes[\"title\"] || DEFAULT_TITLE\n end", "title": "" }, { "docid": "1f059a53f2f22a9b17509e6c4a582144", "score": "0.7109383", "text": "def title?; end", "title": "" }, { "docid": "334ba2fbfa28ae121c3f5399ba4ef74b", "score": "0.71071005", "text": "def title\n\t\tbase_title = \"Black Market Books\"\n\t\tif @title.nil?\n\t\t\tbase_title\n\t\telse\n\t\t\t\"#{base_title} | #{@title}\"\n\t\tend\n\tend", "title": "" }, { "docid": "c278e8fe88d0990a79a7df79afb552bf", "score": "0.71049273", "text": "def title\n raise NotImplementedError, 'Subclasses must implement a title method.'\n end", "title": "" }, { "docid": "96c39b051f6e67f9b296258c634094df", "score": "0.7097203", "text": "def title\n base_title = \"This app is a Toast Machine\"\n if @title.nil?\n base_title\n else\n \"#{base_title} | #{@title}\"\n end\n end", "title": "" }, { "docid": "64d25cca9d75ececaa9513da6304c4df", "score": "0.70908004", "text": "def title\n if @title.nil?\n repair_entities = false\n title_node = FeedTools::XmlHelper.try_xpaths(self.channel_node, [\n \"atom10:title\",\n \"atom03:title\",\n \"atom:title\",\n \"title\",\n \"dc:title\",\n \"channelTitle\",\n \"TITLE\"\n ])\n @title = FeedTools::HtmlHelper.process_text_construct(title_node,\n self.feed_type, self.feed_version, [self.base_uri])\n if self.feed_type == \"atom\" ||\n self.configurations[:always_strip_wrapper_elements]\n @title = FeedTools::HtmlHelper.strip_wrapper_element(@title)\n end\n @title = nil if @title.blank?\n self.cache_object.title = @title unless self.cache_object.nil?\n end\n return @title\n end", "title": "" }, { "docid": "19fed838abadaeeb8241386f58422371", "score": "0.70823956", "text": "def title=(text); end", "title": "" }, { "docid": "19fed838abadaeeb8241386f58422371", "score": "0.70823956", "text": "def title=(text); end", "title": "" }, { "docid": "0414774f66d7de0b9df4497332c4b6bd", "score": "0.7073456", "text": "def title\n return \"Blah, blah, yay!\"\n end", "title": "" }, { "docid": "2dc7c407a1b621833ed58ee95dfebe2b", "score": "0.7071517", "text": "def title\n page.title\n end", "title": "" }, { "docid": "9d833aaa6e18cd86e1aa88eb94bfc156", "score": "0.70482844", "text": "def title\n base_title = \"Let Me Sing Now, llc\"\n if @title.nil?\n base_title\n else\n \"#{base_title} | #{@title}\"\n end\n end", "title": "" }, { "docid": "eb7d047ba3eea523da55c08fe3b0abd2", "score": "0.7047948", "text": "def title\n base_title = \"Ruby on Rails Tutorial Sample App\"\n if @title.nil?\n base_title\n else\n \"#{base_title} | #{@title}\"\n end\n end", "title": "" }, { "docid": "eb7d047ba3eea523da55c08fe3b0abd2", "score": "0.7047948", "text": "def title\n base_title = \"Ruby on Rails Tutorial Sample App\"\n if @title.nil?\n base_title\n else\n \"#{base_title} | #{@title}\"\n end\n end", "title": "" }, { "docid": "9481e10b0d50d36430b714e92e7a773f", "score": "0.7044944", "text": "def title\n \"#{self.article_revision.title}\"\n end", "title": "" }, { "docid": "f9bd2d2a2e3452330734d97cd0f2f87c", "score": "0.7043597", "text": "def title\n return @title\n end", "title": "" }, { "docid": "f9bd2d2a2e3452330734d97cd0f2f87c", "score": "0.7043597", "text": "def title\n return @title\n end", "title": "" }, { "docid": "f9bd2d2a2e3452330734d97cd0f2f87c", "score": "0.7043597", "text": "def title\n return @title\n end", "title": "" }, { "docid": "f9bd2d2a2e3452330734d97cd0f2f87c", "score": "0.7043597", "text": "def title\n return @title\n end", "title": "" }, { "docid": "f9bd2d2a2e3452330734d97cd0f2f87c", "score": "0.7043597", "text": "def title\n return @title\n end", "title": "" }, { "docid": "f9bd2d2a2e3452330734d97cd0f2f87c", "score": "0.7043597", "text": "def title\n return @title\n end", "title": "" }, { "docid": "f9bd2d2a2e3452330734d97cd0f2f87c", "score": "0.7043597", "text": "def title\n return @title\n end", "title": "" }, { "docid": "d2ab2bc094d36ca83bc1991ccb6839c5", "score": "0.7026796", "text": "def title\n\tbase_title = \"Ruby on Rails Tutorial Sample App\"\n\tif @title.nil?\n\t\tbase_title\n\telse\n\t\t\"#{base_title} | #{@title}\"\n\tend\nend", "title": "" }, { "docid": "12ae50e91a8052d7221f0ac224e18821", "score": "0.70267916", "text": "def title\n\t\tbase_title = \"Rubby on the rails Tutorial Sample App\"\n\t\tif @title.nil?\n\t\t\tbase_title\n\t\telse\n\t\t\t\"#{base_title} |#{@title}\"\n\t\tend\n\tend", "title": "" }, { "docid": "248b92a2cec9e940bfb7302857580218", "score": "0.7021116", "text": "def get_title(n)\n description = Nokogiri::HTML(@description_xpath[n].text).text\n if description.include?(\"IF YOU GO\")\n description = description.split(\"IF YOU GO\")[1]\n if description.include?(\"Where\")\n title = description.split(\"Where\")[0]\n # Title must fit on single line\n title.gsub!(\"\\n\", \" \").strip!\n title\n else\n super(n)\n end\n else\n super(n)\n end\n end", "title": "" } ]
b086178e561fcfc9a57dbc2c8f6a2e29
Initializes a new Player object
[ { "docid": "35bc050fc1cec8a49874062024275fb7", "score": "0.7947314", "text": "def initialize(raw_player)\n @raw_player = raw_player\n end", "title": "" } ]
[ { "docid": "17e4c4f4f815fcd223f30f02158303a0", "score": "0.8098467", "text": "def initialize_player\n\n Player.new\n\nend", "title": "" }, { "docid": "02571d1d58eae8e65b45fa954d1357d9", "score": "0.80475974", "text": "def initialize(player)\n @player = player\n end", "title": "" }, { "docid": "b3fed9a40253799786c1afc0af7f99ea", "score": "0.79386616", "text": "def initialize\n\n # initializing players\n @player1 = Player.new(\"Naruto\")\n @player2 = Player.new(\"Sasuke\")\n @players = [@player1, @player2]\n @currentplayer = @player1\n \n play\n end", "title": "" }, { "docid": "1950fe3c08256774a4d9325e2d508151", "score": "0.78512126", "text": "def initialize\n @p1 = Player.new(\"Player 1\", \"🥇P1\")\n @p2 = Player.new(\"Player 2\", \"🥈P2\")\n @current_player = @p1\n @other_player = @p2\n end", "title": "" }, { "docid": "4be9268a080a2ae165c8a3f3f49b8921", "score": "0.7849557", "text": "def initialize \n # empty method is necessary (I believe) to create instance\n # however, no ditrect creation of Player instance is created (only those of its children)\n # presumably, therefore, this method is not necessary?\n end", "title": "" }, { "docid": "7c98f13791346326ac6cc0d1aabb80ed", "score": "0.78107077", "text": "def initialize player_name\n\t\t@player = Player.new(player_name)\n\t\t@rooms = []\t\t\n\tend", "title": "" }, { "docid": "d15a8dbacff27220cfcf3755a9a539c1", "score": "0.77523077", "text": "def initialize\n @player1 = Player.new(\"Player 1\")\n @player2 = Player.new(\"Player 2\")\n @current_player = @player1\n end", "title": "" }, { "docid": "df25e4ba45a1452d85851a68c617b9bc", "score": "0.7733367", "text": "def init_player(name)\n return player = HumanPlayer.new(name)\n end", "title": "" }, { "docid": "d3c2759f01891f3940ffbeca5056e738", "score": "0.7703753", "text": "def initialize_players\n\t\tself.dealer = create_new_player 'System', User.roles[:dealer]\n\t\tself.player = create_new_player 'Player1'\n\tend", "title": "" }, { "docid": "3a14e7b5db6750a0dad44a0f1f15373b", "score": "0.76698977", "text": "def initialize(player_name)\n @player = Player.new(player_name)\n @rooms = []\n @monsters = []\n @monster_types = [\"Orc\",\"Dragon\",\"Cat\",\"Slime\"]\n end", "title": "" }, { "docid": "6ee19dd02559d6995a59992d024fbfc4", "score": "0.7633711", "text": "def initialize(player_name)\n @player = Player.new(player_name)\n @rooms = []\n @items = []\n @monsters = []\n end", "title": "" }, { "docid": "17e66d2981c5bda84002274f6bf988a6", "score": "0.7624031", "text": "def initialize(player_name)\n\t\t@player = Player.new(player_name)\n\t\t@rooms = []\n\tend", "title": "" }, { "docid": "0c598a3d8f37e9ff7e88964a579a6608", "score": "0.7595736", "text": "def initialize(player_name)\n @player = Player.new(player_name)\n @rooms = []\n end", "title": "" }, { "docid": "c2687df1237258ba254a1320a0f3d692", "score": "0.75883085", "text": "def initialize(player_name)\n @player = Player.new(player_name)\n @rooms = []\n end", "title": "" }, { "docid": "ffc99094a21b70638d07fa529a8b0d59", "score": "0.7557728", "text": "def initialize\n @p1 = Player.new('Player 1')\n @p2 = Player.new('Player 2')\n @responses = ['Wrong!', 'Not Today!', 'Back To School!']\n @current_player = @p1\n end", "title": "" }, { "docid": "ca5d2a4c72ccd552472626bc9d61ac3b", "score": "0.7549111", "text": "def initialize(x, o, current_player=0)\n p1 = Player.new('x', x)\n p2 = Player.new('o', o)\n @players = [p1, p2]\n @current_player = current_player\n end", "title": "" }, { "docid": "28f1718d1ea1493c18b5c75a19dcbf6c", "score": "0.7536706", "text": "def initialize raw_player\n @id = raw_player[0]\n @name = raw_player[1]\n @kills = 0\n @deaths = 0\n end", "title": "" }, { "docid": "a669dd8c69068031db5a8e330dab4575", "score": "0.74132335", "text": "def initialize\n # Initialize players and empty board\n @playerX = Player.new('X')\n @playerO = Player.new('O')\n @board = Board.new()\n\n # Start 'current' player with 'X'\n @current = @playerX\n end", "title": "" }, { "docid": "9e798b6c8fae84650b97a5582ee8de4c", "score": "0.74111164", "text": "def initialize(name, side) #=> creates a new player objeect \n @name = name #=> sets the name of the player\n @side = side #=> sets the side of the player can be either 1 or 2\n end", "title": "" }, { "docid": "be5dcaaaa092f24f9aa5d8c795678ca7", "score": "0.7398794", "text": "def initialize (name, age, height)\n\t\tputs \"initializing new player.\"\n\t\t@name = name\n\t\t@age = age\n\t\t@height = height\n\t#pre-set attribute\n\t\t@position = \"TBD\"\n\tend", "title": "" }, { "docid": "879c8c769548ec07d16174608d121bd8", "score": "0.73968226", "text": "def initialize\n player = Player.new\n @letters = ['a', 'b', 'c', 'd', 'e', 'f']\n end", "title": "" }, { "docid": "af981ec3cd7db229de985b3ad06b18a8", "score": "0.73611295", "text": "def initialize(name) #defining initialize method with the player's name as an argument\n\n @name = name #giving a value to name thanks to 'Player.new(name)'\n @life_points = 10 #defining 10 as the default number of player's life points\n end", "title": "" }, { "docid": "4686c138813221a81140016b1bc119ab", "score": "0.73592544", "text": "def initialize\n \t\t@player_id = \"Jim\"\n end", "title": "" }, { "docid": "850ccbe4bc8b36ef4a561696b834d33a", "score": "0.7353908", "text": "def initialize\n @board = Board.new\n @player1 = Player.new(\"joueur X\", \"x\")\n @player2 = Player.new(\"joueur O\", \"o\")\n @current_player = @player1\n end", "title": "" }, { "docid": "59cab26705b6806aff77a74893455636", "score": "0.7329665", "text": "def initialize(name_player,number)\n\t\t@name_player = name_player\n\t\t@number = number\n\t\t@@players << self\n\tend", "title": "" }, { "docid": "c92d351fe34ac0231dd1ebfc2c46a98d", "score": "0.73234254", "text": "def initialize \n puts \"Bienvenue sur le meilleur jeu Morpion du monde.\"\n @p_one = Player.new\n @p_one.infos\n @p_two = Player.new\n @p_two.infos\n @board_game = Board.new\n end", "title": "" }, { "docid": "c36bc2e2eed480797000b5840f695e57", "score": "0.7284073", "text": "def new_player\n self.player = Player.new\n end", "title": "" }, { "docid": "e486f2ab217e03d15f34d05d276384f7", "score": "0.72743034", "text": "def init_player\r\n @connection.send_data @id.with_zeros + \"_\" +\r\n @@players.map{|p|[p.id,p.sprite,p.pos.join(\".\")].join(\",\")}.join(\";\")\r\n end", "title": "" }, { "docid": "c36f69f1de7a92d388dac0f6935213f9", "score": "0.72739863", "text": "def initialize(success, error_message, player)\n super(success, error_message)\n @player = player\n end", "title": "" }, { "docid": "fa910768cb6173be8c09d1282c28f245", "score": "0.72492063", "text": "def initialize\n @game_over = false\n @players = []\n @players[0] = Player.new(\"player1\")\n @players[1] = Player.new(\"player2\")\n @turn = 0\n end", "title": "" }, { "docid": "4e3e0154e6cfcc8c936cbfcba9351809", "score": "0.7230198", "text": "def initialize(player1 = \"Player 1\", player2 = \"Player 2\")\n @player1 = player1\n @player2 = player2\n end", "title": "" }, { "docid": "cc7abaacf6e4e501cd922c27564fd912", "score": "0.7221772", "text": "def initialize\n @players = []\n #puts \"Player 1 enter your name: \"\n @players << Player.new(\"Player 1\", \"P1\")\n #puts \"Player 2 enter your name: \"\n @players << Player.new(\"Player 2\", \"P2\")\n @current_player = nil\n @winner = nil\n @game_status = PLAYING\n end", "title": "" }, { "docid": "5807dd8c5a4e4106955e1b408b3b665a", "score": "0.72158873", "text": "def initialize(players)\n\t\t@players = players\n\tend", "title": "" }, { "docid": "bb192c81249e6e1858335c74212b16dc", "score": "0.7207609", "text": "def initialize(player1, player2)\n @player1 = HumanPlayer.new(player1[0], player1[1])\n @player2 = HumanPlayer.new(player2[0], player2[1])\n @players = [@player1, @player2]\n @board = Board.new\n @current_player = select_start_player\n end", "title": "" }, { "docid": "221e249fae880f925c34440861e69ede", "score": "0.72058403", "text": "def initialize\n @player1 = Player.new('X')\n @player2 = Player.new('O')\n @board = Board.new\n end", "title": "" }, { "docid": "1946255a23214dbfd6eb5264be33fe91", "score": "0.7200821", "text": "def initialize\n @player1 = Player.new(\"Player1 Pete\")\n @player2 = Player.new(\"Player2 Andre\")\n\n @player1.opponent = @player2\n @player2.opponent = @player1\n end", "title": "" }, { "docid": "72a90ceef9ab1d311310e4989f4790a6", "score": "0.71929145", "text": "def initialize\n @player = Player.new(Player.name)\n @dealer = Dealer.new\n @deck = Deck.new\n end", "title": "" }, { "docid": "20a53ddcca36a1ebcbe67927f8333dc9", "score": "0.7191999", "text": "def initialize\n @player1 = Player.new(\"X\")\n @player2 = Player.new(\"O\")\n @board_game = Board.new\n end", "title": "" }, { "docid": "100fb5f1fc7e65e0fb1ac7efc1be37f5", "score": "0.7185047", "text": "def initialize \n @human = Player.new(\"Huma\")\n @dealer = Player.new(\"Dealer\")\n @deck = UnoDeck.new\n @discard_pile = CardCollection.new\n @active_player = nil\n end", "title": "" }, { "docid": "e42cd435d1e2532f5b4377168a84c5af", "score": "0.7175893", "text": "def initialize(player_1 = \"Player 1\", player_2 = \"Player 2\")\n\t\t@board = []\n\t\t@players = []\n\t\t@players << Player.new(player_1, \"X\")\n\t\t@players << Player.new(player_2, \"O\")\n\t\tplay\n\tend", "title": "" }, { "docid": "10d00632005890caff73698ffb929ddd", "score": "0.71721876", "text": "def initialize(name)\n\t\t@player = Player.new(name)\n\t\t@rooms = []\n\t\t@puzzles = []\n\tend", "title": "" }, { "docid": "8cf7ccea9fbd768cef156d243c041be9", "score": "0.7158661", "text": "def initialize(name)\n super(name) #fait appel au initialize de la classe Player\n @life_points = 100 #Je modifie life_points\n @weapon_level = 1 # j'ai rajouté cette ligne\n end", "title": "" }, { "docid": "a256d77943f2a7fe200c71f87fc9e851", "score": "0.71270406", "text": "def initialize(players)\n @players = players\n end", "title": "" }, { "docid": "369cf15e1e4c58cc405ca5ec02db1c27", "score": "0.71260166", "text": "def initialize\n @currentPlayer = nil\n @currentPlayerIndex = -1\n @currentMonster = nil\n @players = []\n end", "title": "" }, { "docid": "a45bf14209bb4c4d5239b38c4ac62711", "score": "0.7121459", "text": "def initialize\n @player1 = Player.new\n @player2 = Player.new\n @gameboard = Gameboard.new\n @current_player = @player1\n end", "title": "" }, { "docid": "eb8f77e0bec105af002ad108853f0007", "score": "0.7113485", "text": "def initialize(player)\n @board = Board.new(9)\n @player = player\n end", "title": "" }, { "docid": "a118ee773800fde7428dd1b8684ff7ac", "score": "0.71033907", "text": "def initialize\n\t\t@grid = Board.new\n\t\t@player_1 = Player.new\n\t\t@player_2 = Player.new\n\tend", "title": "" }, { "docid": "b901016c216c9dbd4dc5e99a277537ad", "score": "0.7088838", "text": "def initialize\n @current_player = nil\n @players = []\n @round = 0\n end", "title": "" }, { "docid": "9838250c95e5667dda977f5241f730fd", "score": "0.70840025", "text": "def initialize(player_name)\n @player = Person.new(player_name)\n @secret_number = SecretNumber.generate\n end", "title": "" }, { "docid": "3725c5e64c1bb9c370666547a6df9965", "score": "0.70790005", "text": "def initialize(name)\t\t\t\t\n\t\t@weapon_level = 1\t\t\t#variable specifique a la classe HumanPlayer\n\t\t@life_points = 100\t\t\t#valeur differente que pour les players\t\n\t\n\t\tsuper(name)\n\tend", "title": "" }, { "docid": "735f960031b1dbd8744a5fdb2f749453", "score": "0.7073617", "text": "def new\n @player = Player.new\n end", "title": "" }, { "docid": "735f960031b1dbd8744a5fdb2f749453", "score": "0.7073617", "text": "def new\n @player = Player.new\n end", "title": "" }, { "docid": "735f960031b1dbd8744a5fdb2f749453", "score": "0.7073617", "text": "def new\n @player = Player.new\n end", "title": "" }, { "docid": "735f960031b1dbd8744a5fdb2f749453", "score": "0.7073617", "text": "def new\n @player = Player.new\n end", "title": "" }, { "docid": "735f960031b1dbd8744a5fdb2f749453", "score": "0.7073617", "text": "def new\n @player = Player.new\n end", "title": "" }, { "docid": "735f960031b1dbd8744a5fdb2f749453", "score": "0.7073617", "text": "def new\n @player = Player.new\n end", "title": "" }, { "docid": "b9d5d60b442404deadf0882a58b55a4f", "score": "0.707219", "text": "def initialize\n puts \"Player 1:\"\n @player1 = Player.new\n puts \"player 2:\"\n @player2 = Player.new\n\n @player1.opponent = @player2\n @player2.opponent = @player1\n end", "title": "" }, { "docid": "a671e8a8e7c2686d67363ed467023006", "score": "0.707059", "text": "def initialize(name_player) #actions qui s'exécuteront dès lors de la création d'une nouvelle instance\n\t\t@name = name_player\n\t\t@life_point = 10 #n'est pas prit en argument dans la méthode car a une valeur fixe\n\tend", "title": "" }, { "docid": "a893acf5fc66038ce05fd44f97405d1d", "score": "0.7065296", "text": "def initialize(name_player)\n @name =name_player\n @life_points= 10\n end", "title": "" }, { "docid": "5ab828cf1d8259727a895e288e68ff0a", "score": "0.7061352", "text": "def initialize(id)\n @id = id\n @player = nil\n end", "title": "" }, { "docid": "63ba6b2d3786ca1f75ecc5daa42f225a", "score": "0.70589787", "text": "def initialize(player_1 = Players::Human.new(\"X\"), player_2 = Players::Human.new(\"O\"), board = Board.new )\n @player_1 = player_1\n @player_2 = player_2\n @board = board\n @current_player = player_1\n end", "title": "" }, { "docid": "ca113ab18e801bd9355a4ba8e5f7a462", "score": "0.70582616", "text": "def initialize(name)\n \t\t \t@name = name\n \t\t \t@players = []\n \t\tend", "title": "" }, { "docid": "fd7a0174226de548c5bc563ec19454bb", "score": "0.7056934", "text": "def initialize(players)\n\t\t\t@players = players\n\t\t\treset()\n\t\tend", "title": "" }, { "docid": "df852d20342156ac21f8166cd414e746", "score": "0.7056247", "text": "def initialize(player)\n @player = player\n @map = @@map\n @monsters = @@monsters\n end", "title": "" }, { "docid": "773f3620b54b9dcc3712ad0ef8b5cf47", "score": "0.703615", "text": "def initialize\n @p1 = Player.new\n @p2 = Player.new\n\n end", "title": "" }, { "docid": "315d855034a41b31534c266fd8cb9ddc", "score": "0.7034272", "text": "def initialize(player_1 = Players::Human.new(\"X\"), player_2 = Players::Human.new(\"O\"), board = Board.new)\n\t\t@player_1 = player_1\n player_1.player = \"Player one\" # Give the players a name to differentiate between them\n\t\t@player_2 = player_2\n player_2.player = \"Player two\" # Give the players a name to differentiate between them\n\t\t@board = board\n\tend", "title": "" }, { "docid": "e97b515cf3424a2a1f80b7d8c4945af9", "score": "0.7033805", "text": "def initialize(player)\n @player = player\n @computer = Player.new(\"Computer\",9_000_000)\n end", "title": "" }, { "docid": "230befc9e8cef54f81d9d11e90c6347e", "score": "0.7031758", "text": "def initialize\n @board = Board.new\n\n player_1_symbol = ask_first_players_symbol\n player_2_symbol = player_1_symbol == :x ? :o : :x\n \n @players = [\n Player.new(player_1_symbol, @board),\n Player.new(player_2_symbol, @board)\n ]\n\n @current_player = @players[0]\n end", "title": "" }, { "docid": "cdac07bc6e6c018d557c29f20dcd8008", "score": "0.7028822", "text": "def initialize\n @player1 = Player.new\n @player2 = Player.new\n @question = Question.new\n #byebug\n end", "title": "" }, { "docid": "191e054008223fe54cb304de5e608673", "score": "0.7027596", "text": "def initialize(num_players)\r\n\t@num_players = num_players\r\n end", "title": "" }, { "docid": "6678f14d01d6b5ead4d1a4fc87978671", "score": "0.7003571", "text": "def initialize(name_player)\n \t@name = name_player\n \t@life_points = life_points\n \t# Initializing life points to 10\n \t@life_points = 10\n\tend", "title": "" }, { "docid": "c2289dc8ded2d40dcfb04e78067546e0", "score": "0.7001011", "text": "def initialize\n player_options = Config.instance.options['player']\n @player = player_options['player']\n\n if @player == 'omxplayer'\n @player_options = player_options['omxplayer']\n else\n @player_options = player_options['vlc']\n end\n end", "title": "" }, { "docid": "36564f69da5d2152bbbfe323adfbcaac", "score": "0.6999296", "text": "def initialize(name)\n\t\t@name = name\n\t\t@players = []\n\tend", "title": "" }, { "docid": "0245721024abb28733676c68984f219e", "score": "0.6990344", "text": "def initialize(name_of_player)\n @weapon_level = 1\n @name = name_of_player\n @life_points = 100\n end", "title": "" }, { "docid": "b1f1ac77912a0fa52db564ab392efd9b", "score": "0.69820225", "text": "def initialize(title)\r\n @title = title\r\n @players = []\r\n end", "title": "" }, { "docid": "a3c09a17dc1e9b11f2fb9877c85d8649", "score": "0.6975435", "text": "def initialize(name)\n @players_left = 10\n @enemies_in_sight = []\n @human_player = HumanPlayer.new(name)\n end", "title": "" }, { "docid": "33097dfc16c28dca4ac2c4ee70f85f62", "score": "0.69656056", "text": "def initialize(player_name)\n @name = player_name\n @life_points = 10\n end", "title": "" }, { "docid": "b3e57948d4ee5977f94f679f23128440", "score": "0.69515204", "text": "def initialize(opts={})\n @player = opts[:player]\n @context = opts[:context]\n end", "title": "" }, { "docid": "9daae72ddc9ae474f53df47f5052bb96", "score": "0.6943644", "text": "def initialize\n\t\tputs \"Entrez le nom du premier joueur\"\n\t\t@player1 = Player.new(gets.chomp)\n\t\tputs \"Entrez le nom du premier joueur\"\n\t\t@player2 = Player.new(gets.chomp)\n\tend", "title": "" }, { "docid": "d08ef0c9e530bd04004a5903b832211c", "score": "0.69412726", "text": "def initialize(p1 = nil, p2 = nil, board = nil)\n @player_1 = Players::Human.new(\"X\") unless @player_1 = p1\n @player_2 = Players::Human.new(\"O\") unless @player_2 = p2\n @board = Board.new unless @board = board\n end", "title": "" }, { "docid": "e933a004b3710ec549a909beed014c7a", "score": "0.6929974", "text": "def initialize\n black = \"\\u26AB\"\n white = \"\\u26AA\"\n @player1 = Player.new(\"Player 1\", black)\n @player2 = Player.new(\"Player 2\", white)\n @current_player = player1\n @board = Board.new\n end", "title": "" }, { "docid": "293dee6397fe9b50944f3b97602deb20", "score": "0.6926668", "text": "def initialize(player)\n @player = player\n @rooms = {}\n end", "title": "" }, { "docid": "8faf3632c8b61f46b5cec1eda683ba22", "score": "0.69222695", "text": "def initialize(player1_name = 'Player 1', player2_name = 'Player 2')\n @player1 = Player.new(player1_name, Player::DEFAULT_TOKENS[0])\n @player2 = Player.new(player2_name, Player::DEFAULT_TOKENS[1])\n @game_board = GameBoard.new(@player1, @player2)\n end", "title": "" }, { "docid": "65ac90484e228904ae84097384787dc8", "score": "0.6916248", "text": "def initialize(name) # Initialise un nouveau player avec 10 points de vie\n\t\t@name = name\n\t\t@live_points = 10\n\tend", "title": "" }, { "docid": "79756142b41624585f2341d6c2f2c1ff", "score": "0.69157165", "text": "def initialize (humanplayer)\n @humanplayer = HumanPlayer.new(\"#{humanplayer}\",100,1)\n @player_1 = Player.new(\"Niama Guerrier de Feu\", 10)\n @player_2 = Player.new(\"Niama Archer de Glace\", 10)\n @player_3 = Player.new(\"Niama Maître de la Terre\", 10)\n @player_4 = Player.new(\"Niama Moche et Méchant\", 10)\n @ennemies = [@player_1, @player_2, @player_3, @player_4]\n end", "title": "" }, { "docid": "ed6c846ef279221370548193808de430", "score": "0.6914295", "text": "def initialize\n @@player_count += 1\n @name = \"Player #{@@player_count}\"\n @total_score = 0\n end", "title": "" }, { "docid": "54787cc05b64b0ce0e751922ab2970df", "score": "0.6911709", "text": "def initialize(name, symbol)\r\n @player_name = name\r\n @player_symbol = symbol\r\n end", "title": "" }, { "docid": "5ee702cd5c13a9556b4092b0ab1db9c2", "score": "0.6898704", "text": "def initialize(title)\n @title = title.capitalize\n @players = []\n end", "title": "" }, { "docid": "2e59f8baef4b03c51603a1c0208e3db2", "score": "0.6892911", "text": "def initialize(player1 = Player.new('Player 1', Player::DEFAULT_TOKENS[0]),\n player2 = Player.new('Player 2', Player::DEFAULT_TOKENS[1]))\n raise StandardError, 'Each players token must be unique.' if player1.token == player2.token\n\n @players = [player1, player2]\n raise StandardError, 'Parameters must be player objects.' unless @players.all? { |arg| arg.is_a? Player }\n\n @current_player_index = 0\n # Board where spaces are accessed by board[column][row] with\n # column 0 being the furthest left and row 0 being the bottom.\n @board = Array.new(7) { Array.new(6) { 'O' } }\n @available_slots = 42\n end", "title": "" }, { "docid": "0c1cde63d925c6a7e559c70bf46fc148", "score": "0.68797225", "text": "def initialize(cash, debt, bank_balance, health, storage_item, inventory, has_gun)\r\n Player.cash = cash\r\n Player.debt = debt\r\n Player.bank_balance = bank_balance\r\n Player.health = 100\r\n Player.storage_item = storage_item\r\n Player.inventory = inventory\r\n Player.has_gun = has_gun\r\n end", "title": "" }, { "docid": "4e9823b58434fe20bf3e2e629e6effae", "score": "0.6873679", "text": "def new\n @player = Player.new\n\n end", "title": "" }, { "docid": "18770c31911ef10f34d2fbde25934794", "score": "0.6868407", "text": "def initialize(id, name, password)\n @id_player,@name_player,@password_player = id, name, password\n end", "title": "" }, { "docid": "e52991e817b828795385494b30c4fc90", "score": "0.6865743", "text": "def initialize(player_1 = Players::Human.new('X'), player_2 = Players::Human.new('O'), board = Board.new)\n @player_1 = player_1\n @player_2 = player_2\n @board = board\n end", "title": "" }, { "docid": "3d05be119cfac0eeb0523028f5193d8f", "score": "0.6860674", "text": "def initialize_player(name)\n {\n name: name.to_s,\n hand: [],\n total: 0,\n wins: 0,\n busted: false\n }\nend", "title": "" }, { "docid": "874c581cad1d0e09154bbe22eceb44f2", "score": "0.6860177", "text": "def initialize(player_1 = Players::Human.new(\"X\"), player_2 = Players::Human.new(\"O\"), board = Board.new)\n @player_1 = player_1\n @player_2 = player_2\n @board = board\n end", "title": "" }, { "docid": "1ff2185d50f21ab6ea0dab86c9d2951f", "score": "0.68583745", "text": "def initialize(player)\n\t\t@guesses = 3\n\t\t@low_range = 1\n\t\t@high_range = 10\n\t\t@secret_number = Secret_Number.new(@low_range,@high_range).get_secret_number\n\t\t@user_name = player.get_user_name\n\t\t@session_number = 1\n\t\t@number_of_wins = 0\n\tend", "title": "" }, { "docid": "5de825c7298e7b862b34c89f0a427fae", "score": "0.68539447", "text": "def initialize\n @players = []\n end", "title": "" }, { "docid": "5de825c7298e7b862b34c89f0a427fae", "score": "0.68539447", "text": "def initialize\n @players = []\n end", "title": "" }, { "docid": "71d19ff7a2fb7290586a521ac5542cf6", "score": "0.68533516", "text": "def initialize(player_ex, player_oh, game_size=4)\r\n @game_size = game_size\r\n #Set up player related data.\r\n @players = { 1 => player_ex, 2 => player_oh }\r\n end", "title": "" }, { "docid": "b5b9b873d0ba80a89920ed1312f8c96e", "score": "0.68390673", "text": "def initialize(player_1 = Players::Human.new(\"X\"), player_2 = Players::Human.new(\"O\"), board = Board.new)\n self.board = board\n self.player_1 = player_1\n self.player_2 = player_2\n end", "title": "" } ]
1d2ff55ef2f524f0507a5ad8c2642ac9
create Creates a new campaign with the provided properties. See how to launch your first campaign [here](
[ { "docid": "56502c2acf70d6e133a60c0c7762bd7d", "score": "0.0", "text": "def campaign_create_with_http_info(campaign_writable, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CampaignsApi.campaign_create ...'\n end\n # verify the required parameter 'campaign_writable' is set\n if @api_client.config.client_side_validation && campaign_writable.nil?\n fail ArgumentError, \"Missing the required parameter 'campaign_writable' when calling CampaignsApi.campaign_create\"\n end\n allowable_values = [\"native\", \"match\"]\n if @api_client.config.client_side_validation && opts[:'x_lang_output'] && !allowable_values.include?(opts[:'x_lang_output'])\n fail ArgumentError, \"invalid value for \\\"x_lang_output\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/campaigns'\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 content_type = @api_client.select_header_content_type(['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'x-lang-output'] = opts[:'x_lang_output'] if !opts[:'x_lang_output'].nil?\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(campaign_writable)\n\n # return_type\n return_type = opts[:debug_return_type] || 'Campaign'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['basicAuth']\n\n new_options = opts.merge(\n :operation => :\"CampaignsApi.campaign_create\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CampaignsApi#campaign_create\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" } ]
[ { "docid": "c967dbd8eb84deee8e9cc03791164d28", "score": "0.7783037", "text": "def create(params)\n post(\"#{domain}/campaigns\", params)\n end", "title": "" }, { "docid": "e8d9e4905554853dbf11d13cb7b9eaf4", "score": "0.7717297", "text": "def create\n return nil if created?\n request :create_campaign_on_bidstalk do\n client = Bidstalk::Campaign::Client.new\n client.create to_platform_campaign!\n end\n end", "title": "" }, { "docid": "6073812a5c90c32783674797b281de55", "score": "0.7453713", "text": "def create(data)\n\n client = Client.new({\n 'method': Client::METHOD_POST,\n 'url': Base.config.api_url('campaigns'),\n 'params_post': __prepare_body(data)\n })\n client.request\n end", "title": "" }, { "docid": "9a8346a380aa1d46c7ce9defbf945b74", "score": "0.7288724", "text": "def create\n # Protect from non-admin access\n admin_only do\n begin\n # create campaign object from parameters given\n\n @campaign = Campaign.new(campaign_params)\n @campaign.environment = @campaign.environment.downcase\n if @campaign[:realm] == nil || @campaign[:realm] == \"\"\n raise \"Campaign needs Realm\"\n end\n\n # save object to database\n @campaign.save\n\n log_action('Create', current_user ? current_user.username : 'Anonymous', @campaign.id, 'Campaign')\n\n # send the user a successful flash message\n flash[:success] = \"Campaign created successfully!\"\n\n # send user to the newly create campaigns show page\n redirect_to @campaign\n rescue => e\n flash[:danger] = \"Campaign could not created - #{e.message}\"\n redirect_to action: \"index\"\n end\n end\n end", "title": "" }, { "docid": "ba6f8ad98e42114d93012fd9647c160d", "score": "0.72681516", "text": "def create_campaign(options = {}, content = {}, campaign_type = 'regular', segment_options = {}, type_opts = {})\n call(\"campaignCreate\", campaign_type, options, content, segment_options, type_opts)\n # TODO: Should we return the new campaign instead of the ID returned from the API?\n end", "title": "" }, { "docid": "c7337310a8a8f77966638865d43db541", "score": "0.72200274", "text": "def create(campaign, opts = {})\n opts = {name: campaign}.merge(opts)\n Mailgun.submit :post, campaign_url, opts\n end", "title": "" }, { "docid": "273feb46e6f14c8b190d4459a4f929fc", "score": "0.7209946", "text": "def create_campaign(client, customer_id, merchant_center_id, campaign_budget_id)\n operation = client.operation.create_resource.campaign do |c|\n c.name = \"Shopping campaign ##{(Time.new.to_f * 1000).to_i}\"\n\n # Dynamic remarketing campaigns are only available on the Google Display\n # Network.\n c.advertising_channel_type = :DISPLAY\n c.status = :PAUSED\n c.campaign_budget = client.path.campaign_budget(customer_id,\n campaign_budget_id)\n c.manual_cpc = client.resource.manual_cpc\n\n # The settings for the shopping campaign.\n # This connects the campaign to the merchant center account.\n c.shopping_setting = client.resource.shopping_setting do |ss|\n ss.campaign_priority = 0\n ss.merchant_id = merchant_center_id.to_i\n\n # Display Network campaigns do not support partition by country. The only\n # supported value is \"ZZ\". This signals that products from all countries\n # are available in the campaign. The actual products which serve are based\n # on the products tagged in the user list entry.\n ss.sales_country = \"ZZ\"\n ss.enable_local = true\n end\n end\n\n response = client.service.campaign.mutate_campaigns(\n customer_id: customer_id,\n operations: [operation]\n )\n\n puts \"Created campaign: #{response.results.first.resource_name}\"\n response.results.first.resource_name\nend", "title": "" }, { "docid": "931fe9ba2924ce748328a5f29bab7577", "score": "0.7041676", "text": "def create(campaign)\n response = HTTParty.post(\"#{config[:host]}/campaigns\",\n headers: headers,\n body: campaign_params(campaign).to_json)\n campaign.update ad_service_id: response['_id']\n campaign.organization.update ad_service_id: response['client'] unless campaign.organization.ad_service_id.present?\n end", "title": "" }, { "docid": "3f376d95c5931a8e8eacde65d45d31d9", "score": "0.70405495", "text": "def create(domain = Mailgun.domain, campaign_id, name)\n params = {:campaign_id => campaign_id, :name => name}\n Mailgun.submit :post, campaign_url(domain), params\n end", "title": "" }, { "docid": "cd26704601b5e2d02d14b1081e0627b5", "score": "0.7037223", "text": "def create\n @campaign = current_user.campaigns.build(campaign_params) do |t|\n \n end\n\n respond_to do |format|\n if @campaign.save\n format.html { redirect_to @campaign, notice: 'Campaign was successfully created.' }\n format.json { render json: { message: 'New Campaign successfully saved.'}, status: :created }\n else\n format.html { render :new }\n format.json { render json: @campaign.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ee79ac4be4775d5d57b87fd93c5d05fc", "score": "0.70041513", "text": "def create_campaign(data, opts = {})\n data, _status_code, _headers = create_campaign_with_http_info(data, opts)\n return data\n end", "title": "" }, { "docid": "bebb9f2e6f6f856f26730d8441caaa2d", "score": "0.6972667", "text": "def create_campaign(name, notes = nil, active = nil, assigned_blasts_per_day = nil, default_target_keyword_value = nil, visit_value = nil)\n if name.nil?\n raise LinkemperorCustomerException.new('name should not be empty')\n end\n parameters = {'campaign' => {'name' => name, 'notes' => notes, 'active' => active, 'assigned_blasts_per_day' => assigned_blasts_per_day, 'default_target_keyword_value' => default_target_keyword_value, 'visit_value' => visit_value}}\n exec_post(parameters, 'post', \"#{@base_path}/api/v2/customers/campaigns.json?api_key=#{@api_key}\")\n end", "title": "" }, { "docid": "9e663004c07eeaf3220aa24d9f02cc74", "score": "0.69721824", "text": "def create\n @campaign = Campaign.new(campaign_params)\n\n respond_to do |format|\n if @campaign.save\n format.html { redirect_to @campaign, notice: 'Campaign was successfully created.' }\n format.json { render :show, status: :created, location: @campaign }\n else\n format.html { render :new }\n format.json { render json: @campaign.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9e663004c07eeaf3220aa24d9f02cc74", "score": "0.69721824", "text": "def create\n @campaign = Campaign.new(campaign_params)\n\n respond_to do |format|\n if @campaign.save\n format.html { redirect_to @campaign, notice: 'Campaign was successfully created.' }\n format.json { render :show, status: :created, location: @campaign }\n else\n format.html { render :new }\n format.json { render json: @campaign.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6e4d741c1d65acd7d95fe4e11985c801", "score": "0.695369", "text": "def create_campaign(digest, content = nil)\n digest.update mc_segment_id: create_segment(digest)[:id]\n\n resp = detect_error post('/campaigns',\n body: CampaignSerializer.new(digest).to_json)\n if content.present?\n put_campaign_content(resp.parsed_response['id'], content)\n end\n resp.parsed_response.deep_symbolize_keys\n end", "title": "" }, { "docid": "552dc1a0f22f4aa4fd0f2ca717f51cc9", "score": "0.69336957", "text": "def create\n\t\t@campaign = Campaign.new(params[:campaign])\n\t\t@campaign.account_id = @auth_user.account_id\n\n\t\trespond_to do |format|\n\t\t\tif @campaign.save\n\t\t\t\tformat.html { redirect_to(@campaign, :notice => 'Campaign was successfully created.') }\n\t\t\t\tformat.xml { render :xml => @campaign, :status => :created, :location => @campaign }\n\t\t\telse\n\t\t\t\tformat.html { render :action => \"new\" }\n\t\t\t\tformat.xml { render :xml => @campaign.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "bf19c641238a1e885e8620bb476923e3", "score": "0.69302154", "text": "def create\n campaign = Campaign.create(campaign_params)\n render json: campaign\n end", "title": "" }, { "docid": "ffd2752f88bd38b28506a5314a9e8f10", "score": "0.6922015", "text": "def create_campaign params = {}\n options = {\n :list_id => @list_id,\n :folder_id => params[:folder_id],\n :from_email => Hominid::Loader.config[:from_email],\n :to_email => Hominid::Loader.config[:to_email],\n :from_name => params[:from_name],\n :subject => params[:subject],\n :template_id => Hominid::Loader.config[:template_id]\n }\n content = {\n :html_content => params[:content]\n }\n base.create_campaign(options, content)\n end", "title": "" }, { "docid": "05a23928ea08a614a8c2975b2e592317", "score": "0.69034916", "text": "def create\n @campaign = Campaign.new(campaign_params)\n @campaign.owner = current_user\n\n respond_to do |format|\n if @campaign.save\n format.html do\n flash[:notice] = Stripstarter::Response::CAMPAIGN_CREATE_SUCCESS\n redirect_to @campaign\n end\n format.json { render nothing: true, status: 200 }\n else\n format.html { render :new }\n format.json { render json: @campaign.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "16dcd77afb4b60d10969a21441e481cb", "score": "0.6901092", "text": "def Create\n required_params=%w{CampaignName CampaignSubject FromName FromEmail ReplyTo HtmlUrl TextUrl}\n required_params.each do |f|\n raise MissingParameter, \"'#{f}' is required to call Create\" unless self[f]\n end\n response = cm_client.using_soap do |driver|\n opts=attributes.merge(:ApiKey => cm_client.api_key, :SubscriberListIDs => @lists.map {|x| x.id})\n driver.createCampaign opts\n end\n @result=Result.new(response[\"Campaign.CreateResult\"])\n self.id=@result.content if @result.success?\n @result.success?\n end", "title": "" }, { "docid": "c94c683e15be27d4d8e4b4eab71219af", "score": "0.68964523", "text": "def create\n options = params[:campaign]\n @campaign = Campaign.new\n\n respond_to do |format|\n if @campaign.add_attr(options)\n format.html { redirect_to(@campaign, :notice => 'Campaign was successfully created.') }\n format.xml { render :xml => @campaign, :status => :created, :location => @campaign }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @campaign.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "26671fbe587dc35830694df4e392fa1f", "score": "0.68877053", "text": "def create\n campaign_id = params[:campaign_id]\n campaign = Campaign.find_by_id(campaign_id)\n if (campaign!=nil)\n retDetails = {\"campaign_id\"=> campaign.id, \"campaign_name\"=> campaign.name, \"campaign_description\"=> campaign.description, \"campaign_goal\"=> campaign.goal_cents/100, \"campaign_progress\"=> campaign.amount_donated_cents/100}\n render json: retDetails\n else\n render json: campaign_does_not_exist_error, :status => 404\n end\n end", "title": "" }, { "docid": "ab428631b466002dffb9057529fc143b", "score": "0.68723", "text": "def create\n @campaign = Campaign.new(campaign_params)\n\n respond_to do |format|\n if @campaign.save\n format.html { redirect_to @campaign, notice: 'Campaign was successfully created.' }\n else\n format.html { render :new }\n end\n end\n end", "title": "" }, { "docid": "484a7f25b2fa4977b46bb9c82adf9f74", "score": "0.6859907", "text": "def create\n @campaign = Campaign.new(params[:campaign])\n\n respond_to do |format|\n if @campaign.save\n format.html { redirect_to @campaign, notice: 'Campaign was successfully created.' }\n format.json { render json: @campaign, status: :created, location: @campaign }\n else\n format.html { render action: \"new\" }\n format.json { render json: @campaign.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "484a7f25b2fa4977b46bb9c82adf9f74", "score": "0.6859907", "text": "def create\n @campaign = Campaign.new(params[:campaign])\n\n respond_to do |format|\n if @campaign.save\n format.html { redirect_to @campaign, notice: 'Campaign was successfully created.' }\n format.json { render json: @campaign, status: :created, location: @campaign }\n else\n format.html { render action: \"new\" }\n format.json { render json: @campaign.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "85e0d3ca6ca7b355c05ac98ffa759719", "score": "0.68572", "text": "def create(type, options, content, segment_opts=nil, type_opts=nil)\n _params = {:type => type, :options => options, :content => content, :segment_opts => segment_opts, :type_opts => type_opts}\n return @master.call 'campaigns/create', _params\n end", "title": "" }, { "docid": "25beddc89bbf9acc7c56ff4b1b3d623f", "score": "0.6856062", "text": "def create\n @campaign = Campaign.new(campaign_params)\n\n respond_to do |format|\n if @campaign.save\n format.html { redirect_to @campaign, notice: '' }\n format.json { render :show, status: :created, location: @campaign }\n else\n format.html { render :new }\n format.json { render json: @campaign.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f4d7a619cabb462e2cafce4b2ebc607a", "score": "0.68532056", "text": "def create_regular_campaign(args)\n create_campaign_request = {\n type: \"regular\",\n recipients: {\n list_id: args[:list_id],\n },\n settings: {\n subject_line: args[:subject_line],\n title: args[:title],\n from_name: @from_name,\n reply_to: @reply_to,\n }\n }\n template = {\n template: {\n id: get_template_id_from_name(args[:template]),\n sections: {\n \"title\": args[:title],\n \"content\": args[:message],\n \"image_lnk\": \"<img alt=\\\"\\\" src=\\\"#{args[:featured_image_link]}\\\" class=\\\"mcnImage\\\" style=\\\"max-width:427px; padding-bottom: 0; display: inline !important; vertical-align: bottom;\\\" align=\\\"middle\\\" width=\\\"427\\\"/>\",\n \"link_to_article\": \"<a class=\\\"mcnButton\\\" title=\\\"Send me to the article\\\" href=\\\"#{args[:link]}\\\" target=\\\"_self\\\" style=\\\"font-weight:bold;letter-spacing:-.5px;line-height:100%;text-align:center;text-decoration:none;color:#FFFFFF;\\\">Send me to the article</a>\"\n }\n }\n }\n @campaign = @gibbon.campaigns.create(body: create_campaign_request)\n @gibbon.campaigns(@campaign.body['id']).content.upsert(body: template)\n end", "title": "" }, { "docid": "68621f8f47fed39f2df500324f3c22b7", "score": "0.6852725", "text": "def create\n @campaign = Campaign.new(params[:campaign])\n\n respond_to do |format|\n if @campaign.save\n format.html { redirect_to campaigns_path, notice: 'Campaign was successfully created.' }\n format.json { render json: @campaign, status: :created, location: @campaign }\n else\n format.html { render action: \"new\" }\n format.json { render json: @campaign.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a529fbee33d5d9800c7e559c6fef3ff9", "score": "0.683568", "text": "def create\n @campaign = Campaign.new(campaign_params)\n # Add the current logged in user as the creator of the campaign\n @campaign.user = current_user\n\n if @campaign.save\n render json: @campaign, status: :created\n else\n render json: @campaign.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "78f4078936d174feace8d11d78aa1dcd", "score": "0.68308306", "text": "def create\n @campaign = current_user.campaigns.build(campaign_params)\n\n if @campaign.save\n flash[:success] = \"Your campaign has been created.\"\n redirect_to @campaign\n else\n render 'campaigns/new'\n end\n end", "title": "" }, { "docid": "2c11254e9dfb29cb999513f526037f76", "score": "0.68282455", "text": "def create\n @campaign = Campaign.new(campaign_params)\n @campaign.save\n respond_to do |format|\n if @campaign.save\n # format.html { redirect_to @campaign, notice: 'Campaign was successfully created.' }\n format.json { render json: @campaign}\n end\n end\n end", "title": "" }, { "docid": "6a45557e19ed284e7466339be067f1e8", "score": "0.68250906", "text": "def create\n oid = BSON::ObjectId.from_string(campaign_params[:user])\n @user = User.find(oid)\n\n username = create_username(@user.name)\n new_params = campaign_params\n new_params[:username] = username\n new_params[:school_start_date] = DateTime.strptime(new_params[:school_start_date], \"%m/%d/%Y\")\n new_params[:school] = School.find(new_params[:school])\n\n @campaign = Campaign.new(new_params)\n @campaign.user = @user\n\n respond_to do |format|\n if @campaign.save\n @user.update_attributes(:campaign_status => \"pending\")\n AdminNotifier.send_pending_campaign_email(@campaign).deliver\n format.json { render :show, status: :created, location: @campaign }\n else\n format.json { render json: @campaign.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9e221a89baedca829434e4e77fb4ce1d", "score": "0.68018824", "text": "def create\n @campaign = @organization.campaigns.new(campaign_params)\n\n respond_to do |format|\n if campaign_params.present? && @campaign.save\n format.html { redirect_to organization_campaign_url(@organization, @campaign), notice: 'Campaign was successfully created.' }\n format.json { render :show, status: :created, location: organization_campaign_url(@organization, @campaign) }\n else\n format.html { render :new }\n format.json { render json: @campaign.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fc9db8c7427f6432569e038706c95f33", "score": "0.6794625", "text": "def new\n\t\t@campaign = Campaign.new()\n\tend", "title": "" }, { "docid": "d132a42213a925dfcdd179640f3820ac", "score": "0.6781935", "text": "def create\n fix_flights_input_param\n @campaign = @org.campaigns.build(campaign_params)\n\n respond_to do |format|\n if @campaign.save\n format.html { redirect_to [@campaign.org, @campaign], notice: 'Campaign was successfully created.' }\n format.json { render :show, status: :created, location: [@campaign.org, @campaign] }\n else\n format.html { render :new }\n format.json { render json: @campaign.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "321dc3f26e375a3379d0d8f3115e123c", "score": "0.67683065", "text": "def create\n @campaign = Campaign.new(campaign_params)\n\n respond_to do |format|\n if @campaign.save\n format.html { redirect_to project_campaign_path(@project,@campaign), notice: 'Campaign was successfully created.' }\n format.json { render action: 'show', status: :created, location: project_campaign_path(@project,@campaign) }\n else\n format.html { render action: 'new' }\n format.json { render json: @campaign.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9e5c8a0107b3333fd532e83ca7101a1d", "score": "0.67184687", "text": "def create\n @campaign = current_user.campaigns.build(campaign_params)\n\n respond_to do |format|\n if @campaign.save\n format.html { redirect_to root_path, notice: \"Campaign was successfully created.\" }\n format.json { render :show, status: :created, location: @campaign }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @campaign.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6b55e4c7e9c324eca078dee283a9960e", "score": "0.67137706", "text": "def create\n owner = Owner.first\n @campaign = owner.campaigns.build(campaign_params)\n\n respond_to do |format|\n if @campaign.save\n format.html { redirect_to @campaign, notice: 'Campaign was successfully created.' }\n format.json { render :show, status: :created, location: @campaign }\n else\n format.html { render :new }\n format.json { render json: @campaign.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "069a78468d8755043d6d2b9aac010bb9", "score": "0.66850716", "text": "def create\n @email_campaign = EmailCampaign.new(email_campaign_params)\n\n respond_to do |format|\n if @email_campaign.save\n format.html { redirect_to @email_campaign, notice: 'Email campaign was successfully created.' }\n format.json { render :show, status: :created, location: @email_campaign }\n else\n format.html { render :new }\n format.json { render json: @email_campaign.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "56f40d0ec13a82c57be6d5795b9b81c2", "score": "0.66755635", "text": "def create\n @campaign = Campaign.new(campaign_params)\n @campaign.user = current_user\n\n respond_to do |format|\n if create_new_campaign\n format.html { redirect_to new_campaign_player_path( @campaign ), notice: t( '.success' ) }\n else\n format.html { render :new, error: t( '.failure' ) }\n end\n end\n\n end", "title": "" }, { "docid": "57102d9a838703962724649d3f92ff6f", "score": "0.6675418", "text": "def create\n @campaign = Campaign.new(campaign_params)\n @campaign.user_id = current_user.id\n\n respond_to do |format|\n if @campaign.save\n format.html { redirect_to @campaign, notice: 'Campaign was successfully created.' }\n format.json { render :show, status: :created, location: @campaign }\n else\n format.html { render :new }\n format.json { render json: @campaign.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "70aef9f3e5ffbb20d86a5072da8d8b95", "score": "0.6660631", "text": "def create_campaign(advertiser_id, auth_token)\n # Get the campaign service.\n campaign_service = Savon.client(\n :wsdl => DfaUtils.generate_wsdl_url('campaign'),\n # Set the WSSE authentication header.\n :wsse_auth => [DfaUtils.get_dfa_username(), auth_token])\n\n # Create a landing page\n landing_page_id = create_landing_page(campaign_service)\n\n # Create campaign structure.\n campaign = {\n :id => 0,\n :name => 'Campaign #%d' % (Time.new.to_f * 1000).to_i,\n :advertiser_id => advertiser_id,\n :start_date => Date.today.strftime('%FT%T'),\n :end_date => (Date.today >> 1).strftime('%FT%T'),\n :default_landing_page_id => landing_page_id,\n :landing_page_ids => {:landing_page_ids => landing_page_id}\n }\n\n # Save the campaign.\n response = campaign_service.call(\n :save_campaign,\n :message => {:campaign => campaign},\n :soap_header => DfaUtils.generate_request_header())\n\n response = response.to_hash[:multi_ref]\n\n # Display the ID of the newly created campaign.\n puts 'Campaign with ID %d was created.' % response[:id]\nend", "title": "" }, { "docid": "811aeb7b3460a3db3b7f4a1170e448b1", "score": "0.66585124", "text": "def create_local\n uuid = @data.dig(:id)\n\n log_event \"[I] Creating local campaign #{uuid}\"\n\n @entity = Campaign.new(uuid: uuid)\n\n apply_for_update\n\n @entity.save\n @entity\n end", "title": "" }, { "docid": "c3dd6400d68be5b8a68f906f5f292bc4", "score": "0.6644488", "text": "def create\n @campaign = Campaign.new(params[:campaign])\n\n respond_to do |format|\n if @campaign.save\n format.html { redirect_to admin_campaign_path(@campaign), notice: 'Campaign was successfully created.' }\n format.json { render json: @campaign, status: :created, location: @campaign }\n else\n format.html { render action: \"new\" }\n format.json { render json: @campaign.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "afee6a7feb9c0e2823064b08256ec329", "score": "0.66422987", "text": "def create\n @campaign = Campaign.new(campaign_params)\n @campaign.advertiser_id = @advertiser.id\n\n respond_to do |format|\n if @campaign.save\n format.html { redirect_to @campaign, notice: 'Campaign was successfully created.' }\n format.json { render :show, status: :created, location: @campaign }\n else\n format.html { render :new }\n format.json { render json: @campaign.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "69fc684d20d5df4197e6f580adc8245b", "score": "0.6635541", "text": "def create\n @mail_campaign = MailCampaign.new(mail_campaign_params)\n\n respond_to do |format|\n if @mail_campaign.save\n format.html { redirect_to @mail_campaign, notice: 'Mail campaign was successfully created.' }\n format.json { render :show, status: :created, location: @mail_campaign }\n else\n format.html { render :new }\n format.json { render json: @mail_campaign.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7e2430690d8b3934eb8e00f05ac74cbb", "score": "0.6628429", "text": "def create_campaign\n if [:web_email, :web_email_sms].include?(self.post_type)\n campaign_id = Resque.pop(EMAIL_TRACKING_CODE)\n if campaign_id\n campaign_info = CampaignInfo.find(campaign_id)\n campaign_info.update_attributes(:topic_id => self.id, :published => true) rescue false\n else\n analytics_api = ANALYTICS_CLASS.constantize.new\n Rails.logger.error \"Sending request to Litmus for topic_id : #{self.id}\"\n html, campaign_id = analytics_api.create_campaign(\"topic_#{self.id}\")\n Rails.logger.error \"Got response from Litmus for topic_id : #{self.id} and campaign_id as #{campaign_id}\"\n CampaignInfo.create(:tracking_code => html, :campaign_id => campaign_id, :topic_id => self.id, :published => true) if html\n end\n end\n end", "title": "" }, { "docid": "ad4022ec5aacbb78315c0b57eda520e3", "score": "0.6618249", "text": "def create\n @campaign = Campaign.new(params[:campaign])\n\n respond_to do |format|\n if @campaign.save\n flash[:notice] = 'Campaign was successfully created.'\n format.html { redirect_to(@campaign) }\n format.xml { render :xml => @campaign, :status => :created, :location => @campaign }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @campaign.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d818691c3e92ea1c85333ae3a43df7e2", "score": "0.66104585", "text": "def create\n @campaign = current_user.campaigns.new(params[:campaign])\n\n respond_to do |format|\n if @campaign.save\n format.html { redirect_to user_campaign_url(@campaign), notice: 'campaign was successfully created.' }\n format.json { render json: @campaign, status: :created, location: @campaign }\n else\n format.html { render action: \"new\" }\n format.json { render json: @campaign.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3d1ee6d76a5fc97d087d1600d12943e0", "score": "0.66055936", "text": "def new\n @campaign = Campaign.new\n end", "title": "" }, { "docid": "ec3a11ac003bd225660bcbb89ec0ce67", "score": "0.65932065", "text": "def create\n @affiliate_campaign = Affiliate::Campaign.new(params[:affiliate_campaign])\n\n respond_to do |format|\n if @affiliate_campaign.save\n format.html { redirect_to @affiliate_campaign, notice: 'Campaign was successfully created.' }\n format.json { render json: @affiliate_campaign, status: :created, location: @affiliate_campaign }\n else\n format.html { render action: \"new\" }\n format.json { render json: @affiliate_campaign.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8ebf04f4d0c079244416ba67ef0b9e4d", "score": "0.658943", "text": "def create\n #@campaign = Campaign.new(campaign_params)\n @campaign = @user.campaigns.build(campaign_params)\n @enlistment = @campaign.build_enlistment(params[:campaign_id])\n @training_sheet = @campaign.build_training_sheet(params[:campaign_id])\n @gift_profile = @campaign.build_gift_profile(params[:campaign_id])\n\n respond_to do |format|\n if @campaign.save\n #format.html { redirect_to @campaign, notice: 'Campaign was successfully created.' }\n format.html { redirect_to user_campaign_path(@user, @campaign), notice: 'Campaign was successfully created.' }\n format.json { render action: 'show', status: :created, location: @campaign }\n else\n format.html { render action: 'new' }\n format.json { render json: @campaign.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5fd904b41bcddc533e259fd8b8b0350d", "score": "0.6553729", "text": "def create\n @campaign = Campaign.new(campaign_params)\n\n respond_to do |format|\n action_message_for('new')\n if create_campaign\n format.html { redirect_to redirect_target(@campaign), flash: @feedback_flash }\n format.json { render :show, status: :created, location: @campaign }\n else\n 1.times { @campaign.benefits.new } if @campaign.benefits.size == 0\n 1.times { @campaign.partners.new } if @campaign.partners.size == 0\n format.html { render :new }\n format.json { render json: @campaign.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a100876b9fd435818e649b85cc1490b9", "score": "0.6547071", "text": "def create_campaign!(segment_id)\n gibbon = Gibbon::Request.new(api_key: @api_key)\n settings = {\n subject_line: name,\n title: name,\n from_name: account.email,\n reply_to: account.email\n }\n recipients = {\n list_id: @list_id,\n segment_opts: {\n saved_segment_id: segment_id\n }\n }\n body = {\n type: 'regular',\n recipients: recipients,\n settings: settings\n }\n response = gibbon.campaigns.create(body: body)\n update!(mailchimp_id: response['id'])\n end", "title": "" }, { "docid": "e7f7fc15582866051b32fe6a14639260", "score": "0.65298337", "text": "def create\n @campaign = Campaign.new(campaign_params)\n respond_to do |format|\n if @campaign.save\n format.html { redirect_to @campaign, notice: t(\"controller.shared.flash.create.notice\", model: pick_model_from_locale(:campaign)) }\n format.json { render :show, status: :created, location: @campaign }\n else\n format.html { render :new }\n format.json { render json: @campaign.errors, status: t(\"controller.shared.flash.create.status\") }\n end\n end\n end", "title": "" }, { "docid": "7d8c347b849b9f264d0b905dc8f13617", "score": "0.64778304", "text": "def create_campaign(client, customer_id, budget_resource_name)\n # Creates a campaign operation.\n operation = client.operation.create_resource.campaign do |c|\n c.name = \"Interplanetary Cruise Local ##{(Time.new.to_f * 1000).to_i}\"\n c.campaign_budget = budget_resource_name\n # Recommendation: Set the campaign to PAUSED when creating it to prevent\n # the ads from immediately serving. Set to ENABLED once you've added\n # targeting and the ads are ready to serve.\n c.status = :PAUSED\n # All Local campaigns have an advertisingChannelType of LOCAL and\n # advertisingChannelSubType of LOCAL_CAMPAIGN.\n c.advertising_channel_type = :LOCAL\n c.advertising_channel_sub_type = :LOCAL_CAMPAIGN\n # Bidding strategy must be set directly on the campaign.\n # Setting a portfolio bidding strategy by resource name is not supported.\n # Maximize conversion value is the only strategy supported for Local\n # campaigns. An optional ROAS (Return on Advertising Spend) can be set for\n # maximize_conversion_value. The ROAS value must be specified as a ratio in\n # the API. It is calculated by dividing \"total value\" by \"total spend\".\n # For more information on maximize conversion value, see the support article:\n # http://support.google.com/google-ads/answer/7684216.\n c.maximize_conversion_value = Google::Ads::GoogleAds::V8::Common::MaximizeConversionValue.new\n c.maximize_conversion_value.target_roas = 3.5\n # Configures the Local campaign setting.\n c.local_campaign_setting = client.resource.local_campaign_setting do |lcs|\n # Use the locations associated with the customer's linked\n # Google My Business account.\n lcs.location_source_type = :GOOGLE_MY_BUSINESS\n end\n # Optimization goal setting is mandatory for Local campaigns. This example\n # selects driving directions and call clicks as goals.\n c.optimization_goal_setting = client.resource.optimization_goal_setting do |ogs|\n ogs.optimization_goal_types += [:CALL_CLICKS, :DRIVING_DIRECTIONS]\n end\n end\n\n # Issues a mutate request to add campaign.\n response = client.service.campaign.mutate_campaigns(\n customer_id: customer_id,\n operations: [operation],\n )\n\n campaign_resource_name = response.results.first.resource_name\n puts \"Created Local campaign with resource name: '#{campaign_resource_name}'.\"\n\n campaign_resource_name\nend", "title": "" }, { "docid": "3b9944bd4272556d62b6a4202cefe807", "score": "0.6457821", "text": "def create\n params[:campaign].merge!(:user_id => current_user.id)\n @campaign = Campaign.new(params[:campaign])\n @designs = Design.all\n respond_to do |format|\n if @campaign.save\n flash[:notice] = 'Campaign was successfully created.'\n format.html { redirect_to(@campaign) }\n format.xml { render :xml => @campaign, :status => :created, :location => @campaign }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @campaign.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ece1cc2185309b5a2b092d9be05857ce", "score": "0.6443194", "text": "def create\n @campaign = Campaign.new(params[:campaign])\n @campaign.user_id = current_user.id\n\n respond_to do |format|\n if @campaign.save\n format.html { redirect_to(:campaigns, :notice => 'Campaign was successfully created.') }\n format.xml { render :xml => @campaign, :status => :created, :location => @campaign }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @campaign.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "10b271a873835b199e45a2e22a521dd7", "score": "0.6429433", "text": "def new\n campaign_id = 199420745\n ad_group_name = \"cuarto intento con adwords y keywords\"\n\n ################\n ad_name = \"prueba 2\"\n ad_desc1 = \"esto es prueba\"\n ad_desc2 = \"esto es prueba\"\n ad_url = \"http://tbf.mx/\"\n ad_display = \"tbf.mx/\"\n ################ \n \n end", "title": "" }, { "docid": "bf7606c0edd5ae36ff486c59143d3fa5", "score": "0.64138025", "text": "def create\n # Check if user has access\n if hasAccess\n\n # Create the achievement form the input and set the app id\n @campaign = Campaign.new(params[:campaign])\n @campaign.app_id = params[:app_id]\n\n if (@campaign.duration.nil?)\n @campaign.duration = CAMPAIGN_DURATION_DAYS\n end\n\n # Save the new campaign\n if @campaign.save\n redirect_to app_campaign_url(params[:app_id], @campaign), :flash => { :notice => \"Campaign successfully created.\" }\n else\n render :new\n end\n end\n end", "title": "" }, { "docid": "7fb89a63d32736475dcab0e5299d6939", "score": "0.63974696", "text": "def create\n @campaign_type = CampaignType.new(params[:campaign_type])\n\n respond_to do |format|\n if @campaign_type.save\n format.html { redirect_to @campaign_type, notice: 'Campaign type was successfully created.' }\n format.json { render json: @campaign_type, status: :created, location: @campaign_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @campaign_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "45d78ecdf795fbc06114ffdb76ce4be0", "score": "0.63916403", "text": "def create\n @campaign = Campaign.new(campaign_params)\n @campaign.user_id = current_user.id\n authorize @campaign\n if @campaign.save\n render :show, status: :created\n else\n render_error\n end\n end", "title": "" }, { "docid": "a79aa3da3e92bf0a50a206b0058ffcdf", "score": "0.6384", "text": "def create\n @campaign = Campaign.new(campaign_params)\n\n respond_to do |format|\n if @campaign.save\n format.html { redirect_to [@pitch, @campaign], notice: 'Campanha criada com sucesso.' }\n format.json { render :show, status: :created, location: @campaign }\n else\n format.html { render :new }\n format.json { render json: @campaign.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b72bc4ef33b8223b89a406749ffda6ee", "score": "0.6383545", "text": "def add_campaign(payload)\n post(url_(\"campaign\"), payload)\n end", "title": "" }, { "docid": "ba4d997b244ad762f14a09069e2358a2", "score": "0.6378375", "text": "def create\n @campaign = current_user.campaigns.new(campaign_params)\n\n respond_to do |format|\n if @campaign.save\n format.html { redirect_to upload_campaign_contacts_path(@campaign), notice: 'Campaign was successfully created.' }\n format.json { render :show, status: :created, location: @campaign }\n else\n format.html { render :new }\n format.json { render json: @campaign.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4b1666d1d946df9ec29552e7f353f636", "score": "0.6376097", "text": "def create\n if logged_in?\n @campaign = Campaign.new(campaign_params)\n @campaign.user_id = current_user.id\n @campaign.completed = false\n if !@campaign.hashtag.start_with?(\"#\")\n @campaign.hashtag = \"#\" + @campaign.hashtag\n end\n if @campaign.hashtag.include?(\" \")\n @campaign.hashtag.gsub!(\" \",\"\")\n end\n\n respond_to do |format|\n if @campaign.save\n format.html { redirect_to @campaign, notice: 'Campaign was successfully created.' }\n format.json { render :show, status: :created, location: @campaign }\n else\n format.html { render :new }\n format.json { render json: @campaign.errors, status: :unprocessable_entity }\n end\n end\n else\n redirect_to root_url\n end\n end", "title": "" }, { "docid": "96739d10b00c12ad187a97b4b3b62ac0", "score": "0.63553935", "text": "def create\n \tset_user\n \t@campaign = Campaign.new(campaign_params)\n\t@campaign.user_id = @user.id\n respond_to do |format|\n begin\n if @campaign.save\n format.html { redirect_to @campaign, notice: 'Campaign was successfully created.' }\n format.json { render :show, status: :created, location: @campaign }\n else\n format.html { render :new }\n format.json { render json: @campaign.errors, status: :unprocessable_entity }\n end\n rescue ActiveRecord::RecordNotUnique\n \tflash.now[:danger] = 'Campaign name already exists!'\n format.html { render :new }\n format.json { render json: @campaign.errors, status: :unprocessable_entity }\n end \n end\n end", "title": "" }, { "docid": "aeb83992dfe331b3a2e598b1064bf4f9", "score": "0.6342312", "text": "def create\n @admin_campaign = Admin::Campaign.new(admin_campaign_params)\n authorize! :create, @admin_campaign\n\n respond_to do |format|\n if @admin_campaign.save\n format.html { redirect_to @admin_campaign, notice: 'Campaign was successfully created.' }\n format.json { render action: 'show', status: :created, location: @admin_campaign }\n else\n format.html { render action: 'new' }\n format.json { render json: @admin_campaign.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e44a091a3a6b357b5a1851f47a2c8c6d", "score": "0.6312995", "text": "def create\n @campaign = Campaign.new(campaign_params)\n\n respond_to do |format|\n if @campaign.save\n format.html { redirect_to get_content_path(@campaign), notice: 'Campaign was successfully created.' }\n else\n format.html { render action: 'new' }\n end\n end\n end", "title": "" }, { "docid": "d58332ba37db7ff67b861ac60de28a4b", "score": "0.6308545", "text": "def create\n @ad_campaign = current_user.ad_campaigns.build(ad_campaign_params)\n\n respond_to do |format|\n if @ad_campaign.save\n \n format.html { redirect_to @ad_campaign, notice: 'Ad campaign was successfully created.' }\n format.json { render :show, status: :created, location: @ad_campaign }\n else\n format.html { render :new }\n format.json { render json: @ad_campaign.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "34d75d8ff6e3472d6fe0fffe70977f4a", "score": "0.6300882", "text": "def create_email_campaign_with_http_info(email_campaigns, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: EmailCampaignsApi.create_email_campaign ...'\n end\n # verify the required parameter 'email_campaigns' is set\n if @api_client.config.client_side_validation && email_campaigns.nil?\n fail ArgumentError, \"Missing the required parameter 'email_campaigns' when calling EmailCampaignsApi.create_email_campaign\"\n end\n # resource path\n local_var_path = '/emailCampaigns'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(email_campaigns)\n auth_names = ['api-key', 'partner-key']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'CreateModel')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: EmailCampaignsApi#create_email_campaign\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "b2c6da1dfc7fb818081b78f6244aea73", "score": "0.629196", "text": "def create\n @metacampaign = Metacampaign.new(metacampaign_params)\n\n respond_to do |format|\n if @metacampaign.save\n format.html { redirect_to @metacampaign, notice: 'Metacampaign was successfully created.' }\n format.json { render :show, status: :created, location: @metacampaign }\n else\n format.html { render :new }\n format.json { render json: @metacampaign.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9f240fb08edec509e0aa8b0b9c0cf43", "score": "0.62841165", "text": "def create_campaign(name, start_time, end_time, list_id, opts = {})\n data, _status_code, _headers = create_campaign_with_http_info(name, start_time, end_time, list_id, opts)\n return data\n end", "title": "" }, { "docid": "d582458ff7334bfe0c4b132ccb57eafd", "score": "0.625826", "text": "def campaign_params\n params.require(:campaign).permit(:name, :description, :launch_date, :end_date)\n end", "title": "" }, { "docid": "948e84e342a97b20e434606c01974372", "score": "0.62371343", "text": "def create\n @discount_campaign = DiscountCampaign.new(discount_campaign_params)\n\n respond_to do |format|\n if @discount_campaign.save\n format.html { redirect_to @discount_campaign, notice: 'Discount campaign was successfully created.' }\n format.json { render :show, status: :created, location: @discount_campaign }\n else\n format.html { render :new }\n format.json { render json: @discount_campaign.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ffbd8425b510f51dbc6e8405958a171f", "score": "0.6233716", "text": "def campaign_params\n params.require(:campaign).permit(:title, :description)\n end", "title": "" }, { "docid": "4cecad650f5c2e95d1712cdeb6008518", "score": "0.622595", "text": "def add_campaign(options = {})\n response = connection.post do |req|\n req.url \"campaigns/add\", options\n end\n return_error_or_body(response, response.body.response.campaign)\n end", "title": "" }, { "docid": "a18c5520b6de681d7631bbe58cba25fe", "score": "0.62101793", "text": "def create\n @campaign_person = CampaignPerson.new(params[:campaign_person])\n\n respond_to do |format|\n if @campaign_person.save\n format.html { redirect_to @campaign_person, notice: 'Campaign person was successfully created.' }\n format.json { render json: @campaign_person, status: :created, location: @campaign_person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @campaign_person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f427bbd67cb8c00669a1719ebc708ac0", "score": "0.6209865", "text": "def create(campaign_writable, opts = {})\n data, _status_code, _headers = campaign_create_with_http_info(campaign_writable, opts)\n data\n end", "title": "" }, { "docid": "87f6aaac9a4069ea3450b2a7be50c426", "score": "0.6209497", "text": "def create\n @campaign_template = CampaignTemplate.new(campaign_template_params)\n\n respond_to do |format|\n if @campaign_template.save\n format.html { redirect_to @campaign_template, notice: 'Campaign template was successfully created.' }\n format.json { render :show, status: :created, location: @campaign_template }\n else\n format.html { render :new }\n format.json { render json: @campaign_template.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "940611ac48ceba4bcafc7997dcf08a19", "score": "0.620516", "text": "def create\n @campaign_member = CampaignMember.new(params[:campaign_member])\n\n respond_to do |format|\n if @campaign_member.save\n format.html { redirect_to @campaign_member, notice: 'Campaign member was successfully created.' }\n format.json { render json: @campaign_member, status: :created, location: @campaign_member }\n else\n format.html { render action: \"new\" }\n format.json { render json: @campaign_member.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "731d8a53974c27126baed98040c3429f", "score": "0.61873484", "text": "def create_campaign_with_http_info(data, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CampaignApi.create_campaign ...\"\n end\n # verify the required parameter 'data' is set\n if @api_client.config.client_side_validation && data.nil?\n fail ArgumentError, \"Missing the required parameter 'data' when calling CampaignApi.create_campaign\"\n end\n # resource path\n local_var_path = \"/campaigns\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(data)\n auth_names = ['API Key']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PostSuccess')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CampaignApi#create_campaign\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "14d88958e9d731f066896dcdf8d78165", "score": "0.6175492", "text": "def campaign_params\n params.require(:campaign).permit(:title, :user_id, :startDate, :endDate, :html_head, :html_body, :theme, :background_image, :published, :lucky_string, :winning_message, :losing_message)\n end", "title": "" }, { "docid": "41504377c5f2cd69a6dd400d4dc9a3b3", "score": "0.61660844", "text": "def create\n @campaign_task = CampaignTask.new(campaign_task_params)\n\n respond_to do |format|\n if @campaign_task.save\n format.html { redirect_to @campaign_task, notice: 'Campaign task was successfully created.' }\n format.json { render :show, status: :created, location: @campaign_task }\n else\n format.html { render :new }\n format.json { render json: @campaign_task.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d9c91463c49169dbb051ec2ae862db4b", "score": "0.616052", "text": "def campaign_params\n params.require(:campaign).permit(:email_template_id, :send_at, :group_id, :name, :description)\n end", "title": "" }, { "docid": "79bad9b5ebe10e010a3184d6295b3371", "score": "0.6154594", "text": "def campaign_params\n params.require(:campaign).permit(:name, :description)\n end", "title": "" }, { "docid": "75baad5a29c1918b14a3830a2a9456d2", "score": "0.614716", "text": "def test_add_campaign\n operation = {\n :operand => {\n :name => 'Interplanetary Cruise #%s' % (Time.new.to_f * 1000).to_i,\n :status => 'PAUSED',\n :biddingStrategy => @campaign_srv.module::ManualCPC.new,\n :budget => {\n :period => 'DAILY',\n :amount => {\n :microAmount => 50000000\n },\n :deliveryMethod => 'STANDARD'\n }\n },\n :operator => 'ADD'\n }\n\n # Add campaign.\n response = @campaign_srv.mutate([operation])\n campaign = response.rval.value.first\n\n assert_not_nil(campaign, 'Invalid campaign returned')\n assert_added_correctly(operation, campaign)\n @campaign = campaign\n end", "title": "" }, { "docid": "38f3542d903d072fe0ddaf5f79b01499", "score": "0.6139737", "text": "def create\n @campaign_result = CampaignResult.new(campaign_result_params)\n\n respond_to do |format|\n if @campaign_result.save\n format.html { redirect_to @campaign_result, notice: 'Campaign result was successfully created.' }\n format.json { render :show, status: :created, location: @campaign_result }\n else\n format.html { render :new }\n format.json { render json: @campaign_result.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1a8f0fbc1b165881a7659fe7f2faa755", "score": "0.613916", "text": "def create\n @campaign_management = CampaignManagement.new(params[:campaign_management])\n\n respond_to do |format|\n if @campaign_management.save\n format.html { redirect_to @campaign_management, notice: 'Campaign management was successfully created.' }\n format.json { render json: @campaign_management, status: :created, location: @campaign_management }\n else\n format.html { render action: \"new\" }\n format.json { render json: @campaign_management.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1a6a273b293162476b6f111a329773d9", "score": "0.61301845", "text": "def create_campaign_with_http_info(name, start_time, end_time, list_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CampaignsApi.create_campaign ...\"\n end\n # verify the required parameter 'name' is set\n if @api_client.config.client_side_validation && name.nil?\n fail ArgumentError, \"Missing the required parameter 'name' when calling CampaignsApi.create_campaign\"\n end\n # verify the required parameter 'start_time' is set\n if @api_client.config.client_side_validation && start_time.nil?\n fail ArgumentError, \"Missing the required parameter 'start_time' when calling CampaignsApi.create_campaign\"\n end\n # verify the required parameter 'end_time' is set\n if @api_client.config.client_side_validation && end_time.nil?\n fail ArgumentError, \"Missing the required parameter 'end_time' when calling CampaignsApi.create_campaign\"\n end\n # verify the required parameter 'list_id' is set\n if @api_client.config.client_side_validation && list_id.nil?\n fail ArgumentError, \"Missing the required parameter 'list_id' when calling CampaignsApi.create_campaign\"\n end\n # resource path\n local_var_path = \"/campaigns\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])\n\n # form parameters\n form_params = {}\n form_params[\"name\"] = name\n form_params[\"start_time\"] = start_time\n form_params[\"end_time\"] = end_time\n form_params[\"list_id\"] = list_id\n\n # http body (model)\n post_body = nil\n auth_names = ['jwt']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'InlineResponse20110')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CampaignsApi#create_campaign\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "c2b3dcca33ed2f405ca6ccb03c5533fd", "score": "0.61296415", "text": "def campaign_params\n params.require(:campaign).permit(:name, :description, :goal)\n end", "title": "" }, { "docid": "7852630860e8efd491fab64bce4d312c", "score": "0.6120503", "text": "def create\n @campaign = Campaign.new(campaign_params)\n @campaign.beacons = params[:beacons]\n render json: @campaign.errors unless @campaign.save\n end", "title": "" }, { "docid": "57917bc0911bd38f6c8dea4edcbebc75", "score": "0.6120056", "text": "def create\n @campaign_category = CampaignCategory.new(campaign_category_params)\n\n respond_to do |format|\n if @campaign_category.save\n format.html { redirect_to @campaign_category, notice: 'Campaign category was successfully created.' }\n format.json { render :show, status: :created, location: @campaign_category }\n else\n format.html { render :new }\n format.json { render json: @campaign_category.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "68686a9cc620431f926d93b1e3789da2", "score": "0.61108685", "text": "def create\n @campaign = Campaign.new(params[:campaign])\n @entities = Entity.all.map { |u| [u.name, u.id]}\n respond_to do |format|\n if @campaign.save\n format.html { redirect_to @campaign, :notice => 'Campaign was successfully created.' }\n format.json { render :json => @campaign, :status => :created, :location => @campaign }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @campaign.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5dbfc49d5f86a40902bb6ddbf954f273", "score": "0.609325", "text": "def campaign_params\n params.require(:campaign).permit(:name, :image, :starts_on, :ends_on, :client_id)\n end", "title": "" }, { "docid": "9c85627fdc5bbed78a2544ca9bb84353", "score": "0.60838735", "text": "def campaign_params\n params.require(:campaign).permit(:title, :description, :deadline, :beneficiary_id, :target_amount, :user_id, :beneficiary_id, :id)\n end", "title": "" }, { "docid": "731184e4bbac3c13901906ed0277c8cb", "score": "0.6074295", "text": "def get_and_create_campaigns\n LogHandle.info_ \"STARTING get and create all campaigns\"\n campaigns_arr = []\n response = RestUtil.run(\"campaigns\")\n response.each do |cmp|\n temp = {}\n temp[:id] = cmp[\"id\"]\n temp[:length_of_interview] = cmp[\"length_of_interview\"]\n temp[:cpi] = cmp[\"cpi\"]\n temp[:name] = cmp[\"name\"]\n campaigns_arr << temp\n end\n campaigns_response = Campaign.import! campaigns_arr # or use import!\n LogHandle.info_ \"ALL Campaign will be created object of campaigns array: #{campaigns_arr}\"\n if campaigns_response\n LogHandle.info_ \"Success - ALL Campaign were created.\"\n true\n else\n LogHandle.err_ \"Fail object of campaigns created : ERR: #{campaigns_response.errors}\"\n false\n end\n end", "title": "" }, { "docid": "7a6fce7f44e55c54209e227de16d25a7", "score": "0.6071702", "text": "def create\n @campaign_person = CampaignPerson.new(params[:campaign_person])\n\n respond_to do |format|\n if @campaign_person.save\n format.html { redirect_to @campaign_person, :notice => 'Campaign person was successfully created.' }\n format.json { render :json => @campaign_person, :status => :created, :location => @campaign_person }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @campaign_person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b9b89bc44ca1bcdb47fd01eae6add42e", "score": "0.6065678", "text": "def campaign_params\n params.require(:campaign).permit(:name, :email_template_id)\n end", "title": "" }, { "docid": "42121fab119da45175948ff7cc9ec1c6", "score": "0.6011336", "text": "def campaigns_add name:\n call_adglare_api 'campaigns_add', {name: name}\n end", "title": "" } ]
4f8a28994baddbef71ff339e432440c8
DELETE /indexed_activities/1 DELETE /indexed_activities/1.json
[ { "docid": "d1c0f8569cb30cd0c6e5fe278df55d4c", "score": "0.7885128", "text": "def destroy\n @indexed_activity.destroy\n respond_to do |format|\n format.html { redirect_to indexed_activities_url, notice: 'Indexed activity was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "0119fe8dee723c5901d00a56515cb2bf", "score": "0.68790466", "text": "def delete_object_activity(id)\n @client.raw('delete', \"/helpers/object-activities/#{id}\")\n end", "title": "" }, { "docid": "41cb664d51ff8e7cd7cf2d37f2e3535e", "score": "0.681682", "text": "def destroy\n Activity.delete_hack(params[:id])\n\n respond_to do |format|\n format.html { redirect_to activities_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "b3d66c490303babb47c1bac08f884bd5", "score": "0.67538106", "text": "def destroy\n @activity.destroy\n respond_to do |format|\n format.html { redirect_to activities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b3d66c490303babb47c1bac08f884bd5", "score": "0.67538106", "text": "def destroy\n @activity.destroy\n respond_to do |format|\n format.html { redirect_to activities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b3d66c490303babb47c1bac08f884bd5", "score": "0.67538106", "text": "def destroy\n @activity.destroy\n respond_to do |format|\n format.html { redirect_to activities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b3d66c490303babb47c1bac08f884bd5", "score": "0.67538106", "text": "def destroy\n @activity.destroy\n respond_to do |format|\n format.html { redirect_to activities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b3d66c490303babb47c1bac08f884bd5", "score": "0.67538106", "text": "def destroy\n @activity.destroy\n respond_to do |format|\n format.html { redirect_to activities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3f1b4a283b64d66cc8171e5151429b8e", "score": "0.67396975", "text": "def destroy\n @activity.destroy\n respond_to do |format|\n format.html { redirect_to project_activities_url(params[:project_id]) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4c88e5b8ad4b1f227d6dd094ea53e34f", "score": "0.6702218", "text": "def destroy\n @activity = @campaign.activities.find(params[:id])\n @activity.destroy\n\n respond_to do |format|\n format.html { redirect_to activities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f9ccaefce0b99026562365394ff0a4fe", "score": "0.6680953", "text": "def destroy\n @qa_activity = QaActivity.find(params[:id])\n @qa_activity.destroy\n\n respond_to do |format|\n format.html { redirect_to qa_activities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b93563efe502ca734cbe95cbbc432a24", "score": "0.66719824", "text": "def delete\n @activity = current_user.activities.find(params[:id])\n @activity.destroy\n\n respond_to do |format|\n format.html { redirect_to manage_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "78f0f015a87ac871a46df972f64215b2", "score": "0.66617763", "text": "def destroy\n @activity = Activity.find(params[:id])\n @activity.destroy\n\n respond_to do |format|\n format.html { redirect_to activities_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "78f0f015a87ac871a46df972f64215b2", "score": "0.66617763", "text": "def destroy\n @activity = Activity.find(params[:id])\n @activity.destroy\n\n respond_to do |format|\n format.html { redirect_to activities_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "f3a4396fd2c0c119a127369d25630751", "score": "0.66490847", "text": "def destroy\n @activity = Activity.find(params[:id])\n @activity.destroy\n\n respond_to do |format|\n format.html { redirect_to activities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f3a4396fd2c0c119a127369d25630751", "score": "0.66490847", "text": "def destroy\n @activity = Activity.find(params[:id])\n @activity.destroy\n\n respond_to do |format|\n format.html { redirect_to activities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f3a4396fd2c0c119a127369d25630751", "score": "0.66490847", "text": "def destroy\n @activity = Activity.find(params[:id])\n @activity.destroy\n\n respond_to do |format|\n format.html { redirect_to activities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f3a4396fd2c0c119a127369d25630751", "score": "0.66490847", "text": "def destroy\n @activity = Activity.find(params[:id])\n @activity.destroy\n\n respond_to do |format|\n format.html { redirect_to activities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f3a4396fd2c0c119a127369d25630751", "score": "0.66490847", "text": "def destroy\n @activity = Activity.find(params[:id])\n @activity.destroy\n\n respond_to do |format|\n format.html { redirect_to activities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f3a4396fd2c0c119a127369d25630751", "score": "0.66490847", "text": "def destroy\n @activity = Activity.find(params[:id])\n @activity.destroy\n\n respond_to do |format|\n format.html { redirect_to activities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f3a4396fd2c0c119a127369d25630751", "score": "0.66490847", "text": "def destroy\n @activity = Activity.find(params[:id])\n @activity.destroy\n\n respond_to do |format|\n format.html { redirect_to activities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f3a4396fd2c0c119a127369d25630751", "score": "0.66490847", "text": "def destroy\n @activity = Activity.find(params[:id])\n @activity.destroy\n\n respond_to do |format|\n format.html { redirect_to activities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f3a4396fd2c0c119a127369d25630751", "score": "0.66490847", "text": "def destroy\n @activity = Activity.find(params[:id])\n @activity.destroy\n\n respond_to do |format|\n format.html { redirect_to activities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f3a4396fd2c0c119a127369d25630751", "score": "0.66490847", "text": "def destroy\n @activity = Activity.find(params[:id])\n @activity.destroy\n\n respond_to do |format|\n format.html { redirect_to activities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f3a4396fd2c0c119a127369d25630751", "score": "0.66490847", "text": "def destroy\n @activity = Activity.find(params[:id])\n @activity.destroy\n\n respond_to do |format|\n format.html { redirect_to activities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e31732a4cff6586abf8f10d4472476eb", "score": "0.66349024", "text": "def destroy\n @home_indices_recently = Home::Indices::Recently.find(params[:id])\n @home_indices_recently.destroy\n\n respond_to do |format|\n format.html { redirect_to home_indices_recentlies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e3f04d60963483be27a328fff51f73aa", "score": "0.66113", "text": "def destroy\n @activity = current_user.activities.find(params[:id])\n @activity.destroy\n\n respond_to do |format|\n format.html { redirect_to activities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "31f55cf62cb56bb3251249b4f5703ed1", "score": "0.6587375", "text": "def destroy\n @detailed_activity = DetailedActivity.find(params[:id])\n @detailed_activity.destroy\n\n respond_to do |format|\n format.html { redirect_to detailed_activities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0ef7c7fa2791d880d3312599613b26fe", "score": "0.65870297", "text": "def destroy \n @activity = current_user.organization.activities.find(params[:id])\n @activity.destroy\n respond_to do |format|\n format.html { redirect_to activities_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "263ae9aaed13d14289e0c1d6119799ab", "score": "0.6562199", "text": "def destroy\n @primary_activity = PrimaryActivity.find(params[:id])\n @primary_activity.destroy\n\n respond_to do |format|\n format.html { redirect_to primary_activities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fa216c3b1f65f192c8b427226713c384", "score": "0.6560001", "text": "def destroy\n @activity = Activity.find(params[:id])\n @activity.destroy\n\n respond_to do |format|\n format.html { redirect_to backoffice_activities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4183296db8c072f0916144988e61f301", "score": "0.65544015", "text": "def destroy\n @activity = Activity.find(params[:id])\n @activity.destroy\n\n respond_to do |format|\n format.html { redirect_to(:controller => 'index', :action => 'index') }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "7aaa86f58261701e817f2a5ee7bde149", "score": "0.65506274", "text": "def destroy\n @activity.destroy\n\n respond_to do |format|\n format.html { redirect_to(activities_path) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "0d3e09c4b064a487a23ca76bce33da5a", "score": "0.65399694", "text": "def destroy\n @asset_activity.destroy\n respond_to do |format|\n format.html { redirect_to asset_activities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0857aeb388f6828f8b4d59c3062fdcb5", "score": "0.65383035", "text": "def destroy\n @reciever_index = RecieverIndex.find(params[:id])\n @reciever_index.destroy\n\n respond_to do |format|\n format.html { redirect_to reciever_indices_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "810bfc4c9e18b9c07d70c7c862541629", "score": "0.65308386", "text": "def destroy\n UserAct.all.each do |ua|\n if ua.id_activity == @activity.id\n ua.destroy\n end\n end\n\n @activity.destroy\n respond_to do |format|\n format.html { redirect_to activities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6cd2eb965b756449da1f2e7316ba8529", "score": "0.65264684", "text": "def destroy\n @activity = @user.activities.find(params[:id])\n @activity.destroy\n\n respond_to do |format|\n format.html { redirect_to user_activities_url(@user) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6ab3f77c65b79b637eea0d31f90c2038", "score": "0.6525526", "text": "def destroy\n @activity.destroy\n respond_to do |format|\n format.html { redirect_to activities_url }\n end\n end", "title": "" }, { "docid": "a716e9db15211423900f44a22295ddd1", "score": "0.65159965", "text": "def destroy\n @activity = Activity.find(params[:id])\n @activity.destroy\n \n respond_to do |format|\n format.html { redirect_to(activities_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "0ace6778f8a803810170eb70faefe46d", "score": "0.65156186", "text": "def destroy\n @activity = Activity.find(params[:id])\n @activity.destroy\n\n respond_to do |format|\n format.html { redirect_to tasks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a5f6a3c6a6c2ed126ecaeccbeb8d4666", "score": "0.65114856", "text": "def destroy\n @activity = Activity.find(params[:id])\n @activity.destroy\n\n respond_to do |format|\n format.html { redirect_to request.referer || admin_activities_path }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "649546e5b811ca2385d9d60cc4126ac8", "score": "0.6490674", "text": "def destroy\n @activity.destroy\n respond_to do |format|\n format.html { redirect_to [@event, :activities], notice: \"Activity was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "658ecd90f478bb5e930c881b5d413bb4", "score": "0.6487075", "text": "def destroy\n=begin\n @activity_log = ActivityLog.find(params[:id])\n @activity_log.destroy\n\n respond_to do |format|\n format.html { redirect_to activity_logs_url }\n format.json { head :no_content }\n end\n=end\n end", "title": "" }, { "docid": "fad0cce7be2189435bd1a447f370b5e1", "score": "0.6480788", "text": "def destroy\n @activity_ref = ActivityRef.find(params[:id])\n @activity_ref.destroy\n\n respond_to do |format|\n format.html { redirect_to activity_refs_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "02671b8f2fd898054d1ad188836a2d0f", "score": "0.64802444", "text": "def delete_index\n ElasticSearchable.request :delete, index_path\n end", "title": "" }, { "docid": "1f2c2b0f91ba3943e0c326109e91825d", "score": "0.6475433", "text": "def delete(index1, *rest)\n execute('delete', index1, *rest)\n end", "title": "" }, { "docid": "150e2f1335cbeb7ddc2da95b75ece457", "score": "0.6472747", "text": "def destroy\n @activity_log = ActivityLog.find(params[:id])\n @activity_log.destroy\n\n respond_to do |format|\n format.html { redirect_to activity_logs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5131ec900be006c7ee21ce4680c2e819", "score": "0.6469622", "text": "def destroy\n @run_step_activity = RunStepActivity.find(params[:id])\n @run_step_activity.destroy\n\n respond_to do |format|\n format.html { redirect_to run_step_activities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c7c158d8c5746924f6b8b8cdf183f71f", "score": "0.6452663", "text": "def destroy\n @activity = get_user.activities.find(params[:id])\n @activity.destroy\n\n respond_to do |format|\n format.html { redirect_to(activities_url()) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "41fa5a556898e240442ed134b3d627e5", "score": "0.64522946", "text": "def delete_id_from_index(id)\n ElasticSearchable.request :delete, index_mapping_path(id)\n rescue ElasticSearchable::ElasticError => e\n ElasticSearchable.logger.warn e\n end", "title": "" }, { "docid": "6f0d3dfd5ec013849b03e8baa872c224", "score": "0.6450249", "text": "def destroy\n @act_activity.destroy\n respond_to do |format|\n format.html { redirect_to act_activities_url, notice: 'Act activity was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "97b9f1d0d1ec0c3e615584f64df76623", "score": "0.6439732", "text": "def destroy\n @api_wmall_activity = Wmall::Activity.find(params[:id])\n @api_wmall_activity.destroy\n\n respond_to do |format|\n format.html { redirect_to api_wmall_activities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cb02344e1d0b01c79d6e0ec7e9334920", "score": "0.6438025", "text": "def destroy\n @current_tab = \"activities\"\n @activity = Activity.find(params[:id])\n @activity.destroy\n\n respond_to do |format|\n format.html { redirect_to activities_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "46095051d424bf08fe027a4c6bb4934e", "score": "0.6433723", "text": "def destroy\n @activity = Activity.find(params[:id])\n @activity.destroy\n\n respond_to do |format|\n format.html { redirect_to(activities_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "46095051d424bf08fe027a4c6bb4934e", "score": "0.6433723", "text": "def destroy\n @activity = Activity.find(params[:id])\n @activity.destroy\n\n respond_to do |format|\n format.html { redirect_to(activities_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "46095051d424bf08fe027a4c6bb4934e", "score": "0.6433723", "text": "def destroy\n @activity = Activity.find(params[:id])\n @activity.destroy\n\n respond_to do |format|\n format.html { redirect_to(activities_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "b77111906bbc1e46f101a87baa1acb3f", "score": "0.643126", "text": "def destroy\n @iactivity.destroy\n respond_to do |format|\n format.html { redirect_to iactivities_url, notice: 'Iactivity was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "baadd4d969e09dba0cbe9b24df53a74d", "score": "0.6427932", "text": "def destroy\n @activity.destroy\n respond_to do |format|\n format.html { redirect_to activities_url, notice: 'La actividad se ha eliminado correctamente' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "61db25fb634e9edc296a63080d2aaed9", "score": "0.64253616", "text": "def destroy\n @activity = Activity.find(params[:id])\n @activity.destroy\n\n respond_to do |format|\n format.html { redirect_to activities_url }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "cfb00f6fde4f508ddf09b5878cc68654", "score": "0.6424046", "text": "def destroy\n @activity.delete\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Activity was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "18563027166402bf5186204f8a27cc36", "score": "0.64197797", "text": "def destroy\n \t@activity = Activity.find(params[:id])\n \t@activity.destroy\n\n\t\trespond_to do |format|\n \t\tformat.html { redirect_to activities_url }\n \t\tformat.json { head :no_content }\n \tend\n \tend", "title": "" }, { "docid": "c6e11a13d98e54f967de62da4b6686cf", "score": "0.641945", "text": "def destroy\n activity.destroy\n respond_with(activity)\n end", "title": "" }, { "docid": "412f7cf13282ff0029a116292f070cde", "score": "0.6419369", "text": "def delete_id_from_index(id)\n ElasticSearchable.request :delete, index_type_path(id)\n rescue ElasticSearchable::ElasticError => e\n ElasticSearchable.logger.warn e\n end", "title": "" }, { "docid": "a717a66381b7b61b8a9c68804a240f62", "score": "0.64177114", "text": "def destroy\n @activity = @company.activities.find(params[:id])\n\n @activity.destroy\n respond_to do |format|\n format.html { redirect_to company_activities_path @company, notice: 'Activity was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "124b65507f011657248766a686037f09", "score": "0.6412933", "text": "def destroy\n @project_activity = ProjectActivity.find(params[:id])\n @project_activity.destroy\n\n respond_to do |format|\n format.html { redirect_to project_activities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c586977951f74ef48132498b48849d51", "score": "0.64115036", "text": "def destroy\n @task_activity = TaskActivity.find(params[:id])\n @task_activity.destroy\n\n respond_to do |format|\n format.html { redirect_to task_activities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fe3ec622126618fdebdb3684a7c8d1a1", "score": "0.6409547", "text": "def destroy\n @activity.destroy\n respond_to do |format|\n format.html { redirect_to activities_url, notice: 'La actividad se elimino con exito.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a7f8feb1e4a468f9359352916bf1d80d", "score": "0.64077663", "text": "def destroy\n\n @sheetfile.activities.each do | activity |\n activity.destroy\n end\n @sheetfile.destroy\n\n respond_to do |format|\n format.html { redirect_to :back}\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1c2be845cc6d8452e98866d6862282d8", "score": "0.6407612", "text": "def destroy\n @activity.destroy\n respond_to do |format|\n flash[:success] = 'Atividade excluida com sucesso.'\n format.html { redirect_to activities_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f1afa0d2a05f69787c507419dab6d3a6", "score": "0.6407124", "text": "def destroy\n @activity.destroy\n respond_to do |format|\n format.html { redirect_to admin_activities_url, notice: '活动删除成功' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f6537946e67c703584bbfb404c2cfc17", "score": "0.6395335", "text": "def destroy\n @activity.destroy\n respond_to do |format|\n format.html { redirect_to project_path(params[:project_id]), notice: 'Atividade destruída com sucesso!' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "af6dccc2276f7c27f0c7332a7ef13a88", "score": "0.6392854", "text": "def destroy\n @activity.destroy\n respond_with(@activity)\n end", "title": "" }, { "docid": "183d06cc1d8498f9cc167fa4da63e12e", "score": "0.6384031", "text": "def destroy\n activity = Activity.find_by(id: params[:id])\n activity.destroy\n head :no_content\n end", "title": "" }, { "docid": "b90027b11c5779a316e8ef283ebfceb5", "score": "0.6380552", "text": "def destroy\n @key_activity.destroy\n respond_to do |format|\n format.html { redirect_to @business_model_canvase }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4095078a724d28bf9bcad8355699a066", "score": "0.637933", "text": "def destroy\n @activity.destroy\n head :no_content\n end", "title": "" }, { "docid": "fd9d0305d14bdeb5c5451133d6773ca9", "score": "0.6378917", "text": "def destroy\n @external_otrunk_activity.destroy\n respond_to do |format|\n format.html { redirect_to external_otrunk_activities_url }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "466e26e33d5a799d433d9ead55c0d875", "score": "0.63741213", "text": "def destroy\r\n @indexed_directory = IndexedDirectory.find(params[:id])\r\n @indexed_directory.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to indexed_directories_url }\r\n format.json { head :no_content }\r\n end\r\n end", "title": "" }, { "docid": "66867ba4fd6a09068b182618affd6a4e", "score": "0.6367433", "text": "def destroy\n @exercise = Exercise.find(params[:exercise_id])\n @activity = Activity.find(params[:id])\n @activity.destroy\n\n respond_to do |format|\n format.html { redirect_to @exercise }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9cca9a030d91205dd83a925e626ff1bf", "score": "0.63653016", "text": "def destroy\n @index.destroy\n\n respond_to do |format|\n format.html { redirect_to indices_url, notice: t2('destroy.notice') }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b9c213967977719ca72c4b1b526ce2af", "score": "0.635906", "text": "def destroy\n @activity_set = ActivitySet.find(params[:id])\n @activity_set.destroy\n\n respond_to do |format|\n format.html { redirect_to activity_sets_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "97f40103efa11ce70bfa496e604d1ca6", "score": "0.63557446", "text": "def destroy\n @companyactivity.destroy\n respond_to do |format|\n format.html { redirect_to companyactivity_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e86424d623302b1e5664dccdd7526044", "score": "0.6350363", "text": "def destroy\n @activity.destroy\n respond_to do |format|\n format.html { redirect_to activities_url, notice: 'Atividade deletada.' }\n format.json{redirect_to root_url}\n end\n end", "title": "" }, { "docid": "491386a38177754fd456daf970b501b3", "score": "0.6344523", "text": "def destroy\n @recent_activity = RecentActivity.find(params[:id])\n @recent_activity.destroy\n\n respond_to do |format|\n format.html { redirect_to(recent_activities_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "426eb72c5117d21796790e8d65657815", "score": "0.6343708", "text": "def destroy\n @activity.destroy\n respond_to do |format|\n format.html { redirect_to activities_url, notice: 'Activity was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "426eb72c5117d21796790e8d65657815", "score": "0.6343708", "text": "def destroy\n @activity.destroy\n respond_to do |format|\n format.html { redirect_to activities_url, notice: 'Activity was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "426eb72c5117d21796790e8d65657815", "score": "0.6343708", "text": "def destroy\n @activity.destroy\n respond_to do |format|\n format.html { redirect_to activities_url, notice: 'Activity was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "426eb72c5117d21796790e8d65657815", "score": "0.6343708", "text": "def destroy\n @activity.destroy\n respond_to do |format|\n format.html { redirect_to activities_url, notice: 'Activity was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "426eb72c5117d21796790e8d65657815", "score": "0.6343708", "text": "def destroy\n @activity.destroy\n respond_to do |format|\n format.html { redirect_to activities_url, notice: 'Activity was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "426eb72c5117d21796790e8d65657815", "score": "0.6343708", "text": "def destroy\n @activity.destroy\n respond_to do |format|\n format.html { redirect_to activities_url, notice: 'Activity was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "426eb72c5117d21796790e8d65657815", "score": "0.6343708", "text": "def destroy\n @activity.destroy\n respond_to do |format|\n format.html { redirect_to activities_url, notice: 'Activity was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "426eb72c5117d21796790e8d65657815", "score": "0.6343708", "text": "def destroy\n @activity.destroy\n respond_to do |format|\n format.html { redirect_to activities_url, notice: 'Activity was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "426eb72c5117d21796790e8d65657815", "score": "0.6343708", "text": "def destroy\n @activity.destroy\n respond_to do |format|\n format.html { redirect_to activities_url, notice: 'Activity was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "426eb72c5117d21796790e8d65657815", "score": "0.6343708", "text": "def destroy\n @activity.destroy\n respond_to do |format|\n format.html { redirect_to activities_url, notice: 'Activity was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "426eb72c5117d21796790e8d65657815", "score": "0.6343708", "text": "def destroy\n @activity.destroy\n respond_to do |format|\n format.html { redirect_to activities_url, notice: 'Activity was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "426eb72c5117d21796790e8d65657815", "score": "0.6343708", "text": "def destroy\n @activity.destroy\n respond_to do |format|\n format.html { redirect_to activities_url, notice: 'Activity was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "426eb72c5117d21796790e8d65657815", "score": "0.6343708", "text": "def destroy\n @activity.destroy\n respond_to do |format|\n format.html { redirect_to activities_url, notice: 'Activity was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "426eb72c5117d21796790e8d65657815", "score": "0.6343708", "text": "def destroy\n @activity.destroy\n respond_to do |format|\n format.html { redirect_to activities_url, notice: 'Activity was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e4614afca6ca3f33642bed8dfa91f5f4", "score": "0.63424927", "text": "def destroy\n @glycemic_index.destroy\n respond_to do |format|\n format.html { redirect_to glycemic_indices_url, notice: 'Glycemic index was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "67dcac5a77e04a6f60a2721532ae838c", "score": "0.6340225", "text": "def destroy\n @activity.destroy\n respond_to do |format|\n format.html { redirect_to activities_url, notice: \"Activity was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "dbfff751f92b9670287c85282182b566", "score": "0.6339523", "text": "def destroy\n @activity = Activity.find(params[:id])\n @activity.destroy\n\n respond_to do |format|\n format.html { redirect_to personal_user_activities_url(@current_user) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "55b9c25a71ddbcea08cf688bb5285b68", "score": "0.63284385", "text": "def delete_activity(activity_log_id)\n delete(\"user/#{user_id}/activities/#{activity_log_id}.json\")\n end", "title": "" } ]
2d8541b204266512c67fcce803d2e21a
def get_result_date(hit) end def get_result_annotation(hit) end def result_has_annotation(hit) end def get_result_tags(hit) end
[ { "docid": "f9b7f873b2754525eb2c96157f6b018a", "score": "0.0", "text": "def get_saved_searches(username)\n user = User.find_by_username(username)\n return user.searches.find(:all).sort { |a,b| b.id <=> a.id }\n end", "title": "" } ]
[ { "docid": "150d3cb430f6e51627e6d26860cb51ec", "score": "0.6437307", "text": "def results; end", "title": "" }, { "docid": "150d3cb430f6e51627e6d26860cb51ec", "score": "0.6437307", "text": "def results; end", "title": "" }, { "docid": "150d3cb430f6e51627e6d26860cb51ec", "score": "0.6437307", "text": "def results; end", "title": "" }, { "docid": "34a088a01ce2113a9dad837914e350be", "score": "0.6224788", "text": "def gather_results( result )\n\n\tend", "title": "" }, { "docid": "ac5038d3bcd23899d20ddd2b35055f1d", "score": "0.6189298", "text": "def results\n raise NotImplementedError\n end", "title": "" }, { "docid": "ea38ce57bf8148cfaf61f1033a1cd87d", "score": "0.61737293", "text": "def results\n end", "title": "" }, { "docid": "ea38ce57bf8148cfaf61f1033a1cd87d", "score": "0.61737293", "text": "def results\n end", "title": "" }, { "docid": "71d20fd7f8b67e7ee7fedfb75a5af166", "score": "0.61102265", "text": "def results\n end", "title": "" }, { "docid": "452aa011118b927bc47aa440bb7e9bb8", "score": "0.59533435", "text": "def method_missing(meth, *args, &block)\n respond_to_missing?(meth) ? result['hits']['hits'].send(meth, *args, &block) : super\n end", "title": "" }, { "docid": "1adb38f8ca6247f18d4e743ef19bf05f", "score": "0.5946388", "text": "def results(query); end", "title": "" }, { "docid": "c672b45752ce5660457b69873ad3803e", "score": "0.5936115", "text": "def result_to_metrics() end", "title": "" }, { "docid": "b0bcd60aab5200ad654321bc9cb7b0df", "score": "0.59277", "text": "def annotations; end", "title": "" }, { "docid": "b0bcd60aab5200ad654321bc9cb7b0df", "score": "0.59277", "text": "def annotations; end", "title": "" }, { "docid": "f08d07e5dae8099bbf64a6863af3e087", "score": "0.59196746", "text": "def result ; end", "title": "" }, { "docid": "cbf98a2fdadd8c472e4d86ac09ba0b47", "score": "0.58550864", "text": "def hit; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.5820978", "text": "def result; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.5820978", "text": "def result; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.5820978", "text": "def result; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.5820978", "text": "def result; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.5820978", "text": "def result; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.5820978", "text": "def result; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.5820978", "text": "def result; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.5820978", "text": "def result; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.5820978", "text": "def result; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.5820978", "text": "def result; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.5820978", "text": "def result; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.5820978", "text": "def result; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.5820978", "text": "def result; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.5820978", "text": "def result; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.5820978", "text": "def result; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.5820978", "text": "def result; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.5820978", "text": "def result; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.5820978", "text": "def result; end", "title": "" }, { "docid": "c918c608568a07ccb7942829faf6d0ff", "score": "0.5819815", "text": "def result; end", "title": "" }, { "docid": "e728551dcb7ea3ddbd43cd582aa61b1d", "score": "0.5777944", "text": "def result\n end", "title": "" }, { "docid": "b4be875a742dba037bbaed85f3e27ba2", "score": "0.5762792", "text": "def results\n end", "title": "" }, { "docid": "9ef57b7ab3128f167cac52b7b2e67ce4", "score": "0.5757082", "text": "def process_shot_result(shot_result)\n shot_result.split(/:|\\s/).each_slice(2) do |location, result|\n field[location] = result.to_sym \n has_hit(location) if field[location] == :hit\n end\n end", "title": "" }, { "docid": "d7d962a997306a2d5bad6c2a9bfaf11d", "score": "0.5727516", "text": "def annotation; end", "title": "" }, { "docid": "d7d962a997306a2d5bad6c2a9bfaf11d", "score": "0.5727516", "text": "def annotation; end", "title": "" }, { "docid": "d7d962a997306a2d5bad6c2a9bfaf11d", "score": "0.5727516", "text": "def annotation; end", "title": "" }, { "docid": "e3ccc19742f493240e1a47f06c73de12", "score": "0.57172", "text": "def parse_common_info()\n {\n 'count' => 'count',\n 'page' => 'page',\n 'first' => 'first',\n 'last' => 'last',\n 'hits'=> 'hits',\n 'carrier' => 'carrier',\n 'pageCount' => 'page_count',\n }.each do |xml_tag, func|\n @result_item.send(\"#{func}=\",\n first_item_content(\n \"/Response/Body/#{@operation[0,1].downcase + @operation[1,@operation.length]}:#{@operation}/#{xml_tag}\"))\n end\n end", "title": "" }, { "docid": "f850d9ea901411abb24998cded7ea788", "score": "0.5708456", "text": "def result_set; end", "title": "" }, { "docid": "f850d9ea901411abb24998cded7ea788", "score": "0.5708456", "text": "def result_set; end", "title": "" }, { "docid": "c1203e9865e6fd8e2c87dc3a33b4d541", "score": "0.5707851", "text": "def display_results\n end", "title": "" }, { "docid": "5aa1853ba59b0a5b72d0d6dba112e4c5", "score": "0.5707634", "text": "def process_result(result); end", "title": "" }, { "docid": "41e99ab02c51581e6490b17f3263a84c", "score": "0.56879324", "text": "def merged_result; end", "title": "" }, { "docid": "efc9be001d309ed496639cbb0bb343ab", "score": "0.568458", "text": "def completed_text_extraction\n end", "title": "" }, { "docid": "652a7a03fcc730f5f9d0ad37cbfc68eb", "score": "0.56694865", "text": "def process_metrics; end", "title": "" }, { "docid": "d89d81f6ef8bf152f6141a09fd2559e8", "score": "0.56261367", "text": "def exams_statistics\n\n end", "title": "" }, { "docid": "3407bf29aa9f244b7b6ad68932c12349", "score": "0.5623395", "text": "def results\n # do search \n found = []\n search_methods.each do |meth|\n Rails.logger.debug \"calling #{meth}...\"\n if res = self.send(meth)\n Rails.logger.debug \"#{meth} returned #{res.size} items\"\n found += res\n end\n end\n Rails.logger.debug \"Done fetching items.\"\n # Conver to unique list of timeline event objects\n post_process_results(found)\n end", "title": "" }, { "docid": "94cbb369bf4fca656348fdb066629266", "score": "0.5622856", "text": "def process_coverage_result; end", "title": "" }, { "docid": "b0f6247d6e3c62ab71750b5902b0ed66", "score": "0.56226903", "text": "def metrics; end", "title": "" }, { "docid": "b0f6247d6e3c62ab71750b5902b0ed66", "score": "0.56226903", "text": "def metrics; end", "title": "" }, { "docid": "b0f6247d6e3c62ab71750b5902b0ed66", "score": "0.56226903", "text": "def metrics; end", "title": "" }, { "docid": "b0f6247d6e3c62ab71750b5902b0ed66", "score": "0.56226903", "text": "def metrics; end", "title": "" }, { "docid": "b0f6247d6e3c62ab71750b5902b0ed66", "score": "0.56226903", "text": "def metrics; end", "title": "" }, { "docid": "b0f6247d6e3c62ab71750b5902b0ed66", "score": "0.56226903", "text": "def metrics; end", "title": "" }, { "docid": "e058ea91fdc087021358ea1d8e6679bb", "score": "0.5614586", "text": "def to_result(results, type, q)\n @type = type\n norm = {}\n norm['total'] = results['SearchResult']['Statistics']['TotalHits']\n norm['results'] = []\n norm['eds_ui_view_more'] = eds_ui_view_more(q)\n norm['local_view_more'] = local_view_more(q)\n extract_results(results, norm)\n norm\n rescue NoMethodError => e\n raise NormalizeEds::InvalidResults,\n \"Error: #{e}; Results: #{results}; Type: #{type}, q: #{q}\"\n end", "title": "" }, { "docid": "921366dd9ac3e9176b90ae2aa16e7564", "score": "0.56119144", "text": "def build_setup(hit)\n\t\t\thit = hit.stringify_keys\n\t\t\t####puts \"hit stringified is\"\n\t\t\t####puts JSON.pretty_generate(hit)\n\t\t\tsearch_result = hit['_source']\n\t\t\t#####puts \"search result is:\"\n\t\t\t#####puts search_result.to_s\n\t\t\t####puts \"suggest is:\"\n\t\t\t####puts search_result[\"suggest\"].to_s\n\t\t\toffsets = get_offsets(search_result[\"suggest\"][0][\"input\"]);\n\t\t\t#####puts \"ofsets are: #{offsets}\"\n\t\t\tsuggestion = search_result[\"suggest\"][0];\n\t\t\t#\n\t\t\t#####puts \"suggestion is :#{suggestion}\"\n\t\t\trelated_queries = suggestion[\"input\"].split(\"%\")[1].split(\"*\")[0];\n\t\t\tpre = suggestion[\"input\"].split(\"%\")[0];\n\t\t\t#####puts \"pre is :#{pre}\"\n\t\t\tinformation = pre.split(\"#\");\n\t\t\t#####puts \"information is: #{information}\"\n\t\t\tsearch_result[\"information\"] = information;\n\t\t\tstats = information[1];\n\t\t\tstats = stats.split(\",\");\n\t\t\t#####puts \"stats are :#{stats}\"\n\t\t\t## but then you need the target and everything\n\t\t\t## to be loaded on the server side itself.\n\t\t\t## is this necessary ?\n\t\t\t## 10 yr trends for ?\n\t\t\t## 10 yr trends\n\t\t\t## How does Asian Paints react on Mondays?\n\t\t\t#####puts \"information 0 is:\" \n\t\t\t#####puts information[0]\n\t\t\tstr = information[0]\n\t\t\t#####puts \"str is #{str}\"\n\n\t\t\tstring = str[offsets[0]..offsets[1]]\n\t\t\t#####puts \"string becomes: #{string}\"\n\t\t\tsearch_result[\"setup\"] = \"What happens to \" + string;\n\t\t\tsearch_result[\"setup\"] = search_result[\"setup\"].gsub(/\\-/,\" \");\n\t\t\tsearch_result[\"triggered_at\"] = search_result[\"epoch\"];\n\t\t\t#####puts JSON.pretty_generate(search_result)\n\n\t\t\tstats = stats[0..12]\n\n\t\t\t############ => NEXT PART.\n\n\t\t\tbuild_setup_actual(search_result,\"\");\n\n\t\t\tsearch_result[\"impacts\"] = [];\t\n\n\t\t\timpact = {\n\t\t\t\tstatistics: []\n\t\t\t}\n\n\t\t\t##console.log(\"setup is:\");\n\t\t\t##console.log(search_result.setup);\n\t\t\t##console.log(\"stats are:\");\n\t\t\t##console.log(stats);\n\t\t\t##console.log(\"-----------------------\");\n\n\t\t\t\n\t\t\tstats[0] = stats[0].split(\"$$\")[0];\n\t\t\t## add week.\n\t\t\t####puts \"stats are :#{stats}\"\n\t\t\tif((stats[0].to_i == 0) && (stats[1].to_i == 0))\n\n\t\t\t\n\t\t\telse\n\t\t\t\timpact[:statistics].push({\n\t\t\t\t\ttime_frame: 1,\n\t\t\t\t\ttime_frame_unit: \"days\",\n\t\t\t\t\ttime_frame_name: \"1 day\",\n\t\t\t\t\ttotal_up: stats[0].to_i,\n\t\t\t\t\ttotal_down: stats[1].to_i,\n\t\t\t\t\tmaximum_profit: stats[2].to_i,\n\t\t\t\t\tmaximum_loss: stats[3].to_i\n\t\t\t\t})\n\t\t\t\tsearch_result[\"rises_or_falls\"] = get_rises_or_falls(impact[:statistics][0]);\n\t\t\t\tsearch_result[\"percentage\"] = get_percentage(impact[:statistics][0]);\n\t\t\t\tassign_answer(search_result);\n\t\t\t\tconvert_n_day_change_to_superscript(search_result);\n\t\t\t\treplace_percentage_and_literal_numbers(search_result);\n\t\t\t\tshrink_indicators(search_result);\n\t\t\t\tstrip_period(search_result);\n\t\t\t\treplace_pattern_with_icons(search_result);\n\t\t\t\tadd_time_to_setup(search_result);\n\t\t\t\t## so this should ideally show better shit for indicator.\n\t\t\t\t## rerun test and see, next step -> backgrounds have to be better.\n\t\t\t\t## link to the actual paths\n\t\t\t\t## link to the combination pages\n\t\t\t\t## how to show multiple search results, is there any good way ?\n\n\t\t\tend\n\n\t\t\t## today finish sharing\n\t\t\t## for facebook and twitter with a chart image\n\t\t\t## and navigation ?\n\n\t\t\t#####puts \"the search result becomes finally ------>\"\n\t\t\t#####puts JSON.pretty_generate(search_result)\n\n\t\t\t#####puts \"the hit is: \"\n\t\t\t#####puts JSON.pretty_generate(hit)\n\n\t\t\t# i want to design the charts and sort this out.\n\t\t\t# that is end game for this part.\n\t\t\t# then navigation.\n\n\t\t\tset_social_parameters(hit)\n\t\t\t\n\t\t\thit\n\t\tend", "title": "" }, { "docid": "f7e37f9e0226310b4d89c1b3ae8c4db3", "score": "0.5611758", "text": "def individual_survey_result_over_time\n survey_attempt_dates\n\n# date_labels(survey_attempt_dates).each do |date|\n# trend_data << generate_trend_row(date, trend_data[0], survey_attempt_dates)\n# end \n end", "title": "" }, { "docid": "059699a7c1f30bfcb1cac130f3bc8372", "score": "0.5590459", "text": "def definition; parse_hitname; @definition; end", "title": "" }, { "docid": "0d2c45205ad45320050f7575f573e89b", "score": "0.55735505", "text": "def result_class; end", "title": "" }, { "docid": "43a971e329cee954335ed6841a881b8d", "score": "0.5566957", "text": "def result ; end", "title": "" }, { "docid": "bf658962690f9aa0d07d536cd8b1a1c7", "score": "0.5566444", "text": "def results; @result[:results] if @result != nil; end", "title": "" }, { "docid": "3d7a837269e66b4bf730d2d8f0ece954", "score": "0.55589503", "text": "def hits; @hits; end", "title": "" }, { "docid": "097fa3b0425594191e61d28759ddd366", "score": "0.55549806", "text": "def list_results\n # Interface method\n end", "title": "" }, { "docid": "61db6827be6a4d10a77e423310617269", "score": "0.5542425", "text": "def parse_common_info(doc)\n {\n 'count' => 'count',\n 'page' => 'page',\n 'first' => 'first',\n 'last' => 'last',\n 'hits'=> 'hits',\n 'carrier' => 'carrier',\n 'pageCount' => 'page_count',\n }.each do |xml_tag, func|\n @result_item.send(\"#{func}=\",\n first_item_content(doc,\n \"/Response/Body/#{@operation[0,1].downcase + @operation[1,@operation.length]}:#{@operation}/#{xml_tag}\"))\n end\n end", "title": "" }, { "docid": "5857db68322fcc4be2dd2e38cf4f4287", "score": "0.55317986", "text": "def result_description\n \"Score\"\n end", "title": "" }, { "docid": "5857db68322fcc4be2dd2e38cf4f4287", "score": "0.55317986", "text": "def result_description\n \"Score\"\n end", "title": "" }, { "docid": "2fbd1141a5d3803251f00ea5c01e38ba", "score": "0.5528794", "text": "def extract; end", "title": "" }, { "docid": "2fbd1141a5d3803251f00ea5c01e38ba", "score": "0.5528794", "text": "def extract; end", "title": "" }, { "docid": "15c4b73e78c6bd54b29111b8a665450d", "score": "0.5522856", "text": "def converter_results; end", "title": "" }, { "docid": "899599b68efe4780dc7bd2a1673caab4", "score": "0.5514524", "text": "def populate_additional_results\n end", "title": "" }, { "docid": "53cdb3647b5e76ca6e9ffc5ffc4aedcb", "score": "0.55085754", "text": "def adapt_coverage_result; end", "title": "" }, { "docid": "0d27284a31cef907dee86fde0b63f9f0", "score": "0.5504729", "text": "def user_content_helper\r\n\t\t#if the user is logged in\r\n\t\t@returns = []\r\n\t\tif session[:user_id]\r\n\t\t \t@annotations = Annotation.search(params[:search]).order(\"created_at DESC\")\r\n\t\t \tuser_annotations = []\r\n\t\r\n\t\t\tuser_annotation = []\t\t\t\r\n\t\t\tuser_id = session[:user_id]\t\t\t\t\r\n\t\t\tuser_annotation = Annotation.select(\"annotation\", \"id\", \"video_id\").where(:user_id => user_id)\r\n\t\t\tif !user_annotation.empty?\r\n\t\t\t\tfor x in user_annotation\r\n\t\t\t\t\t@returns.push(x)#.to_json)\r\n\t\t\t\tend\r\n\t\t\tend\t\t\t\r\n\t\t\tif @returns.empty?#[0].empty?\r\n\t\t\t\t@str = \"You have not submitted any annotations.\"\r\n\t\t\t\t@returns.push(@str)\r\n\t\t\tend\r\n\t\telse\r\n\t\t\t@str = \"You need to be logged in to see annotations that you have submitted.\"\r\n\t\t\t@returns.push(@str) \r\n\t\tend\r\n\t\treturn @returns\r\n\r\nend", "title": "" }, { "docid": "a8177859729aa44ed8823c244f7638b2", "score": "0.5502361", "text": "def reflect_on_all_aggregations; end", "title": "" }, { "docid": "431b5bd30b2a40d1d8f11644a0a203ee", "score": "0.54988164", "text": "def inbound\n hit_api \"https://www.googleapis.com/analytics/v3/data/ga?metrics=ga:visits&dimensions=ga:date\"\n #hit_api \"https://www.googleapis.com/analytics/v3/data/ga?metrics=ga:organicSearches,ga:CPC,ga:visits&dimensions=ga:date\"\n end", "title": "" }, { "docid": "4bf4c46d29e0185a779ebc01bd174830", "score": "0.5497092", "text": "def format_results\n formatted = []\n attrs = [:title, :description, :date_created, :date_added, :identifier, :collection_id,\n :collection_title, :episode_title, :series_title, :date_broadcast, :tags, :notes, :digital_format,\n :physical_format, :digital_location, :physical_location, :music_sound_used, :date_peg, :rights, :duration, \n :tags, :transcript_type, :notes, :token, :language, :updated_at, :date_added, :audio_files, :image_files, :entities ]\n\n if results and results.size\n results.each do |result|\n fres = { :id => result.id }\n attrs.each do |attr|\n #::STDERR.puts \"check search_attrs for '#{attr}'\"\n if result.search_attrs[attr].present?\n fres[attr] = result.search_attrs[attr]\n end\n end\n\n # child objects\n if result.search_attrs[:entities].present?\n # change key name for backcompat\n fres[:entities] = result.search_attrs[:entities].map do |ent|\n { :name => ent.entity, :category => ent.category }\n end\n end\n if result.highlighted_audio_files.present?\n fres[:highlights] = {}\n fres[:highlights][:audio_files] = result.highlighted_audio_files.map do |haf|\n { :url => haf.url, :filename => haf.filename, :id => haf.id, :transcript => haf.transcript_array }\n end\n end\n\n # add to the formatted array\n formatted.push fres\n end\n end\n return formatted\n end", "title": "" }, { "docid": "f1ad20b58c3313bed5336b06665c8c33", "score": "0.5495908", "text": "def custom_analyze\n end", "title": "" }, { "docid": "a85da9ffc9e840feb861c88b57059d1b", "score": "0.5492061", "text": "def results=(_arg0); end", "title": "" }, { "docid": "331c2d2e5c88e54bb8df574f48f4f617", "score": "0.5490379", "text": "def analyze?; end", "title": "" }, { "docid": "331c2d2e5c88e54bb8df574f48f4f617", "score": "0.5490379", "text": "def analyze?; end", "title": "" }, { "docid": "cb7148fb41f6f252d0378c53b232ec6d", "score": "0.5481707", "text": "def show_results\n end", "title": "" }, { "docid": "cc9752b2355edb29a4dc946007ce1cad", "score": "0.54712963", "text": "def annotator; end", "title": "" }, { "docid": "0dcaba08ca1ef0d24205d38742d482f0", "score": "0.5467041", "text": "def api_get_results(d,offset=0)\n start_date = d\n end_date = d + 1 \n fake_url = start_date.to_s + \"_to_\" + end_date.to_s + \"_page\" + offset.to_s\n if NewsScrapers.cache.exists? fake_url\n NewsScrapers.logger.debug(\" from cache #{fake_url}\")\n result_set = YAML::load(NewsScrapers.cache.get fake_url)\n else\n NewsScrapers.logger.debug(\" from interwebs #{fake_url}\")\n end_date = d + 1 \n result_set = Nytimes::Articles::Article.search(\n :body=>'the', \n :source=>'The New York Times', \n :begin_date=>d.year.to_s + NewsScrapers::prefix_with_zero(d.month) + NewsScrapers.prefix_with_zero(d.day), #'19890306',\n :end_date=>end_date.year.to_s + NewsScrapers::prefix_with_zero(end_date.month) + NewsScrapers.prefix_with_zero(end_date.day), #'19890307', \n :rank=>:oldest, \n :fields=>[:lead_paragraph, :section_page_facet, :abstract, :body, :title, \n :byline, :date, :word_count, :page_facet, :nytd_section_facet], \n :offset=>offset)\n NewsScrapers.cache.put fake_url, YAML::dump(result_set) \n sleep 1 # throttle a little\n end\n result_set\n end", "title": "" }, { "docid": "f163e1a8a662cd2d835abd3d3cef5982", "score": "0.54520255", "text": "def result\n end", "title": "" }, { "docid": "df5d16c196267483a360aab2ddc3e7fc", "score": "0.5451448", "text": "def index\n @results = []\n @document.bioc_doc.all_annotations.each do |a|\n e = EntityUtil.get_annotation_entity(a)\n a.locations.each do |l|\n @results << {did: @document.did, offset: l.offset, text: a.text, length: l.length, infons: a.infons }\n end\n end\n render :json => @results\n end", "title": "" }, { "docid": "29f556a78412accf226b116ae2766b1b", "score": "0.5440171", "text": "def process_results(results)\n join_headers = overlapping_result_headers(results) - all_aggregations()\n combined_results = combine_results(results, join_headers)\n return compute_metrics(combined_results)\n end", "title": "" }, { "docid": "343ed82f74dcf9711856ea1f779d3acb", "score": "0.5438581", "text": "def hit\n param_adder(v_s_hit,:hit)\n end", "title": "" }, { "docid": "49a2978670ff68e1b171a95f5aa5bd30", "score": "0.54376763", "text": "def statistics; end", "title": "" }, { "docid": "8b3d433d949d91189bd8c909b5edd7d2", "score": "0.54325026", "text": "def contractor_search_results\n end", "title": "" }, { "docid": "50992bd567f20530ffeedce6b49d491d", "score": "0.5432033", "text": "def get_metadata; end", "title": "" }, { "docid": "6e5bc5c6f10e4f72d03308b4fbf80c37", "score": "0.5421359", "text": "def result_for (label)\n (results = @results[label]) && # There are results for this tag\n results.first && # First hash in the list of results\n results.first.out[0]\n end", "title": "" }, { "docid": "b8a4230fb84492e5ec43e197171ea11f", "score": "0.54190505", "text": "def get_result(result_type) ; add_result(result_type, false) ; end", "title": "" }, { "docid": "6930aa857e6d4c02d0b7038e868af36d", "score": "0.54069823", "text": "def num_hits; parse_params; @num_hits; end", "title": "" }, { "docid": "a5ec6b4354f92076459995192bc8ab05", "score": "0.53961086", "text": "def hit\n @hit\n end", "title": "" }, { "docid": "8f97daa6e3cec018667e0b1510027c33", "score": "0.53912866", "text": "def filter_result_in_log(method_name, result)\n end", "title": "" }, { "docid": "924b523559b8739fc42e893d8a26156c", "score": "0.5388646", "text": "def get_Results()\n \t return @outputs[\"Results\"]\n \tend", "title": "" }, { "docid": "7f31526357cfa93e2839ac5537db9349", "score": "0.5386117", "text": "def result?; end", "title": "" }, { "docid": "7f31526357cfa93e2839ac5537db9349", "score": "0.5386117", "text": "def result?; end", "title": "" }, { "docid": "87cd8b9016b8f40fa05a2f6368265ad9", "score": "0.5379931", "text": "def result_tags\n \"\"\n end", "title": "" } ]
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "8706060681d727a9431bb029067a51ce", "score": "0.0", "text": "def persontype_params\n params.require(:persontype).permit(:persontype)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7943618", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.69572574", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "3d346c1d1b79565bee6df41a22a6f28d", "score": "0.6887521", "text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end", "title": "" }, { "docid": "1685d76d665d2c26af736aa987ac8b51", "score": "0.67666084", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.6733912", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "aa06a193f057b6be7c0713a5bd30d5fb", "score": "0.671326", "text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end", "title": "" }, { "docid": "b63e6e97815a8745ab85cd8f7dd5b4fb", "score": "0.6705381", "text": "def excluded_from_filter_parameters; end", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.66612333", "text": "def filtered_parameters; end", "title": "" }, { "docid": "c72da3a0192ce226285be9c2a583d24a", "score": "0.66164786", "text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end", "title": "" }, { "docid": "91bfe6d464d263aa01e776f24583d1d9", "score": "0.66156906", "text": "def permitir_parametros\n params.permit!\n end", "title": "" }, { "docid": "84bd386d5b2a0d586dca327046a81a63", "score": "0.65888846", "text": "def good_params\n permit_params\n end", "title": "" }, { "docid": "fad8fcf4e70bf3589fbcbd40db4df5e2", "score": "0.6575757", "text": "def allowed_params\n # Only this one attribute will be allowed, no hacking\n params.require(:user).permit(:username)\n end", "title": "" }, { "docid": "603f4a45e5efa778afca5372ae8a96dc", "score": "0.6572969", "text": "def param_whitelist\n [:role]\n end", "title": "" }, { "docid": "236e1766ee20eef4883ed724b83e4176", "score": "0.6572365", "text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "title": "" }, { "docid": "f5e3a87909b3e5022047b4b0a64ca154", "score": "0.65321475", "text": "def parameter_params\n params.require(:parameter).permit(:name, :code, :description, :user_id, :value, :cargapp_model_id, :active)\n end", "title": "" }, { "docid": "b453d9a67af21a3c28a62e1848094a41", "score": "0.65129966", "text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end", "title": "" }, { "docid": "58d1451e57b0e767db2fc6721dfaa6be", "score": "0.65128386", "text": "def allowed_parameters\n parameters.keys\n end", "title": "" }, { "docid": "2c8e2be272a55477bfc4c0dfc6baa7a7", "score": "0.64990044", "text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "52d4c66cc205503f7ad6a4feaedab9b8", "score": "0.6491305", "text": "def parameter_params\n params.require(:parameter).permit(:name, :value, :description)\n end", "title": "" }, { "docid": "a3dc8b6db1e6584a8305a96ebb06ad21", "score": "0.6489574", "text": "def need_params\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6476191", "text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end", "title": "" }, { "docid": "e64490ed35123aafa1b4627bd165517d", "score": "0.645836", "text": "def allowed_params\n [:title, :description, :is_template, :template_id, :user_id, :color]\n end", "title": "" }, { "docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff", "score": "0.64389294", "text": "def parameters\n params.permit(permitted_params)\n end", "title": "" }, { "docid": "bfb292096090145a067e31d8fef10853", "score": "0.6431918", "text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end", "title": "" }, { "docid": "8c384af787342792f0efc7911c3b2469", "score": "0.642512", "text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.6420569", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.6420569", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "bd826c318f811361676f5282a9256071", "score": "0.63804525", "text": "def filter_parameters; end", "title": "" }, { "docid": "6c4620f5d8fd3fe3641e0474aa7014b2", "score": "0.63736504", "text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.6355191", "text": "def check_params; true; end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.6355191", "text": "def check_params; true; end", "title": "" }, { "docid": "cac0774e508766d2f487cbca3db95df0", "score": "0.6336598", "text": "def allow_params?\n definition[:param_tokens]\n end", "title": "" }, { "docid": "37d1c971f6495de3cdd63a3ef049674e", "score": "0.6319846", "text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "55aa899fab0dfa44916f71c499998ca8", "score": "0.63113743", "text": "def parameter_params\n params.require(:parameter).permit(:key, :value)\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.6292978", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.6292978", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.6291", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.6291", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "64ea65f903dbe0c9c0cc0e9a20ed2e7f", "score": "0.6290657", "text": "def good_option_params\n permit_params\n end", "title": "" }, { "docid": "e012d7306b402a37012f98bfd4ffdb10", "score": "0.62724084", "text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end", "title": "" }, { "docid": "157e773497f78353899720ad034a906a", "score": "0.6266407", "text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end", "title": "" }, { "docid": "572f75fa86537d103ddf7b5503f06515", "score": "0.6265082", "text": "def parameter_params\n params.require(:parameter).permit(:title)\n end", "title": "" }, { "docid": "2d2af8e22689ac0c0408bf4cb340d8c8", "score": "0.6262119", "text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end", "title": "" }, { "docid": "b4ac8bc6941a87425ac2dc42a226295f", "score": "0.6258491", "text": "def filtered_params_config; end", "title": "" }, { "docid": "d18a36785daed9387fd6d0042fafcd03", "score": "0.6243215", "text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end", "title": "" }, { "docid": "63944d10aa4cde014b8332874db87cb9", "score": "0.62372005", "text": "def excluded_from_filter_parameters=(_arg0); end", "title": "" }, { "docid": "67fe19aa3f1169678aa999df9f0f7e95", "score": "0.6228103", "text": "def list_params\n params.permit(:name)\n end", "title": "" }, { "docid": "6fc2bac4c842e4285d685333ba68e5e9", "score": "0.6226018", "text": "def admin_parameter_params\n params.require(:admin_parameter).permit(:name, :inss_hour_price, :private_hour_price, :is_eval)\n end", "title": "" }, { "docid": "d8b02fce801fc219417d86d0ca117836", "score": "0.6225602", "text": "def _valid_params\n valid_params # method private cause needed only for internal usage\n end", "title": "" }, { "docid": "d8b02fce801fc219417d86d0ca117836", "score": "0.6225602", "text": "def _valid_params\n valid_params # method private cause needed only for internal usage\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.62250364", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end", "title": "" }, { "docid": "6008e8707eafce375988b3c7ccf098c3", "score": "0.62147176", "text": "def original_params; end", "title": "" }, { "docid": "4ba8f5cdb0399571d60b7242794ce47f", "score": "0.62035644", "text": "def permitted_resource_params\n params[resource.object_name].present? ? params.require(resource.object_name).permit! : ActionController::Parameters.new\n end", "title": "" }, { "docid": "356c5fd5dcbe9214f1330792fa2e18b5", "score": "0.61931455", "text": "def param_whitelist\n whitelist = [\n :name,\n :details,\n :completed,\n :started_at, :finished_at,\n :team_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:team_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "b977c2daceb28f26ee659336b2b98aa9", "score": "0.618889", "text": "def params\n raise \"Override protected method `params'.\"\n end", "title": "" }, { "docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18", "score": "0.6180647", "text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end", "title": "" }, { "docid": "706df0e25391ed2b932f54a646bb0a10", "score": "0.6180104", "text": "def list_name_param opts={}\n params.require(:list).permit(:name)\n end", "title": "" }, { "docid": "7646659415933bf751273d76b1d11b40", "score": "0.6175616", "text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end", "title": "" }, { "docid": "d3732ff42abd0a618a006d1f24e31e38", "score": "0.61731255", "text": "def add_to_filter_parameters; end", "title": "" }, { "docid": "8e54eaded22dd280d836e96375fed9a4", "score": "0.61730814", "text": "def paramun_params\n params.require(:parametre).permit!\n end", "title": "" }, { "docid": "f8c05c05fb596260a51d3ab4fb42243d", "score": "0.6172509", "text": "def required_parameters\n [ ]\n end", "title": "" }, { "docid": "19080b9212dc7ba3727f80cc9430e426", "score": "0.6172386", "text": "def special_params\n params.require(:special).permit(:name, :description, :function)\n end", "title": "" }, { "docid": "3f5347ed890eed5ea86b70281803d375", "score": "0.6163843", "text": "def user_params\n params.permit!\n end", "title": "" }, { "docid": "3da9117a80cdfd040f0f0ed9d3ffed55", "score": "0.6146083", "text": "def allowable_params(unfiltered_params)\n unfiltered_params.permit(:property_id, :branch_id, :client_name, :branch_name,\n :department, :reference_number, :address_name, :address_number, :address_street,\n :address2, :address3, :address4, :address_postcode, :country, :display_address,\n :property_bedrooms, :property_bathrooms, :property_ensuites, :property_reception_rooms,\n :property_kitchens, :display_property_type, :property_type, :property_style,\n :property_age, :floor_area, :floor_area_units, :property_feature1, :property_feature2,\n :property_feature3, :property_feature4, :property_feature5, :property_feature6,\n :property_feature7, :property_feature8, :property_feature9, :property_feature10,\n :price, :for_sale_poa, :price_qualifier, :property_tenure, :sale_by,\n :development_opportunity, :investment_opportunity, :estimated_rental_income,\n :availability, :main_summary, :full_description, :date_last_modified,\n :featured_property, :region_id, :latitude, :longitude,\n flags_attributes: [:title],\n images_attributes: [:url, :modified],\n floorplans_attributes: [:url, :modified],\n epc_graphs_attributes: [:url, :modified],\n epc_front_pages_attributes: [:url, :modified],\n brochures_attributes: [:url, :modified],\n virtual_tours_attributes: [:url, :modified],\n external_links_attributes: [:url, :description, :modified])\n end", "title": "" }, { "docid": "b9e34b5ac2955add85639f9ca0a07b7f", "score": "0.6145458", "text": "def resource_params\n permits = resource_whitelist\n params.require(model_symbol).permit(permits)\n end", "title": "" }, { "docid": "d646c7ba579499db9edadb606c8b9910", "score": "0.61444825", "text": "def permitted_params\n logger.warn \"#{self}: please override `permitted_params` method.\"\n params.require(resource_request_name).permit!\n end", "title": "" }, { "docid": "4425e2f97b4355b14334b9744f19c412", "score": "0.6143515", "text": "def additional_permitted_params\n []\n end", "title": "" }, { "docid": "4425e2f97b4355b14334b9744f19c412", "score": "0.6143515", "text": "def additional_permitted_params\n []\n end", "title": "" }, { "docid": "9b76b3149ac8b2743f041d1af6b768b5", "score": "0.61364955", "text": "def filter_params\n params.permit(\n\t\t\t\t:name,\n\t\t\t\t:sitedefault,\n\t\t\t\t:opinions,\n\t\t\t\t:contested,\n\t\t\t\t:uncontested,\n\t\t\t\t:initiators,\n\t\t\t\t:comments,\n\t\t\t\t:following,\n\t\t\t\t:bookmarks,\n\t\t\t\t:lone_wolf,\n\t\t\t\t:level_zero,\n\t\t\t\t:level_nonzero,\n\t\t\t\t:private,\n\t\t\t\t:public_viewing,\n\t\t\t\t:public_comments,\n\t\t\t\t:has_parent,\n\t\t\t\t:has_no_parent,\n\t\t\t\t:today,\n\t\t\t\t:last_week,\n\t\t\t\t:last_month,\n\t\t\t\t:last_year,\n\t\t\t\t:sort_by_created_at,\n\t\t\t\t:sort_by_updated_at,\n\t\t\t\t:sort_by_views,\n\t\t\t\t:sort_by_votes,\n\t\t\t\t:sort_by_scores,\n\t\t\t\t:who_id)\n end", "title": "" }, { "docid": "c4a951d3ba89c6d098a96d3d5a2b8643", "score": "0.61280644", "text": "def collection_permitted_params\n params.permit(:format, :page, :per_page, :sort, :include, :locale, fields: {}, filter: {})\n end", "title": "" }, { "docid": "13e3cfbfe510f765b5944667d772f453", "score": "0.6113519", "text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end", "title": "" }, { "docid": "34fb76d8decc10cd29ada824ff70ae63", "score": "0.6112032", "text": "def permitted_resource_params\n p params[object_name].present? ? params.require(object_name).permit! : ActionController::Parameters.new\n end", "title": "" }, { "docid": "9736586d5c470252911ec58107dff461", "score": "0.6106793", "text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end", "title": "" }, { "docid": "11f5f8959aba1f4022c60509f20e40af", "score": "0.61061025", "text": "def permit_params\n params[:permit]\n end", "title": "" }, { "docid": "45791845cef485d15b7014088dd0be8d", "score": "0.6105072", "text": "def allowed_params\n %i[title body]\n end", "title": "" }, { "docid": "4632c7949842c8534d66b50254032add", "score": "0.6092409", "text": "def parameterization_params\n params.permit(:name, :user_id, :number_value, :money_value)\n end", "title": "" }, { "docid": "bfa951108b69c8eed106b7ad8acbcbfd", "score": "0.60909486", "text": "def data_param\n params.permit(:value)\n end", "title": "" }, { "docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8", "score": "0.60895824", "text": "def filter_params\n end", "title": "" }, { "docid": "63f5e4e9733f9e6b3f98d5e069440292", "score": "0.6083517", "text": "def black_list_params\r\n params.require(:black_list).permit(:user)\r\n end", "title": "" }, { "docid": "6af3741c8644ee63d155db59be10a774", "score": "0.6081807", "text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end", "title": "" }, { "docid": "f70301232281d001a4e52bd9ba4d20f5", "score": "0.6079226", "text": "def room_allowed_params\n end", "title": "" }, { "docid": "44a1ec524e77d2a2c4b85e8341df27db", "score": "0.6077248", "text": "def product_params\n params.permit(:visible)\n end", "title": "" }, { "docid": "07bc0e43e1cec1a821fb2598d6489bde", "score": "0.60767365", "text": "def accept_no_params\n accept_params {}\n end", "title": "" }, { "docid": "c31ef48e8fd467d94158d7ac7f405a3f", "score": "0.60746986", "text": "def list_params\n params.permit(:id, :public_id, :name, :list, :visibility, values: [])\n end", "title": "" }, { "docid": "6bf3ed161b62498559a064aea569250a", "score": "0.60703695", "text": "def require_params\n return nil\n end", "title": "" }, { "docid": "b29cf4bc4a27d4b199de5b6034f9f8a0", "score": "0.6070048", "text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end", "title": "" }, { "docid": "a50ca4c82eaf086dcbcc9b485ebd4261", "score": "0.6069783", "text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end", "title": "" }, { "docid": "c1f13277dbc8ff3a9f65df027f9d915a", "score": "0.6063365", "text": "def permitted_params(unpermitted_params)\n unpermitted_params.permit(\n :controller,\n :action,\n :site_id,\n :format,\n :type,\n :path_contains,\n :new_url_contains,\n :tagged,\n )\n end", "title": "" }, { "docid": "cf963fb451b51d62fcc986deb020a044", "score": "0.6047726", "text": "def permit_params\n\t\t\t\teval(@configuration.get_params)\n\t\t\tend", "title": "" }, { "docid": "77b78ffc267fcf03379cf09c63ad361c", "score": "0.60399187", "text": "def gallery_params\n params.require(:gallery).permit(:name, :white_list)\n end", "title": "" }, { "docid": "be92e82ba93b35cac91b7c02d6a445f7", "score": "0.6033119", "text": "def get_params\r\n #params.require(:view_adm).permit(:name, :action_scope,:caps,:cols)\r\n params.require(:view_adm).permit!\r\n end", "title": "" }, { "docid": "8fa507ebc4288c14857ace21acf54c26", "score": "0.6029004", "text": "def strong_params\n # to dooo\n end", "title": "" }, { "docid": "5b72cb3f5ae45681ff116df46f5da01b", "score": "0.6025425", "text": "def provider_params\n params.permit(:name)\n end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60199857", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60199857", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" } ]
33d1704e8120690bf915db3df1461122
If this is a tender (second conditional), then nonsupplied materials can't have a price
[ { "docid": "9241aa9bec2e228441598d2edd5674b6", "score": "0.59623194", "text": "def check_supplied\n if !self.supplied? && self.section && self.section.document.document == nil\n self.price = nil\n end\n end", "title": "" } ]
[ { "docid": "520a338875571e197d5c906dd012acf2", "score": "0.6732988", "text": "def priceless?\n price == 0\n end", "title": "" }, { "docid": "5e306959cca4f2643e54fb35d44a2c64", "score": "0.6682662", "text": "def has_price_modifier?\n !(price_modifier_type.nil? || price_modifier_type.downcase =~ /none/)\n end", "title": "" }, { "docid": "13a9433a42ec59043b468aea0fa66b93", "score": "0.652591", "text": "def provides_price?\n false\n end", "title": "" }, { "docid": "16940f8f849a671442c0d69da2a46302", "score": "0.6420173", "text": "def check_price\n if self.price.blank?\n raise \"Must supply price for variant or master.price for product.\" if self.is_master\n self.price = calculate_price\n end\n end", "title": "" }, { "docid": "16940f8f849a671442c0d69da2a46302", "score": "0.6420173", "text": "def check_price\n if self.price.blank?\n raise \"Must supply price for variant or master.price for product.\" if self.is_master\n self.price = calculate_price\n end\n end", "title": "" }, { "docid": "7c7eb11380bede5cf8757de0b9b81995", "score": "0.64187926", "text": "def has_price?\n return !(self.our_price.nil? or self.provider_price.nil?)\n end", "title": "" }, { "docid": "7c7eb11380bede5cf8757de0b9b81995", "score": "0.64187926", "text": "def has_price?\n return !(self.our_price.nil? or self.provider_price.nil?)\n end", "title": "" }, { "docid": "c4ac9496b6246a87619f16b078aae95e", "score": "0.6383215", "text": "def free?\n self.price == 0 && self.price_per_user == 0 && self.setup_price == 0\n end", "title": "" }, { "docid": "c8599bb3c4d2dcdd6ae13417bf2fc23a", "score": "0.63701093", "text": "def custom_price?\n price_per_unit != casual_price\n end", "title": "" }, { "docid": "1689850333c38f34c4f00f64e0df0f86", "score": "0.63626134", "text": "def is_free?\n price == 0\n end", "title": "" }, { "docid": "81ac1f30b1283a57f8a80c2ec03e3b4c", "score": "0.6362047", "text": "def free?\n self.price == 0\n end", "title": "" }, { "docid": "88a093055cdc83916d24edc9cbe9a3ff", "score": "0.6352253", "text": "def check_price\n if self.customer_price.nil?\n raise \"Must supply price for variant or master.price for product.\" if self == product.master\n self.customer_price = product.master.customer_price\n end\n end", "title": "" }, { "docid": "214a2f05a77c77819b876adbdc4e600b", "score": "0.63323647", "text": "def is_free?\n return self.price == 0\n end", "title": "" }, { "docid": "de813c1edb08246a1d4bdce7d21bdb65", "score": "0.6330192", "text": "def has_price?\n !self.price.nil? && self.price > 0 # si el producto tiene un precio y es mayor a 0 (response: true or false)\n end", "title": "" }, { "docid": "1a7f0f16f1f9e6663b79c0663f7bb1d4", "score": "0.6324471", "text": "def free?\n\t\tprice.blank? || price.zero?\n\tend", "title": "" }, { "docid": "3d5801376e043ee7d244510a5c4aeef9", "score": "0.6246929", "text": "def bargain?\n price < 4\n end", "title": "" }, { "docid": "d0de7accd7148070ff07574a891d617b", "score": "0.6204555", "text": "def enable?(item)\r\n item && item.price > 0\r\n end", "title": "" }, { "docid": "749837e381781d1158a3a89f3bd88044", "score": "0.62012255", "text": "def net_price_excluded\n price * amount\n end", "title": "" }, { "docid": "c1c163c9f5aa112fd6fed10470adccb6", "score": "0.61637044", "text": "def has_price?\n\t\t!price.nil?\n\tend", "title": "" }, { "docid": "c1c163c9f5aa112fd6fed10470adccb6", "score": "0.61637044", "text": "def has_price?\n\t\t!price.nil?\n\tend", "title": "" }, { "docid": "3e4f14147e33024ff921acb6a3223922", "score": "0.61524457", "text": "def discounts_are_available\n if self.lowest_volume_price != nil\n true\n else\n false\n end\n end", "title": "" }, { "docid": "a46fb940dc4cbb75618308494700eba9", "score": "0.61449146", "text": "def provides_price?\n true\n end", "title": "" }, { "docid": "4a0aac68a63e0805572a9122b85a0640", "score": "0.6140628", "text": "def spare?\n !strike? && first_throw.to_i + second_throw.to_i == 10\n end", "title": "" }, { "docid": "e51d3d8fc09fb08292ce6bd9bdc80ee7", "score": "0.6129633", "text": "def bargain?\n price < 5\n end", "title": "" }, { "docid": "0697285182e63997b4059799ff7053e3", "score": "0.61040795", "text": "def price_required?\n self.sizes.count == 0 \n end", "title": "" }, { "docid": "cee61483cfee2b2c149dfe0c6f79cfb3", "score": "0.6096626", "text": "def tired?\n @energy < 8\n end", "title": "" }, { "docid": "461da59fa8fdba6790fc34c13fe23e6d", "score": "0.6096108", "text": "def item_required?\n return (@tool_itemcost || 0) > 0 || (@tool_itemcost_type || 0) > 0\n end", "title": "" }, { "docid": "461da59fa8fdba6790fc34c13fe23e6d", "score": "0.6096108", "text": "def item_required?\n return (@tool_itemcost || 0) > 0 || (@tool_itemcost_type || 0) > 0\n end", "title": "" }, { "docid": "f93a17e795b6d4befa67edca7876aff6", "score": "0.6087579", "text": "def redeemable?\n credits and credits > 0 and item_type != 'Credits'\n end", "title": "" }, { "docid": "a1134fa5bd31a606d95a24eb9ab0ac96", "score": "0.6085892", "text": "def need_supplies\n return @ammo < @max_ammo || @fuel < @max_fuel\n end", "title": "" }, { "docid": "31be1c7e8b3c5a55c70393c1653c8d54", "score": "0.6069838", "text": "def bargain?\n price < 30\n end", "title": "" }, { "docid": "31be1c7e8b3c5a55c70393c1653c8d54", "score": "0.6069838", "text": "def bargain?\n price < 30\n end", "title": "" }, { "docid": "5bcf9663b11a99788b8d2a8dfd993b59", "score": "0.60497516", "text": "def free? #does not go through db, called via: event1.free?\n # price == 0\n price.blank? || price.zero?\n end", "title": "" }, { "docid": "ebba5d9774f6bce37bbc5b8dce2cabb9", "score": "0.6048348", "text": "def applicable?\n amount && amount != 0\n end", "title": "" }, { "docid": "bf72b539d028e00bb6fdee51c5f48e37", "score": "0.60329443", "text": "def price_must_not_greater\n return unless self.errors.blank?\n max_price = TaskWorkOffer.where(\"task_id = ? AND worker_id = ?\", self.task_id, self.worker_id).order('price DESC').first.price rescue 0\n return if max_price == 0\n self.errors.add(:price, \"shouldn't more than the previous offer.\") if self.price.to_i >= max_price.to_i\n end", "title": "" }, { "docid": "164866a4b5418f95475622bd33ebf95e", "score": "0.60100025", "text": "def is_discounted?\n !(price >= 10)\n end", "title": "" }, { "docid": "50261b4f5bb359a92be89b1ef1e6d203", "score": "0.6006849", "text": "def reject_supply?(attributed)\n attributed['name'].blank? and attributed['ingredient_id'].blank?\n end", "title": "" }, { "docid": "0f7f55b770cdd9847ef980da92f0f419", "score": "0.6002159", "text": "def enable?(item)\n return (item.price > 0)\n end", "title": "" }, { "docid": "0f7f55b770cdd9847ef980da92f0f419", "score": "0.6001458", "text": "def enable?(item)\n return (item.price > 0)\n end", "title": "" }, { "docid": "07c2e3d4734ae8b20240a1ac6e947ce6", "score": "0.6001123", "text": "def free_plan?\n self.price == 0\n end", "title": "" }, { "docid": "087987e51875913dfb084c4c24b4b34e", "score": "0.59966207", "text": "def validate_price\n @price / @frontend_price * 100.0 >= 99.0\n end", "title": "" }, { "docid": "13c7ca3a5a9c74e997a0506ee54034ee", "score": "0.599504", "text": "def prices_are_defined_by_value_raw_material?\n price_definition_type.is_defined_by_value_raw_material?\n end", "title": "" }, { "docid": "2343a4a1b1b787ad66c3af19421cb2b9", "score": "0.598896", "text": "def must_buy_train?(entity)\n return false if entity.id == 'PEIR'\n\n super\n end", "title": "" }, { "docid": "d34f9092889339f157fe702457d9c184", "score": "0.5986842", "text": "def supply(condition = 0)\n @fuel = @max_fuel unless condition == 2\n @ammo = @max_ammo unless condition == 1\n end", "title": "" }, { "docid": "98b144384b86674dea8115e44a3e2be7", "score": "0.598253", "text": "def is_applicable?(price)\n # Hint: if price is greater than or equal to @minimum_purchase_amount, return appropriate boolean\n end", "title": "" }, { "docid": "a32ea15ef85becaf56eaa6c7f7c40de8", "score": "0.59767836", "text": "def single?\n !is_strike && !is_spare\n end", "title": "" }, { "docid": "a32ea15ef85becaf56eaa6c7f7c40de8", "score": "0.59767836", "text": "def single?\n !is_strike && !is_spare\n end", "title": "" }, { "docid": "4d05b602ac83b8c1a8a65781d9091115", "score": "0.59615153", "text": "def is_valid_price?(price)\n price > 0.00\n end", "title": "" }, { "docid": "dc2ebca7bb9832ffc22c697e61d3dc7f", "score": "0.59593546", "text": "def multipricing?\n if pricingset && pricingset&.active && pricingset&.pricingoptions&.with_preset&.count > 0 && !free?\n #(type == \"StandardEvent\" || type == \"IndividualEvent\" || type == \"BundleEvent\" || type == \"OnlineEvent\")\n true\n else\n false\n end\n end", "title": "" }, { "docid": "eb33a7498bc4bd0e1d09c68f834a795d", "score": "0.5955917", "text": "def PrizeLevelsExceeding1\n if @price.level>1\n true\n end\n end", "title": "" }, { "docid": "1533c65e846f1a429329e780287c71a8", "score": "0.5948651", "text": "def bargain?\n price < 30\nend", "title": "" }, { "docid": "9acf67e999e849dc3902607f4e6147b8", "score": "0.59424675", "text": "def restrict_purchase\n return false unless price_group && product\n !can_purchase?\n end", "title": "" }, { "docid": "cb7b1082a503b6967b36c9d4b1005c30", "score": "0.5924686", "text": "def check_third_throw_not_needed\n if number != 10 || !(strike? || spare?)\n errors.add(:third_throw, \"added but not needed.\") if third_throw\n end\n end", "title": "" }, { "docid": "9f2a5a5ed9c324dbc689e21933c91a59", "score": "0.5920503", "text": "def officer?\n self.tier >= 2\n end", "title": "" }, { "docid": "350ee6ddeb490a82168523a7346aac30", "score": "0.59205", "text": "def can_buy?(unit)\n self.gold >= unit.unit_property.price \n end", "title": "" }, { "docid": "11c80df172d5677288511e2b8521f32b", "score": "0.5909766", "text": "def insufficient_stock?(n)\n !sufficient_stock?(n)\n end", "title": "" }, { "docid": "302dd87cc3294c38fd5c1b55703bbf31", "score": "0.59093696", "text": "def dynamic_price_invalid?\n\n params = getPricingParamsHash\n \n #puts\n #params.each {|key, value| puts \"#{key}: #{value}\"}\n\n # ----------------------------------------------\n # product.js.coffee:\n # Spree.calcNumberOfWidths ( width )\n # Spree.calcPrice ( drop )\n # Spree.recalcPriceOnLining (lining)\n # ----------------------------------------------\n\n calc_width = width + params[:returns_addition]\n \n # -------------------------------\n # heading = \"pencil pleat\"\n # params[:pencil_pleat_multiple]\n # -------------------------------\n multiple = params[\"#{heading.gsub(/ /,'_')}_multiple\".to_sym]\n \n calc_width *= multiple\n calc_width += params[:side_hems_addition]\n number_of_widths = (calc_width / params[:fabric_width]).ceil\n \n cutting_len = drop + params[:turnings_addition]\n if (params[:pattern_repeat] > 0)\n repeat_len_multiple = (cutting_len / params[:pattern_repeat]).ceil\n cutting_len = params[:pattern_repeat] * repeat_len_multiple\n end\n \n # Convert to meters to calc price based on \"£/m\"\n required_fabric_len = Float(cutting_len * number_of_widths)/100\n \n # Multiply by 100 to convert to pence, round to nearest penny, then convert back to pounds by dividing by 100, simples...\n price = Float((required_fabric_len * params[:price_p_m] * 100).round) / 100\n \n # ------------------------------\n # lining = \"cotton\"\n # params[:cotton_lining]\n # params[:cotton_lining_labour]\n # ------------------------------\n lining_cost = Float(required_fabric_len * params[\"#{lining}_lining\".to_sym])\n lining_labour_cost = Float(required_fabric_len * params[\"#{lining}_lining_labour\".to_sym])\n \n total_price = price + lining_cost + lining_labour_cost\n total_price = Float((total_price * 100).round) / 100\n \n # 8/8/14 DH: The RSpec 'features/dynamic_price_spec.rb' uses 'self.alterDynamicPrice(alteration)'\n # and runs under the 'test' env so doesn't need this \"trap\"\n if ENV['RAILS_ENV'] == 'development'\n if line_item.price == 53.40\n return true # ie don't fink so...boooard's don't fight back...\n end\n end # END: if ENV['RAILS_ENV'] == 'development'\n\n\n # 21/7/14 DH: Match the prices to the nearest pound\n \n # 8/8/14 DH: Potentially this could reject a valid price due to rounding error since £52.99 would be \n # considered valid for £53.00 by a human!\n # (Anyway the dynamic price algorithm is only valid in Kendall-land so potential bug just noted!)\n if (line_item.price.floor == total_price.floor)\n return false # ie OK\n else\n return true # ie invalid\n end\n \n end", "title": "" }, { "docid": "f30e819e990e39b5a9573be467823fd4", "score": "0.59047407", "text": "def check_price\n if price.nil? && Spree::Config[:require_master_price]\n return errors.add(:base, :no_master_variant_found_to_infer_price) unless product&.master\n return errors.add(:base, :must_supply_price_for_variant_or_master) if self == product.master\n\n self.price = product.master.price\n end\n if price.present? && currency.nil?\n self.currency = Spree::Store.default.default_currency\n end\n end", "title": "" }, { "docid": "f975e25c216d03598747f18fb0f7b518", "score": "0.5891101", "text": "def is_meter\n product.product_family.is_meter || false\n end", "title": "" }, { "docid": "2482b93a46e2f149311f749a1a72defd", "score": "0.58581525", "text": "def variable_price?\n is_variable\n end", "title": "" }, { "docid": "136663556f75d22f1bcf8281e72bb68a", "score": "0.5846907", "text": "def free?\n CalcTotal::get_price(@listing.premium?) == 0.00 rescue true\n end", "title": "" }, { "docid": "4ca613c049ba4115736af37f5d94a85c", "score": "0.5833132", "text": "def missing_usd_price?\n not has_price_in_currency?('USD')\n end", "title": "" }, { "docid": "01a8807f5ddfc88a5601a0b62f53ca0f", "score": "0.5831839", "text": "def free?\n if prices.blank?\n !word_document.paid?\n else\n current_price.retail_price == 0 && prices.length == 1\n end\n end", "title": "" }, { "docid": "9fbc41bcab2aaeb0f4a88e0c49132237", "score": "0.58294797", "text": "def trial?\n !price_tests.any?\n end", "title": "" }, { "docid": "1ef8f67bfc027d22c8d2ccc97c709628", "score": "0.5827335", "text": "def supplier_orderable?\n !self.service? and !self.from_stock?\n end", "title": "" }, { "docid": "c1cb09d96c33fa581b2bd1f79a81d848", "score": "0.58202505", "text": "def price_is_right(bids, actual_retail_price)\nend", "title": "" }, { "docid": "6d7ff7be977f68febdc97b5f18a49455", "score": "0.58106244", "text": "def price_to_be_announced?\n unless self.product_supplies.empty? || self.product_supplies.first.supply_details.empty?\n unpriced_item_type = self.product_supplies.first.supply_details.first.unpriced_item_type\n end\n unpriced_item_type ? unpriced_item_type.human == \"PriceToBeAnnounced\" : false\n end", "title": "" }, { "docid": "8d91b6bb486fcf31e89405a43d790bc7", "score": "0.5787089", "text": "def is_discounted?\n price > 10 && false\n end", "title": "" }, { "docid": "a8267f64cbf95b14a4c5367bf0a0b0d0", "score": "0.57774353", "text": "def price\n\t\tsuper.present? && super > 0 ? super : nil\n\tend", "title": "" }, { "docid": "455d5ffa4a811bfa91604643a1e28dfc", "score": "0.5773312", "text": "def price_more_than_zero\n \terrors.add(:price, 'should be more than 0') if price.nil? || price < 0.01\n end", "title": "" }, { "docid": "4de1b9f94be38fb29778f3fd59df45b6", "score": "0.5769973", "text": "def available?(quantity)\n if quantity > self.quantity || quantity <= 0\n return false\n end\n\n case self.type.name\n when \"EVEN\"\n if quantity%2 == 0\n return true\n end\n raise TicketNotEvenQuantity\n when \"ALL_TOGETHER\"\n if quantity == self.quantity\n return true\n end\n raise TicketNotAllTogether\n when \"AVOID_ONE\"\n if self.quantity - quantity > 1 || self.quantity - quantity == 0\n return true\n end\n raise TicketNotAvoidOne\n else\n return false\n end\n end", "title": "" }, { "docid": "c6227f7e0f3958efd6cd1f906c946c76", "score": "0.5763752", "text": "def ticket_type_price\n ticket_type.price unless nil\n end", "title": "" }, { "docid": "36c67f780b8a8a29720559bcc1d87c64", "score": "0.5762523", "text": "def individual_price\n if price.present?\n price\n elsif !participation_request.course.no_trial?\n participation_request.course.prices.where(type: 'Price::Trial').first ||\n participation_request.course.prices.first\n end\n end", "title": "" }, { "docid": "c1c9b0f10de776160d38c71db871e4a3", "score": "0.5755479", "text": "def selling_price_is_less_than_or_equal_to_price\n errors.add(:selling_price, \"should be less than or equal to price\") if selling_price.present? && selling_price.to_f > price.to_f\n end", "title": "" }, { "docid": "9999d9b41e4fdd35441f693e2bc729ee", "score": "0.574945", "text": "def variable_price?\n rewards.select{|r| r.variable_price? }.any?\n end", "title": "" }, { "docid": "53b23cc578f4620b19969986d5b081d1", "score": "0.574645", "text": "def has_to_be_rejected?\n self.amount.blank?\n end", "title": "" }, { "docid": "db997defb711d29b20c77bb149a276bc", "score": "0.57450074", "text": "def retail_price_logic\n rp = read_attribute(:retail_price)\n (rp.nil? || rp.blank? || rp.zero?) ? price : rp\n end", "title": "" }, { "docid": "54083859b6c820e44e9807b0cb73b7f4", "score": "0.5744507", "text": "def validate\n price_cents <= 0 ? raise(InvalidProductPriceCents) : true\n end", "title": "" }, { "docid": "09a4d84e3264c0e6c86fd72c02ad361b", "score": "0.5742308", "text": "def non_individual_buyer?\n return false if @buyers.blank?\n\n @buyers.values.detect { |buyer| buyer.type != 'PRIVATE' }.present?\n end", "title": "" }, { "docid": "47c42bbd91d2017918c0b49ff40ed5ea", "score": "0.5740484", "text": "def low_point_cannot_make_task\n app = ApplicationController.new\n point = app.caculate_point(self)\n errors.add(:price) if self.price.nil?\n price = self.price.nil? ? 0 : self.price\n errors.add(:price, \"not enough\") if\n self.user.account_credit < point or self.user.account_money < price\n end", "title": "" }, { "docid": "840e5fa8550f1f68b2fd8c9f98fe6655", "score": "0.5735915", "text": "def enough_coins?\n self.coins >= self.price\n end", "title": "" }, { "docid": "0705c798b716cfb697f7031993b9a017", "score": "0.57354105", "text": "def bust?\n hand_total > 21\n end", "title": "" }, { "docid": "0052668316e727150bdd71ca171bfbe5", "score": "0.57331574", "text": "def acceptable_price_point?(point)\n if self.new_record? and point['mode'] == 'single'\n true #Always keep the initial single point to validate it\n elsif !(point['volume'].blank? or point['volume'] == '0')\n true #A sensible volume was provided\n elsif !(point['display_price'].blank? or point['display_price'] == '0' or point['display_price'] == '$0.00')\n true #A sensible price was provided\n else\n false #Looks like we can ditch this price point\n end\n end", "title": "" }, { "docid": "c59e4dc34fd9a3b8afccffca733f38f4", "score": "0.5723455", "text": "def valid_for?(items)\n return false if qty_threshold && valid_items(items).count < qty_threshold\n return false if spend_threshold && valid_items(items).map(&:price).reduce(&:+) < spend_threshold\n true\n end", "title": "" }, { "docid": "47af5be2835b0f7c45babc8dc7979cf8", "score": "0.57225287", "text": "def planets_requirement_met?(player)\n check_planets!(upgrading? ? level + 1 : level, player)\n true\n rescue GameLogicError\n false\n end", "title": "" }, { "docid": "1d63799887b874843326c7d767ed0472", "score": "0.5720333", "text": "def price_and_percent_are_mutually_exclusive\n if price_cents.present? && percent.present?\n add_mutually_exclusive_error\n elsif price_cents.nil? && percent.nil?\n errors.add(:percent, 'must be present if \"price\" is blank')\n end\n end", "title": "" }, { "docid": "1433f01a16b6fd7b9d8cfbb68023f019", "score": "0.57176465", "text": "def price\n nil\n end", "title": "" }, { "docid": "17adabb6e7e14087f3826851c8483c8a", "score": "0.57154936", "text": "def valid_price?(price)\r\n Security::StringChecker.is_numeric?(price) && price.to_i > 0\r\n end", "title": "" }, { "docid": "c72b9b0ccd9df1c26f78f7772a5046c6", "score": "0.57088476", "text": "def check_for_tea_info\n self.ingredients.length > 0 && self.description.length > 0 && self.pricing.length > 0 \n end", "title": "" }, { "docid": "5f91f92f4622ec555be8c5e7df416991", "score": "0.5699663", "text": "def price_id_useful?()\n return false\n end", "title": "" }, { "docid": "3c6f03150be79e04e2ef00f9612f43e8", "score": "0.56987244", "text": "def disability_amount\n return 0 if seniority < 2\n return 0 if months_disabled > 12\n return 0 if is_part_time?\nend", "title": "" }, { "docid": "ed704e389bb217d5e8de1b3dddc2723a", "score": "0.56879663", "text": "def verify_price(price)\n if price <= 0\n raise ArgumentError, 'Price cannot be below $0.00'\n end\n end", "title": "" }, { "docid": "0bc7d654c1bf2bdcc71a33ce53c0303b", "score": "0.5678609", "text": "def valid_price?(price)\n Security::StringChecker.is_numeric?(price) && price.to_i > 0\n end", "title": "" }, { "docid": "b2d661d4f22cebd1ab39523f5dee18ae", "score": "0.56780607", "text": "def can_you_give_me_a_treasure #VIGILARLA\n \n if(!@hidden_treasures.isEmpty)\n true\n else\n false\n end\n end", "title": "" }, { "docid": "39e71a455c046b330e62232f50fde008", "score": "0.5677584", "text": "def selling_price_is_less_than_or_equal_to_price\n errors.add(:selling_price, \"should be less than or equal to price\") if selling_price.present? && selling_price.to_f > price.to_f\n end", "title": "" }, { "docid": "912534593d06fa547c22708f7ccafc0b", "score": "0.5673582", "text": "def pmi_required?\n required_mortgage > ((1 - REQUIRED_EQUITY) * equity_after_sale)\n end", "title": "" }, { "docid": "db6edefded2b1fb3d083abcb3fee9fea", "score": "0.5673202", "text": "def more_expensive_than?(other_price)\n Float(self.price) > Float(other_price)\n end", "title": "" }, { "docid": "f712d3343c0e8f692020b2a8c5af50b8", "score": "0.56728244", "text": "def price_is_gross?\n !price_is_net?\n end", "title": "" }, { "docid": "06f215a6a7ff4faec2fd04687f4809d4", "score": "0.56717587", "text": "def check_second_throw_not_needed\n if number != 10 && strike?\n errors.add(:second_throw, \"added but not needed.\") if second_throw\n end\n end", "title": "" }, { "docid": "48c27e5fbce3184b348f49dc18e2b485", "score": "0.56715083", "text": "def is_for_rent\n if self.rents.size > 0\n return true\n else\n return false\n end\n end", "title": "" } ]
8e1ac01d6fb40864d396f8eb840023ba
GET /comments GET /comments.xml
[ { "docid": "49ca28a9dad77b185d48297aa65cc768", "score": "0.65127254", "text": "def index\n @comments = Comment.find(:all, :conditions => ['published = ?', false], :order => 'created_at DESC')\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @comments }\n end\n end", "title": "" } ]
[ { "docid": "85d82f5086bd638b99c7f497cac5ab7e", "score": "0.726993", "text": "def get_comments\n Comment.build_from_xml(@xml['comments'])\n end", "title": "" }, { "docid": "3f6dd876e9c56f95f45055d241b43d00", "score": "0.7148502", "text": "def comments tag\n path = \"/comment/#{tag}/show.xml\"\n doc = http_get path\n \n comments = []\n xpath(doc, \"//comment\").each do |entry|\n comments << Comment.new(:xml => entry)\n end\n comments\n end", "title": "" }, { "docid": "8738115c5acaf73adcb8020353eb2410", "score": "0.694906", "text": "def index\n @comments = Comment.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @comments }\n end\n end", "title": "" }, { "docid": "6336af7657aec205ca8f72d2be345546", "score": "0.6917307", "text": "def index\n @comments = @commentable.comments\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @comments }\n end\n end", "title": "" }, { "docid": "23981ddd61fbeac7e4ddf3a6b74e65cc", "score": "0.6904141", "text": "def index\n @commentable = find_commentable\n @comments = @commentable.comments\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @comments }\n end\n end", "title": "" }, { "docid": "ab3b1c4012ce7ceb603e3e5117779a46", "score": "0.6871063", "text": "def index\n @comments = Comment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @comments }\n end\n end", "title": "" }, { "docid": "ab3b1c4012ce7ceb603e3e5117779a46", "score": "0.6871063", "text": "def index\n @comments = Comment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @comments }\n end\n end", "title": "" }, { "docid": "ab3b1c4012ce7ceb603e3e5117779a46", "score": "0.6871063", "text": "def index\n @comments = Comment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @comments }\n end\n end", "title": "" }, { "docid": "ab3b1c4012ce7ceb603e3e5117779a46", "score": "0.6871063", "text": "def index\n @comments = Comment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @comments }\n end\n end", "title": "" }, { "docid": "ab3b1c4012ce7ceb603e3e5117779a46", "score": "0.6871063", "text": "def index\n @comments = Comment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @comments }\n end\n end", "title": "" }, { "docid": "ab3b1c4012ce7ceb603e3e5117779a46", "score": "0.6871063", "text": "def index\n @comments = Comment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @comments }\n end\n end", "title": "" }, { "docid": "ab3b1c4012ce7ceb603e3e5117779a46", "score": "0.6871063", "text": "def index\n @comments = Comment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @comments }\n end\n end", "title": "" }, { "docid": "b1eab2d35c6779f63665d2f238455f77", "score": "0.68531764", "text": "def index\n\t\t# TODO redirect_to somewhere !?\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.xml { render :xml => @comments }\n\t\tend\n\tend", "title": "" }, { "docid": "32c987bead6e8510cbd5f6962fde9471", "score": "0.6824189", "text": "def show\n respond_to do |format|\n format.json { render json: @comment }\n format.xml { render xml: @comment }\n end\n end", "title": "" }, { "docid": "ac260c6e8b90b33ed2ad83543ee9966d", "score": "0.6790645", "text": "def show\n @ccomment = Ccomment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ccomment }\n end\n end", "title": "" }, { "docid": "51a5b5135fae9b718730d85820946b9f", "score": "0.6770796", "text": "def comments(params = {})\n merged_params = default_params.merge(params)\n uri = Osmek::Uri.new('feed/comments')\n request = Osmek::Request.new(uri, merged_params)\n request.perform\n end", "title": "" }, { "docid": "2369a7e706f262b7d44cb24dbd0c576c", "score": "0.67375267", "text": "def show\n @comment = @activity.comments.find(params[:id])\n respond_to do |format|\n format.html\n format.xml { render :xml => @comment.to_xml(:include => :user, :except => NB_CONFIG['api_exclude_fields']) }\n format.json { render :json => @comment.to_json(:include => :user, :except => NB_CONFIG['api_exclude_fields']) }\n end\n end", "title": "" }, { "docid": "4da88c4aae276bed72adc3a725f898cf", "score": "0.6693755", "text": "def index\n @post = Post.find(params[:post_id])\n @comments = @post.comments.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @comments }\n end\n end", "title": "" }, { "docid": "a3b36914dd4ebddf7dd845a871ae30a7", "score": "0.6680867", "text": "def index\n @comments = Comment.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @hiring_comments }\n end\n end", "title": "" }, { "docid": "8efdfc5429dedc53c7de7cd640396bfb", "score": "0.6660124", "text": "def getComments\r\n\tend", "title": "" }, { "docid": "b9cc6c80dd70a095afc75669618f6141", "score": "0.66364276", "text": "def show\n @comment = Comment.find(params[:id])\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @comment.to_xml }\n end\n end", "title": "" }, { "docid": "4447c95fefbb72f8a378ce8a783a58da", "score": "0.66201764", "text": "def comments\n Sifter.\n get(api_comments_url).\n fetch(\"comments\", []).\n map { |i| Sifter::Comment.new(i) }\n end", "title": "" }, { "docid": "b8361361e62c62dbaeba0f9b9c057617", "score": "0.65909034", "text": "def show\n @comment = @post.comments.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @comment }\n end\n end", "title": "" }, { "docid": "f0d21c37acc76fc8b83b440ca18511b0", "score": "0.6575951", "text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @comment }\n end\n end", "title": "" }, { "docid": "f0d21c37acc76fc8b83b440ca18511b0", "score": "0.6575951", "text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @comment }\n end\n end", "title": "" }, { "docid": "f0d21c37acc76fc8b83b440ca18511b0", "score": "0.6575951", "text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @comment }\n end\n end", "title": "" }, { "docid": "f0d21c37acc76fc8b83b440ca18511b0", "score": "0.6575951", "text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @comment }\n end\n end", "title": "" }, { "docid": "f0d21c37acc76fc8b83b440ca18511b0", "score": "0.6575951", "text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @comment }\n end\n end", "title": "" }, { "docid": "f0d21c37acc76fc8b83b440ca18511b0", "score": "0.6575951", "text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @comment }\n end\n end", "title": "" }, { "docid": "f0d21c37acc76fc8b83b440ca18511b0", "score": "0.6575951", "text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @comment }\n end\n end", "title": "" }, { "docid": "f0d21c37acc76fc8b83b440ca18511b0", "score": "0.6575951", "text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @comment }\n end\n end", "title": "" }, { "docid": "f0d21c37acc76fc8b83b440ca18511b0", "score": "0.6575951", "text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @comment }\n end\n end", "title": "" }, { "docid": "f0d21c37acc76fc8b83b440ca18511b0", "score": "0.6575951", "text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @comment }\n end\n end", "title": "" }, { "docid": "f0d21c37acc76fc8b83b440ca18511b0", "score": "0.6575951", "text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @comment }\n end\n end", "title": "" }, { "docid": "f0d21c37acc76fc8b83b440ca18511b0", "score": "0.6575951", "text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @comment }\n end\n end", "title": "" }, { "docid": "f0d21c37acc76fc8b83b440ca18511b0", "score": "0.6575951", "text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @comment }\n end\n end", "title": "" }, { "docid": "f0d21c37acc76fc8b83b440ca18511b0", "score": "0.6575951", "text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @comment }\n end\n end", "title": "" }, { "docid": "f0d21c37acc76fc8b83b440ca18511b0", "score": "0.6575951", "text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @comment }\n end\n end", "title": "" }, { "docid": "f0d21c37acc76fc8b83b440ca18511b0", "score": "0.6575951", "text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @comment }\n end\n end", "title": "" }, { "docid": "f0d21c37acc76fc8b83b440ca18511b0", "score": "0.6575951", "text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @comment }\n end\n end", "title": "" }, { "docid": "f0d21c37acc76fc8b83b440ca18511b0", "score": "0.6575951", "text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @comment }\n end\n end", "title": "" }, { "docid": "f0d21c37acc76fc8b83b440ca18511b0", "score": "0.6575951", "text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @comment }\n end\n end", "title": "" }, { "docid": "f0d21c37acc76fc8b83b440ca18511b0", "score": "0.6575951", "text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @comment }\n end\n end", "title": "" }, { "docid": "f0d21c37acc76fc8b83b440ca18511b0", "score": "0.6575951", "text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @comment }\n end\n end", "title": "" }, { "docid": "f0d21c37acc76fc8b83b440ca18511b0", "score": "0.6572712", "text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @comment }\n end\n end", "title": "" }, { "docid": "a7ee81ebb3e29efd5882a91caf2d8be7", "score": "0.6559032", "text": "def show\n @comment = Comment.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @comment }\n end\n end", "title": "" }, { "docid": "99233441b640876c3d721b0bc8a1d6d4", "score": "0.6554955", "text": "def show\n @comment = Comment.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @comment }\n end\n end", "title": "" }, { "docid": "99233441b640876c3d721b0bc8a1d6d4", "score": "0.6554955", "text": "def show\n @comment = Comment.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @comment }\n end\n end", "title": "" }, { "docid": "3f5e0d8ecda112f4bbc5bc12ad853c96", "score": "0.65259063", "text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @comment }\n end\n end", "title": "" }, { "docid": "baf4f27ff98d0a92364d88e8404bc694", "score": "0.6522081", "text": "def show\n @commentable = find_commentable\n @comment = @commentable.comments.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @comment }\n end\n end", "title": "" }, { "docid": "934b852e3aa55b01ef52fac23c4b87b5", "score": "0.65029377", "text": "def get_comments\n url = params[:ifq_url]\n \n comments_id = get_comments_id(url) \n unparsed_comments = get_unparsed_comments(comments_id)\n comments = parse_comments(unparsed_comments)\n respond_to do |format|\n format.json {render json: {comments: comments}}\n end\n end", "title": "" }, { "docid": "c0a90b898cd1f1161363a685e7aaa389", "score": "0.6498721", "text": "def show\n @title=\"Comments\"\n @comment = @conversation.comments.find(params[:id])\n\n respond_to do |format|\n format.html { redirect_to(conversation_path(@conversation)) }\n format.xml { render :xml => @comment }\n end\n end", "title": "" }, { "docid": "5657db2bafb9aae789d1cd3bc7db3649", "score": "0.64745957", "text": "def index\n @bug = Bug.find(params[:bug_id])\n @comments = @bug.comments.paginate(:page => params[:page])\n flash[:notice] = \"Comments found (#{@comments.size}).\"\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @comments }\n end\n end", "title": "" }, { "docid": "88d3e5f43b9db5c9a37963b1295eef91", "score": "0.647357", "text": "def index\n respond_to do |format|\n format.html { render :template => 'layouts/404', :status => 404 }\n format.xml do\n @comments = Article.find(params[:article_id]).comments\n render :xml => @comments\n end\n end\n end", "title": "" }, { "docid": "0c43ca9952ff718cbbcce0fb515adfbc", "score": "0.6468448", "text": "def index\n @title=\"Comments\"\n @comments = @conversation.comments.all\n\n respond_to do |format|\n format.html { redirect_to(conversation_path(@conversation)) }\n format.xml { render :xml => @comments }\n end\n end", "title": "" }, { "docid": "b5b1d1bc9e08ec60d609f50f24be1e8f", "score": "0.64424473", "text": "def show\n @requests_request_commentary = Requests::RequestCommentary.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @requests_request_commentary }\n end\n end", "title": "" }, { "docid": "98a7b48a9d1480f5cf7b7522c9961be8", "score": "0.6434226", "text": "def show\n @network = Network.find(params[:id])\n # TODO Ajax pagination\n @comments = @network.comments.find(:all, :order => 'created_at DESC')\n @comment_pages = @comments.paginate :page => params[:page], :per_page => 5\n @comment = @network.comments.build\n respond_to do |format|\n format.html # show.html.erb\n format.rss { render :layout => false }\n format.xml { render :xml => @network } \n end\n end", "title": "" }, { "docid": "53bf04a59812eeed34170ff33fc14e4d", "score": "0.6422192", "text": "def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @comment }\n format.json\n end\n end", "title": "" }, { "docid": "9dcc82e9f9aac2c9a55bf4bff7a7395f", "score": "0.6420754", "text": "def show\n @article_comments = Admin::ArticleComments.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @article_comments }\n end\n end", "title": "" }, { "docid": "e10b830a0e846fc770937e26c4a1dce5", "score": "0.64081395", "text": "def comments\n response[\"comments\"]\n end", "title": "" }, { "docid": "f670e41e5dab4d3bb730900cc224b636", "score": "0.64029104", "text": "def show\n @scomment = Scomment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @scomment }\n end\n end", "title": "" }, { "docid": "9ab19df8284f5246505eaba8ede033cf", "score": "0.63883615", "text": "def show\n @post = Post.find(params[:post_id])\n @comment = @post.comments.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @comment }\n end\n end", "title": "" }, { "docid": "4a0f48a52d54a4211b6cee39e42241b6", "score": "0.63812035", "text": "def show\n challenge = Challenge.find(params[:challenge_id])\n @comment = challenge.comments.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @comment }\n end\n end", "title": "" }, { "docid": "0f689ad6cf310cbcd170899917b6eab5", "score": "0.63743633", "text": "def show\n @newcomment = Newcomment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @newcomment }\n end\n end", "title": "" }, { "docid": "55920c6ebbd82293a317641928b141d8", "score": "0.63695955", "text": "def index\n @texto = Texto.find(params[:texto_id])\n @comments = @texto.comments\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @comments }\n end\n end", "title": "" }, { "docid": "fd9e3c90ca775ca669db3af1957a8558", "score": "0.6366724", "text": "def comment(comment, options = {})\n get \"comments/#{comment}\", options\n end", "title": "" }, { "docid": "3d88249e2d16dd5aa1ed3fe94774fdef", "score": "0.6360521", "text": "def comments\n request_str = \"/gallery/appliances/#{id.to_i}/comments\"\n response = GenericRequest.new(self.class.studio_connection).get request_str\n tree = XmlSimple.xml_in response, \"ForceArray\" => [\"comment\"]\n tree[\"appliance\"][\"comments\"][\"comment\"].collect do |c|\n Comment.parse(self,c)\n end\n end", "title": "" }, { "docid": "4e4b3a139f498b748dacb2228ee399e9", "score": "0.63370246", "text": "def index\n @question_comments = QuestionComment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @question_comments }\n end\n end", "title": "" }, { "docid": "bf870f9f333dab3bc42cfa9417ad1560", "score": "0.62954164", "text": "def get_comments options\n make_request :get, APPS_URL, :comments, options, [:docid, :groupid, :start, :count]\n end", "title": "" }, { "docid": "eca1a65368e92fc769206e583b883713", "score": "0.6293017", "text": "def index\n @comments = @entry.comments\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @comments }\n end\n end", "title": "" }, { "docid": "f8d172198f7cb70d48e87e1ac32a4d76", "score": "0.6280709", "text": "def object_comments object_id\n response = get(\"/#{object_id}/comments\")\n end", "title": "" }, { "docid": "2fb92be9364f1dcb2d08d9195391f500", "score": "0.62641865", "text": "def comments\n Comment.all\n end", "title": "" }, { "docid": "1d4730541bfe9ce535a3ee75c3a6c776", "score": "0.6260283", "text": "def get_comments id, vimeo, xml=nil\n comments = Array.new\n url = vimeo.generate_url({\"method\" => \"vimeo.videos.comments.getList\",\n \"video_id\" => id, \"api_key\" => vimeo.api_key}, \"read\")\n unless xml\n #does not get covered by specs because we get an internal xml file\n xml_data = Net::HTTP.get_response(URI.parse(url)).body\n else\n xml_data = File.open(File.join(File.dirname(xml), File.basename(xml, '.xml')+'.comments.xml'))\n end\n xml_doc = REXML::Document.new(xml_data)\n \n xml_doc.elements.each('rsp/comments/comment') do |comment|\n id = comment.attributes[\"id\"].to_i\n author = comment.attributes[\"author\"]\n authorname = comment.attributes[\"authorname\"]\n date = comment.attributes[\"datecreate\"]\n url = comment.attributes[\"permalink\"]\n text = comment.text\n @portraits = Array.new\n xml_doc.elements.each('rsp/comments/comment/portraits/portrait') do |thumb|\n portrait_url = thumb.text\n w = thumb.attributes[\"width\"].to_i\n h = thumb.attributes[\"height\"].to_i\n thumbnail = Thumbnail.new(portrait_url, w, h)\n @portraits << thumbnail\n end\n com = Comment.new(id, author, authorname, date, url, text, @portraits)\n @comments << com\n end\n end", "title": "" }, { "docid": "282eb46b34d732ab2072b51695f914e0", "score": "0.62549114", "text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @comment_type }\n end\n end", "title": "" }, { "docid": "d5dfdda3d49d314a63b20197dc067bb8", "score": "0.62541753", "text": "def comments(params = {})\n if @comments.any?\n @comments\n else\n @comments = Endpoints::Comments.new(client).get(project_id, id, params)\n end\n end", "title": "" }, { "docid": "986cc2f9f7dd3cf7d961f5504b03ba58", "score": "0.62523574", "text": "def index\n @comments = Comment.find(params[:id])\n end", "title": "" }, { "docid": "b948559b6c26ca788e48294fb24b074e", "score": "0.62505245", "text": "def index\n\n @commentable = find_resource\n @comments = @commentable.comments\n\n end", "title": "" }, { "docid": "9c80e7d741942779e6102eedba9f9dda", "score": "0.6249563", "text": "def index\n params[:article_id].present? ? @comments = Article.find(params[:article_id]).comments : @comments = Comment.all\n\n respond_to do |format|\n format.json { render json: @comments }\n format.xml { render xml: @comments }\n end\n end", "title": "" }, { "docid": "5bf63fe0cfe684e5c21433594477f7e7", "score": "0.6243145", "text": "def index\n\tbegin\n\t\t@comments = Comment.order('time DESC').paginate(:page => params[:page])\n\trescue\n\t\t@comments = Hash.new\n\tend\n\t@title = \"Comments\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @comments }\n end\n end", "title": "" }, { "docid": "5177afa6a5acf15bab9f16d08d264d0f", "score": "0.6237758", "text": "def show\n @comment = @object\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @comment.to_xml(:include => convert_includes(includes),\n :dasherize => false) }\n end\n end", "title": "" }, { "docid": "c3ae4e334f860c4391d43ada22bf0ebd", "score": "0.6237521", "text": "def show\n @article = Article.find(params[:id])\n @comments = @article.comments\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @article }\n end\n end", "title": "" }, { "docid": "8404c8404ceedc541648ac1ccaeb0af0", "score": "0.6228645", "text": "def show\n @user_comment = UserComment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user_comment }\n end\n end", "title": "" }, { "docid": "5b458ba3621921501b858e30c925e6a5", "score": "0.6227315", "text": "def show\n authorize! :show, @comment\n \n respond_to do |format|\n format.html {}\n format.xml {\n fields = @logged_user.is_admin? ? [] : [:author_email, :author_homepage]\n render :xml => @comment.to_xml(:root => 'comment', :except => fields) \n }\n end\n end", "title": "" }, { "docid": "d829eb8a6c97802821a2d9b4cffbf33d", "score": "0.6196541", "text": "def index\n params[:page] = 1 if (params[:page].blank?)\n options = {\n :page => params[:page],\n :per_page => 30,\n :order => \"updated_at DESC\"\n }\n options[:approved] = params[:approved] if (not params[:approved].blank?)\n\n @comments = Comment.paginate(options)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @comments }\n end\n end", "title": "" }, { "docid": "74a310427cfa59da156ede5989ebf771", "score": "0.61909217", "text": "def index\n @location = Location.find(params[:location_id])\n @comments = @location.comments\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @comments }\n end\n end", "title": "" }, { "docid": "166aff8a6d6b9be5cd0c0ddce5f7b6ec", "score": "0.6184518", "text": "def show\n @commentary = Commentary.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @commentary }\n end\n end", "title": "" }, { "docid": "6e6716a33d0d533768d8dda12613247f", "score": "0.6180098", "text": "def show\n @book_comment = BookComment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @book_comment }\n end\n end", "title": "" }, { "docid": "d3662162f0a6343ef2e2f47256a39fd8", "score": "0.6178516", "text": "def index\n respond_with(comments)\n end", "title": "" }, { "docid": "454170f31918b558a3b11d78a336e967", "score": "0.6172978", "text": "def index\n blog = Blog.find(params[:blog_id])\n @comments = blog.comments\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @comments }\n end\n end", "title": "" }, { "docid": "92232c62e0b4c91ee72aa315fa6a7d96", "score": "0.616733", "text": "def show\n @question_comment = QuestionComment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @question_comment }\n end\n end", "title": "" }, { "docid": "8f11fe2404d0972260b438b7f98c98fa", "score": "0.61636555", "text": "def index\n\t\t@comments = Comment.order(\"post_id\")\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.json { render json: @comments }\n\t\tend\n\tend", "title": "" }, { "docid": "d968cced0c41b5684671260ee0d9ce21", "score": "0.6157479", "text": "def show\n @images = @image_content_nodes\n @comments = @weblog_post.node.comments.all(limit: 25, order: 'comments.created_at DESC')\n\n respond_to do |format|\n format.html # show.html.erb\n format.any(:rss, :atom) { render layout: false }\n format.xml { render xml: @weblog_post }\n end\n end", "title": "" }, { "docid": "c832919cbcd84a8f04c925c2625e0ced", "score": "0.6157211", "text": "def comments(options={})\n args = options.map{|k,v| \"#{k}=#{v}\"}.join('&')\n get(\"/statuses/comments.json?#{args}\")\n end", "title": "" }, { "docid": "c91f4afe367e00ce1e7d0595025c810a", "score": "0.61459863", "text": "def show\n @entry_comment = EntryComment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @entry_comment }\n end\n end", "title": "" }, { "docid": "ec521e7e6be480e047308c4c37b1e810", "score": "0.6145328", "text": "def index\n @comments = Comment.includes(:replies).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @comments }\n end\n end", "title": "" }, { "docid": "98a239d098f2b1de9281a1a22f6806a1", "score": "0.61434424", "text": "def index\n @commentable = find_commentable\n @comments = []\n if @commentable\n @comments = @commentable.comments\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: { comments: @comments } }\n end\n end", "title": "" }, { "docid": "734d9c770c07435963241cc7ded76203", "score": "0.61430264", "text": "def index\n @comments = Comment.all\n respond_with @comments\n end", "title": "" }, { "docid": "b7021490557c190908515814e720ac9d", "score": "0.61384", "text": "def load_comments user\n if @comment_count > 0\n req_uri = \"https://picasaweb.google.com/data/feed/api/user/default/albumid/#{@album_id}/photoid/#{@id}\"\n results = GoogleOAuth.make_request req_uri, {kind: \"comment\", access_token: user.access_token}, {format: \"xml\"}\n doc = Nokogiri::XML results\n entries = doc.xpath(\"xmlns:feed/xmlns:entry\")\n @comments = entries.map do |entry|\n {\n author: entry.xpath(\"xmlns:title\").text,\n content: entry.xpath(\"xmlns:content\").text\n }\n end\n end\n end", "title": "" }, { "docid": "de993c94a4667c7da274556fb98dbb18", "score": "0.61320615", "text": "def comments(media_id)\n get(\"/media/#{media_id}/comments\")\n end", "title": "" }, { "docid": "1421de47b438c4106b7ccac7a72aa8de", "score": "0.6117397", "text": "def index\n @comments = Comment.all\n respond_with(@comments)\n end", "title": "" } ]
4b4ef9d1bc183e3012c7a5791b7283d2
creates a new session token for the user
[ { "docid": "57329ba6da8930cd04c59cd11a5ff1bb", "score": "0.657381", "text": "def create_remember_token\n remember_token = User.hash(User.new_remember_token)\n end", "title": "" } ]
[ { "docid": "c8b6641edcf544fd2a8aee7f8bbbdd4a", "score": "0.77772325", "text": "def generate_session_token!\n update_attribute(:session_token, self.class.generate_token(:session_token)) unless session_token\n session_token\n end", "title": "" }, { "docid": "159ba5b7e1ae062fe13ade36293932b9", "score": "0.74121225", "text": "def create_token\n\t\tself.token = BCrypt::Password.create(User.find(self.user_id).email + Time.now.to_f.to_s)\n\tend", "title": "" }, { "docid": "a2d97e544256a0de21ed32dea06c3e45", "score": "0.73715657", "text": "def generate_auth_token\n token = AuthToken.new(user: self)\n token if token.save\n end", "title": "" }, { "docid": "cfe6f76788e8e05e09f6ebaa61deb1ac", "score": "0.729359", "text": "def create_session\n raw_token, enc_token = account.create_session(ip, meta_info)\n set_account_cache(account, raw_token)\n set_auth_token_cache(enc_token, raw_token)\n return raw_token\n end", "title": "" }, { "docid": "ce54a557ee046cde44ecc3760f35e9e8", "score": "0.72778696", "text": "def create_set_and_add_token\n token = SecureRandom.urlsafe_base64\n @user.token = token\n response.headers['X-AUTH-TOKEN'] = token\n end", "title": "" }, { "docid": "d4becfc8cb437f916a3920a67adaf0f9", "score": "0.72726876", "text": "def create\n user = User.authenticate(params[:email], params[:password])\n if user\n # token = (0...20).map { ('a'..'z').to_a[rand(26)] }.join\n #session[:token] = token\n session[:user_id] = user.id\n # user.update(session: token)\n redirect_to root_url, :notice => \"Logged in!\" \n else\n flash.now.alert = \"Invalid credentials.\"\n render \"new\"\n end\n end", "title": "" }, { "docid": "ad1ecab09ccd346afe5c411319dd49ea", "score": "0.7255982", "text": "def generate_token(_user)\n JsonWebToken.encode(login_payload, 3.days.from_now)\n end", "title": "" }, { "docid": "c07b6abdd297e2a44fbc125844ce109d", "score": "0.7218369", "text": "def create\n @user = User.new(params[:user])\n\n session[:token] = @user.generateToken\n respond_to do |format|\n if @user.save\n unless session[:original_url].nil?\n redirect_to session[:original_url]\n return\n end\n format.html { redirect_to root_path, notice: 'User was successfully created.' }\n format.json { render json: @user, status: :created, location: @user }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2192cdb2a297e18f3881d201e1f669a9", "score": "0.72120667", "text": "def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n session[:user] = {id: @user.id, auth_token: @user.generate_auth_token!}\n format.html { redirect_to main_welcome_url, notice: 'User was successfully created.' }\n else\n format.html { render action: \"new\" }\n end\n end\n end", "title": "" }, { "docid": "a0fe8e3b3062b092c1f8ad883157addb", "score": "0.721033", "text": "def sign_in(user)\n user.create_new_auth_token\n end", "title": "" }, { "docid": "054bb7b71871257743b79cfae436efde", "score": "0.7193379", "text": "def set_session\n session['token'] = @result['data']['token']\n current_user\n end", "title": "" }, { "docid": "c87f7a6e1a8a8923d0911910c449a003", "score": "0.71807003", "text": "def create\n user = warden.authenticate!(auth_options)\n Tiddle.expire_token(user, request) if request.headers['X-USER-EMAIL'] && request.headers['X-USER-TOKEN']\n Tiddle.purge_old_tokens(user)\n token = Tiddle.create_and_return_token(user, request, expires_in: 3.days)\n render json: { user: user.as_json, authentication_token: token, message: t('devise.sessions.signed_in') }\n end", "title": "" }, { "docid": "ea72b79280e18ba81ed893315e00f8f6", "score": "0.7180432", "text": "def create_token(user_id, dev_id)\n token = SecureRandom.base64(384)\n DB[:Token].where(UserID: user_id).where(DeviceID: dev_id)\n .update(Token: token, Timestamp: Time.now.to_i + 600)\n token\n end", "title": "" }, { "docid": "d102663aa75135c7908512bbcca79238", "score": "0.7178708", "text": "def sign_in(user)\n @user.create_new_auth_token\n end", "title": "" }, { "docid": "ee99a7090cc81fa18a48ccec7aae77fe", "score": "0.7166226", "text": "def create_user_token(params)\n key = Time.now.strftime(\"%Y-%m-%d %H:%M:%S:\") + '%012d' % rand(10_000_000_000)\n { :user_token => { :username => params[:username],\n :key => key,\n :hash => Digest::SHA1.hexdigest(params[:password] + key) } }\n end", "title": "" }, { "docid": "f7b62a61ce93e408959d0b13aa165ac5", "score": "0.71590996", "text": "def generate_authentication_token\n self.auth_token = User.new_token\n\t\t\tself.auth_expires_at = Time.now + 240.hours\n\tend", "title": "" }, { "docid": "14fd61cf3b9f8a0854875f590d273c9e", "score": "0.71546197", "text": "def generate_token\n self.status = STATUS[:present]\n self.access_token = SecureRandom.urlsafe_base64(45, true)\n self.expires = Time.zone.now.to_i + TOKEN_LIFE\n self.login_time = Time.zone.now\n self.user_events.build(event_name: 'Login', event_time: Time.zone.now)\n save\n self.access_token\n end", "title": "" }, { "docid": "35451781acc8aabff44a6ed1ac1c7f25", "score": "0.7142767", "text": "def create\n #gets the user\n user = User.find_by_credentials(params[:user][:email], params[:user][:password])\n \n # if we found it, generate a new session token, change it on the user\n # instance as well as the cookie\n if !user.nil?\n log_in_user!(user)\n flash.now[:success] = \"Login successful\"\n redirect_to user_url(user)\n else\n flash.now[:error] = \"Invalid email/password combo\"\n redirect_to :new\n end\n end", "title": "" }, { "docid": "669e6d78198bf9a2dfd77321d1a9c73c", "score": "0.7117263", "text": "def ensure_session_token\n self.session_token ||= User.generate_session_token\n end", "title": "" }, { "docid": "669e6d78198bf9a2dfd77321d1a9c73c", "score": "0.7117263", "text": "def ensure_session_token\n self.session_token ||= User.generate_session_token\n end", "title": "" }, { "docid": "669e6d78198bf9a2dfd77321d1a9c73c", "score": "0.7117263", "text": "def ensure_session_token\n self.session_token ||= User.generate_session_token\n end", "title": "" }, { "docid": "1d4a02a3573e5d6ae10a8c120e386c91", "score": "0.7109268", "text": "def create_token\n @user = User.find(params[:id])\n @token = Token.generate(@user)\n\n respond_to do |format|\n if @token.save\n format.html { redirect_to action: 'index'}\n format.json { render :show, status: :created, location: @token }\n else\n format.html { render :new }\n format.json { render json: @token.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d425e317990aa482520bc49df393d15a", "score": "0.70687485", "text": "def generate_token\n new_token =\n SimpleTokenAuthentication::TokenGenerator.instance.generate_token\n update(authentication_token: new_token)\n self\n end", "title": "" }, { "docid": "59248646c07cce85561f8fb34276c725", "score": "0.7042629", "text": "def issue_token(kind)\n session = Session.new(user: self, seconds: 3600)\n session.save\n if kind == :reset_token\n self.reset_token = session.token\n elsif kind == :verification_token\n self.verification_token = session.token\n end\n end", "title": "" }, { "docid": "3f39eb38349d834ab5d9598a5f2ba2ed", "score": "0.70287716", "text": "def generate_new_authentication_token\n token = User.generate_unique_secure_token\n update_attributes authentication_token: token\n end", "title": "" }, { "docid": "310701179c5d1c5cc7c5912c9a74ac3d", "score": "0.70243824", "text": "def create_token(opts = {})\n self.token = Digest::SHA256.hexdigest(\n Time.now.to_s + Rails.application.secrets.salt + email\n )\n save if opts[:save] == true\n end", "title": "" }, { "docid": "05b1a7e6ff589b31417c2da9a97bb8c1", "score": "0.7019532", "text": "def generateUserSession(user, site, customer)\n\n begin\n token = SecureRandom.hex(20)\n userSession = Session.find_by_token(token)\n end until userSession.nil?\n\n userSession = Session.new\n userSession.user = user\n userSession.site = site\n userSession.customer = customer\n userSession.token = token\n userSession.save\n\n return token\n end", "title": "" }, { "docid": "bed6a86103ef0f29c37620547bfad999", "score": "0.7014938", "text": "def new_jwt\n Knock::AuthToken.new(payload: { sub: current_user.id }).token\n end", "title": "" }, { "docid": "6241b945f4368398872c42b2c0060db7", "score": "0.7009485", "text": "def ensure_session_token\n self.session_token ||= User.generate_session_token\nend", "title": "" }, { "docid": "b73cc631836258fbca114d17c144d819", "score": "0.6999391", "text": "def create_token\n @account_token = SecureRandom.urlsafe_base64(nil, false)\n @authentication_token = create_authentication_token\n key = account_token_key(@account_token)\n redis_token = Redis::HashKey.new(key)\n expire_time = DateTime.now + ACCOUNT_TOKEN_TTL\n redis_token.bulk_set({expire_at: expire_time.to_s, authentication_token: @authentication_token})\n redis_token.expireat(expire_time.to_i)\n update_app_info\n {account_token: @account_token, authentication_token: @authentication_token}\n end", "title": "" }, { "docid": "ace18deb112eb96eb21da0985ed2a3b3", "score": "0.69951385", "text": "def access_token\n User.create_access_token(self)\n end", "title": "" }, { "docid": "2912e44e0ac526670b9f9c994a35b23b", "score": "0.69735533", "text": "def start_session\n generate_token(:token)\n setup_session\n update_last_session\n end", "title": "" }, { "docid": "5fe49dac7b0d6562723bd84058bffd6d", "score": "0.696182", "text": "def create_token(user_id)\n payload = { user_id: user_id }\n # Creates a token. Encoding something just creates a token\n JWT.encode(payload, secret, 'HS256')\n end", "title": "" }, { "docid": "72bc4a5b62e11d02d09ca8158913acf4", "score": "0.6943032", "text": "def create_authentication_token!\n begin\n self.authentication_token = User.token\n end while User.exists?(authentication_token: self.authentication_token)\n end", "title": "" }, { "docid": "0e5e9d190e03ca4c39860462854aaf51", "score": "0.6929066", "text": "def create\n user = User.find_for_authentication(email: user_params[:email])\n\n if user && user.valid_password?(user_params[:password])\n user.generate_authentication_token\n\n expose({\n user_id: user.id,\n token: user.authentication_token\n })\n else\n error! :unauthenticated\n end\n end", "title": "" }, { "docid": "3eb510e21bb8fa7b46b9bc37666cadee", "score": "0.6918502", "text": "def create_new_auth_token(client_id=nil)\n client_id ||= SecureRandom.urlsafe_base64(nil, false)\n last_token ||= nil\n token = SecureRandom.urlsafe_base64(nil, false)\n token_hash = BCrypt::Password.create(token)\n expiry = (Time.now + DeviseTokenAuth.token_lifespan).to_i\n\n if self.tokens[client_id] and self.tokens[client_id]['token']\n last_token = self.tokens[client_id]['token']\n end\n\n self.tokens[client_id] = {\n token: token_hash,\n expiry: expiry,\n last_token: last_token,\n updated_at: Time.now\n }\n\n self.save!\n\n return build_auth_header(token, client_id)\n end", "title": "" }, { "docid": "a0e3dcd0f6cbb0347664527d527d496e", "score": "0.6918177", "text": "def update_session\n auth = Knock::AuthToken.new(payload: to_token_payload)\n auth.token\n end", "title": "" }, { "docid": "d707fa7dfa05a9d2e86f020ce50ff331", "score": "0.6904362", "text": "def reset_session_token!\n self.session_token = User.generate_session_token\n self.save\n self.session_token\n end", "title": "" }, { "docid": "32532eabc7bee31774e4a67892a9e43a", "score": "0.690387", "text": "def ensure_session_token\n self.session_token ||= generate_session_token\n end", "title": "" }, { "docid": "33917eeac92fa417daed44ac6144a7b3", "score": "0.6902487", "text": "def ensure_session_token\n self.session_token ||= User.generate_session_token\n end", "title": "" }, { "docid": "3ee5a7f65ca8c5fb1c1eb7aacba81c8a", "score": "0.68929297", "text": "def session_securitytoken_create(input={}, raw=false)\n response = get('mw/Session.SecurityToken.Create', input, raw)\n end", "title": "" }, { "docid": "978cf5ab27e28553255dffca18991fd9", "score": "0.68812305", "text": "def reset_token!\n self.session_token = User.generate_session_token\n self.save!\n self.session_token\n end", "title": "" }, { "docid": "1c0439c9084c2d1e0fa63e7e9a7576a7", "score": "0.68741703", "text": "def create\n @user = User.create_or_find_by(user_params)\n my_token = issue_token(@user)\n\n render json: {user: @user, token: my_token}\n # render json: @user\n \n end", "title": "" }, { "docid": "24159f9951d251d4b612700bc6319ecb", "score": "0.6869339", "text": "def reset_session_token!\n self.session_token = User.generate_session_token\n self.save!\n self.session_token\n end", "title": "" }, { "docid": "9ee2e9c6b3b2df1bd0e3619b667aca3f", "score": "0.6866534", "text": "def create\n @user = User\n .find_by(email: get_parameters[:email].downcase)\n .try(:authenticate, get_parameters[:password]) \n\n if @user\n jwt_payload = {\n user_id: @user.id\n }\n render json: {\n status: 201,\n message: \"Successfully created new user session.\",\n user: @user,\n jwt: User.encode_jwt(jwt_payload)\n }\n\n else\n render json: {\n status: 401,\n message: \"Failed to create new user session.\"\n }\n end\n end", "title": "" }, { "docid": "36819a6d17a4a3da018aad8950b60761", "score": "0.68563926", "text": "def login_as(user_id)\n self.token = Token.create!(\n user_id: user_id,\n client: Client.first,\n expires_at: 5.months.from_now\n ).to_jwt\n end", "title": "" }, { "docid": "e49c28f3d329e6a15861ea5c9c4ecf9e", "score": "0.68476486", "text": "def generate_token (id, number_of_days)\n JWT.encode({ :user_id => id, :expires => expires_in(number_of_days) }, 'somesecrethere')\n end", "title": "" }, { "docid": "2f13a9a2e5e66e7a0dd8029253d48e58", "score": "0.68473226", "text": "def generate\n #This is an account ID, not a user id...\n id = session[:account_id]\n @user = User.find(id)\n @user.reset_authentication_token!\n @token = @user.authentication_token\n @secret = ActiveSupport::SecureRandom.urlsafe_base64(20)\n @secret_key = Digest::SHA1.hexdigest @secret\n @user.secret_key = @secret_key\n @user.save\n respond_to do |format|\n format.html # index.html.erb\n end\n end", "title": "" }, { "docid": "855550abab6c96a5612c74935fa75cf7", "score": "0.68461686", "text": "def generate_token\n #Token.generate_token(self.id)\n end", "title": "" }, { "docid": "a6b12549214cf1581bd0f43eedc94539", "score": "0.6835763", "text": "def reset_session_token!\n\n self.session_token = User.generate_session_token\n self.save!\n self.session_token\n\nend", "title": "" }, { "docid": "a4ffde6427a996a3e5f5686848fb679f", "score": "0.68334347", "text": "def ensure_session_token\n self.token ||= SecureRandom.hex\n end", "title": "" }, { "docid": "fb82fb64e8c7c241918a9f1479f0e58c", "score": "0.68249047", "text": "def create_user_session\n password = '12345678'\n user = User.make!(\n password: password,\n password_confirmation: password\n )\n UserSession.create!(\n email: user.email,\n password: password\n )\n end", "title": "" }, { "docid": "3a631863b80bf321d695dd950e4c2bbd", "score": "0.6813032", "text": "def reset_session_token!\n self.session_token = User.generate_session_token\n self.save!\n self.session_token\nend", "title": "" }, { "docid": "dee2a241918641cb33157ac2bdddaaa9", "score": "0.68115824", "text": "def generate_token\n token_hash = SecureRandom.hex\n token_hash.force_encoding('utf-8')\n access_tokens.create(token: token_hash, token_expire: Time.now + DEFAULT_TOKEN_EXPIRE)\n end", "title": "" }, { "docid": "dee2a241918641cb33157ac2bdddaaa9", "score": "0.68115824", "text": "def generate_token\n token_hash = SecureRandom.hex\n token_hash.force_encoding('utf-8')\n access_tokens.create(token: token_hash, token_expire: Time.now + DEFAULT_TOKEN_EXPIRE)\n end", "title": "" }, { "docid": "87e99099499ea77bb919ac8c092fe3d1", "score": "0.6811207", "text": "def create_session\n @user = User.new(nickname: User.temp_user_name)\n @user.save\n session[:user_id] = @user.id\n @user\n end", "title": "" }, { "docid": "33cc800b6d971b0de228ad6ccafc3df8", "score": "0.6808061", "text": "def create_session(ip, meta_info={})\n raw, enc = Authentication::TokenGenerator.generate(Authentication::Session, 'authentication_token')\n Authentication::Session.create({\n 'authentication_token' => enc,\n 'meta_info' => meta_info,\n 'ip' => ip,\n 'account_id' => self.id\n })\n return raw, enc\n end", "title": "" }, { "docid": "43b520c76340ecff8fe75248e7f443f6", "score": "0.6796215", "text": "def call\n # after user login, will pass the user-id to the JWT to create token\n return nil unless user\n\n return JsonWebToken.create_token(user_id: user.id), user\n end", "title": "" }, { "docid": "15b17ef011533ddf3bfebe194a7ac397", "score": "0.6790399", "text": "def create\n\t\tif user = User.validate_login(params[:username], params[:password])\n\t\t\tallow_token_to_be_used_only_once_for(user)\n\t\t\tsend_token_for_valid_login_of(user)\n\t\telse\n\t\t\trender_unauthorized(\"Error with your login or password\")\n\t\tend\n\tend", "title": "" }, { "docid": "fd126393ff83a4d884798c03af7a2a14", "score": "0.6779162", "text": "def generate_login_token!\n new_login_token = SecureRandom.hex(24)\n salt = SecureRandom.hex(24)\n hash = token_hash(new_login_token, salt)\n\n update_attributes(:login_token => concatenate_token_record(hash, salt), :login_token_expires_at => 1.week.from_now)\n new_login_token\n end", "title": "" }, { "docid": "b769d17d2bf3d54147fe5411bd00deb6", "score": "0.67772776", "text": "def create\n @user_token = UserToken.new(params[:user_token])\n\n respond_to do |format|\n if @user_token.save\n format.html { redirect_to @user_token, notice: 'User token was successfully created.' }\n format.json { render json: @user_token, status: :created, location: @user_token }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user_token.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8a5462084750a4aa3900effc35c78a56", "score": "0.6776878", "text": "def create_new_auth_token(client_id=nil)\n client_id ||= SecureRandom.urlsafe_base64(nil, false)\n last_token ||= nil\n token = SecureRandom.urlsafe_base64(nil, false)\n token_hash = ::BCrypt::Password.create(token)\n expiry = (Time.now + DeviseTokenAuth.token_lifespan).to_i\n\n if self.tokens[client_id] && self.tokens[client_id]['token']\n last_token = self.tokens[client_id]['token']\n end\n\n self.tokens[client_id] = {\n token: token_hash,\n expiry: expiry,\n last_token: last_token,\n updated_at: Time.now\n }\n\n return build_auth_header(token, client_id)\n end", "title": "" }, { "docid": "3411b8d55abdd8d66edf97ef0c9105df", "score": "0.67731154", "text": "def create\n user = User.where(email: params[:user][:email]).first\n if user && user.authenticate(params[:user][:password])\n user.regenerate_token\n render json: { status: :success, data: user.to_json }\n else\n render json: { status: :error, data: 'Invalid login details' }\n end\n end", "title": "" }, { "docid": "18e69766e8e8084ae22a4068f2bd19ac", "score": "0.6766306", "text": "def create\n \tuser = User.find_by(email: params[:session][:email])\n\n \tif user && user.authenticate(params[:session][:password])\n \t\trender text: user.auth_token, status: 200\n \t\telse\n \t\t\trender text: \"Invalid email or password\", status: 422\n \t\tend\t\n end", "title": "" }, { "docid": "eee8ef3d45e8eea50197cc819ecab16c", "score": "0.67563385", "text": "def create\n user = User.from_omniauth(env[\"omniauth.auth\"])\n session[:user_id] = user.id\n me=User.find(user.id)\n me.loggedin=true\n me.tutoring=false\n me.request=Request.new(class_name:\"3365f80a5cccb3e76443df3b736b26e8\")\n me.save\n render erb: :'sessions#create'\nend", "title": "" }, { "docid": "3700be0735adcacfccf47c6997a36c75", "score": "0.67436177", "text": "def generate_and_set_token(user=nil)\n user ||= create(:user_with_token)\n current_time = Time.now\n jwt_config = Rails.application.secrets.jwt\n token = JWT.encode({\"iat\" => current_time.to_i,\n \"iss\" => jwt_config['issuer'],\n \"exp\" => (current_time + 14.days).to_i,\n \"user_id\" => user.id},\n jwt_config['secret_key'],\n jwt_config['hmac_sha_algo'])\n request.headers['Authorization'] = \"Bearer #{token}\"\n end", "title": "" }, { "docid": "06523a810c6e575b7c1940f241943758", "score": "0.67424273", "text": "def generate_token(user)\n payload = {user_id: user.id}\n JWT.encode(payload, ENV[\"SEC_KEY\"] , 'HS256')\n end", "title": "" }, { "docid": "6c790ecca0b74fee416ca0a808595bf9", "score": "0.6730514", "text": "def create_token(id, username)\n JWT.encode(payload(id, username), ENV['JWT_SECRET'], 'HS256')\n end", "title": "" }, { "docid": "6c790ecca0b74fee416ca0a808595bf9", "score": "0.6730514", "text": "def create_token(id, username)\n JWT.encode(payload(id, username), ENV['JWT_SECRET'], 'HS256')\n end", "title": "" }, { "docid": "7c5d2d301a4edfc2847f6c0044a2b55d", "score": "0.6701973", "text": "def session_token\n refresh_session_token unless token_valid?\n return @session_token\n end", "title": "" }, { "docid": "e94c0aebf751383e566e48e07a90b4cb", "score": "0.6698238", "text": "def ensure_session_token\n self.token ||= self.class.random_string\n end", "title": "" }, { "docid": "4c03083786d2be689ff059e7dcc5ebec", "score": "0.66861755", "text": "def create\n user = User.find_by(email: auth_params[:email])\n if user&.valid_password?(auth_params[:password])\n @token = user.api_tokens.find_or_create_by(name: (auth_params[:name] || \"default\")) do |token|\n token.make_token.save!\n end\n render json: {\n token: @token.token\n }\n else\n head :unauthorized\n end\n end", "title": "" }, { "docid": "38e97e654705a17f0534762ccb07e4a4", "score": "0.6671731", "text": "def make_token(user_id)\n payload = { user_id: user_id }\n JWT.encode(payload, hmac_secret, 'HS256')\n end", "title": "" }, { "docid": "9e857e0fba38dcc32e88dba1c83048b1", "score": "0.66689575", "text": "def sign_in(user)\n session[:session_token] = SecureRandom.urlsafe_base64\n user.update!(session_token: session[:session_token])\n end", "title": "" }, { "docid": "d344e4e434541b1bd2580a4bf5ea5703", "score": "0.6668727", "text": "def reset_session_token!\n self.session_token = self.class.generate_session_token\n self.save!\n self.session_token\n end", "title": "" }, { "docid": "d344e4e434541b1bd2580a4bf5ea5703", "score": "0.6668727", "text": "def reset_session_token!\n self.session_token = self.class.generate_session_token\n self.save!\n self.session_token\n end", "title": "" }, { "docid": "bf50755fe4c650e4d7b504d8a94353b8", "score": "0.6665522", "text": "def create_remember_token\n remember_token = User.hash(User.new_remember_token)\n end", "title": "" }, { "docid": "9ef089037752f0860eee15cf826ac257", "score": "0.6657255", "text": "def create\n puts \"MESSAGE 14 IN CREATE\"\n @auth = request.env['omniauth.auth']['credentials']\n # The following statement saves the tokens to the database\n Token.create(\n access_token: @auth['token'],\n refresh_token: @auth['refresh_token'],\n expires_at: Time.at(@auth['expires_at']).to_datetime)\n end", "title": "" }, { "docid": "e79cdb135e55b7b91ecd8b3509c4c5f8", "score": "0.6653777", "text": "def login(user)\n session[:session_token] = user.reset_session_token\n end", "title": "" }, { "docid": "fed993ccc4ee5f90c170dfb75a3cd171", "score": "0.66426206", "text": "def create_session user_id\n @state.user_id = user_id\n end", "title": "" }, { "docid": "7185497ed077b5c4c609078157174be3", "score": "0.6636374", "text": "def create_remember_token\n\t\tremember_token = User.hash(User.new_remember_token)\n\tend", "title": "" }, { "docid": "1ffe334e5c6fc633085166d453823234", "score": "0.66315264", "text": "def generate_token\n self.update({:token => SecureRandom.hex})\n end", "title": "" }, { "docid": "f60e1c851dc3637c0542e2ecdcc61a99", "score": "0.6631503", "text": "def create_token\n Rails.logger.info(\"Enter Create Token\")\n \n # create token\n token = GenerateToken.unique_token\n access_token = self.create_access_token( token: token, role: {})\n raise et(\"account.create_token_failed\") if access_token.blank?\n\n true\n rescue => e \n Rails.logger.error(\"**** ERROR **** #{e.message}\")\n end", "title": "" }, { "docid": "256e09130a224189816a7402727954f7", "score": "0.66297525", "text": "def create\n user = User.create!(user_params)\n render json: { token: user.auth_token }\n end", "title": "" }, { "docid": "ebfb55ee923fb6a97e4157cca9e28435", "score": "0.6623944", "text": "def generate_auth_token\n begin\n token = SecureRandom.hex\n end while AuthToken.exists?(auth_token: token)\n self.auth_tokens.create(auth_token: token)\n token\n end", "title": "" }, { "docid": "cb04a26a599068cf976527f6be019bd5", "score": "0.662161", "text": "def update_user_token\n if user_signed_in?\n Session.active_sessions.find_by(id: request.headers['sid'], utoken: request.headers['utoken']).update(last_used_at: Time.zone.now)\n end\n end", "title": "" }, { "docid": "bece678deb1d8c2428c1da4c9fb3243e", "score": "0.6619892", "text": "def create_user_token(user_id, application_id, application_name)\n res = nil\n uri = URI(@url + \"auth/#{application_name}/login\")\n req = Net::HTTP::Post.new(uri)\n req['X-Vault-Token'] = @token\n application_data = { 'app_id' => application_id, 'user_id' => user_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 [JSON.parse(res.body), res.code.to_i]\n end", "title": "" }, { "docid": "cdc82fe29be57bf34d04251e82dc3765", "score": "0.6616856", "text": "def token_generate\n res = call('auth.token_generate')\n\n return unless res || res['token']\n\n res['token']\n end", "title": "" }, { "docid": "20ac797f2adaf0a7729d1cf0688d2f43", "score": "0.66133124", "text": "def create\n action = LogUserIn.new :web\n\n if user = action.run(params[:login], params[:password])\n previous_path = session[:login_redirect_to]\n\n reset_session\n cookies[:web_session_token] = {\n value: user.login_token(:web),\n httponly: true\n }\n\n redirect_to previous_path || root_path\n else\n flash.now[:login_error] = true\n render action: \"new\"\n end\n end", "title": "" }, { "docid": "ccbaa3716815fc098501b4517faae246", "score": "0.6610034", "text": "def generate_auth_token\n \tbegin\n \t\tself.auth_token = User.new_token\n \tend while self.class.exists?(auth_token: auth_token)\n end", "title": "" }, { "docid": "f161f05a4fdc43a996f0d2212b879250", "score": "0.6604999", "text": "def generate_token\n begin\n self[:auth_token] = SecureRandom.urlsafe_base64\n end while User.exists?(:auth_token => self[:auth_token])\n end", "title": "" }, { "docid": "8cc3fc3eb42c29eea5293e6e93753466", "score": "0.66044503", "text": "def generate_token\n unless self.token\n self.token = loop do\n random_token = SecureRandom.urlsafe_base64(nil, false)\n break random_token unless User.exists?(token: random_token)\n end\n self.save\n end\n end", "title": "" }, { "docid": "b14b2e16e6d7fcecea3e489f2342d2d4", "score": "0.6600644", "text": "def create\n @user = User.new(user_params)\n if @user.save\n @token = encode_token({user_id: @user.id})\n render json: {user: @user, token: @token}\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "43f8e6c3e4202bf3142c350f6435fda9", "score": "0.6598514", "text": "def token_generator(user_id, user_ip)\n return unless user_id\n\n user = User.find(user_id)\n\n access_token = user.tokens.create(token: token_creator, request_ip: user_ip)\n JsonWebToken.encode(\n token: access_token.token,\n request_ip: access_token.request_ip\n )\n end", "title": "" }, { "docid": "0973b3e784979e58cb29da4eb4d2713d", "score": "0.65976316", "text": "def create\n \n # remove any existing session of this user\n # TODO: update custom validations in model to work with this\n @session = Session.where(\"sender_id = #{session_params[:sender_id]} OR recipient_id = #{session_params[:sender_id]}\").first\n @session.destroy if @session\n \n @session = Session.new(session_params)\n \n if @session.valid?\n @session.session_id = Session.createSession(request.remote_addr).to_s\n @session.sender_token = Session.generateToken(@session.session_id, @session.sender.id.to_s)\n @session.recipient_token = Session.generateToken(@session.session_id, @session.recipient.id.to_s)\n end\n\n respond_to do |format|\n if @session.save\n format.html { redirect_to @session, notice: 'Session was successfully created.' }\n format.json { render action: 'show', status: :created, location: @session }\n else\n format.html { render action: 'new' }\n format.json { render json: @session.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ba4f9febc52a7929884c081a417a0ffa", "score": "0.6592017", "text": "def session_token\n @session_prx_auth_token ||= if prx_jwt\n # NOTE: we already validated this jwt - so just decode it\n validator = Rack::PrxAuth::AuthValidator.new(prx_jwt)\n\n # does this jwt need to be refreshed?\n if prx_auth_needs_refresh?(validator.time_to_live)\n raise SessionTokenExpiredError.new\n end\n\n # create new data/token from access claims\n token_data = Rack::PrxAuth::TokenData.new(validator.claims)\n PrxAuth::Rails::Token.new(token_data)\n end\n end", "title": "" }, { "docid": "5bcb486d379883d553954f59fa453e28", "score": "0.6591599", "text": "def set_current_user(user)\n session[:user_token] = user.token\n end", "title": "" }, { "docid": "06659c8c5eeffa33b70e95613e8a8845", "score": "0.6577336", "text": "def generate_token\n token_gen = SecureRandom.hex\n self.token = token_gen\n token_gen\n end", "title": "" } ]
d17882bbee20435901616f4fd286116d
Gathers the models attributes
[ { "docid": "b8397e46adde0962677b1e809030c736", "score": "0.7445284", "text": "def attributes\n attributes_block.call model\n end", "title": "" } ]
[ { "docid": "2ad2a25a0146db97185322a5c2a0fd78", "score": "0.74860066", "text": "def get_attributes\n self.class.attributes.each do |attr|\n write_attribute(attr, model_instance.public_send(attr))\n end\n end", "title": "" }, { "docid": "0aa12fe78587eae167c999cab7059a58", "score": "0.747931", "text": "def attributes\n @attributes ||= Attribute.from_model @domain, @model\n end", "title": "" }, { "docid": "3459f28f3d75e8a5c4877fe51c63351e", "score": "0.7448698", "text": "def attributes\n ensure_initialized\n @@attributes\n end", "title": "" }, { "docid": "062200d8f04f06bcd881f290f747d5b1", "score": "0.74137896", "text": "def model_attributes\n @model_attributes ||= {}\n end", "title": "" }, { "docid": "63157087017027bfba308c170cf9ac3a", "score": "0.7367697", "text": "def attributes\n @_attributes ||= build_attributes\n end", "title": "" }, { "docid": "765ed4f6148aa404fb5f204ae87b27b7", "score": "0.7326415", "text": "def prepare_attributes\n attributes\n end", "title": "" }, { "docid": "7bc738f8898743173dc90d892ab6f7ff", "score": "0.7312152", "text": "def model_attributes\n @model_attributes ||= Prepares.model_attributes\n end", "title": "" }, { "docid": "c28f1b3361851a97990959f7dedba93d", "score": "0.7297917", "text": "def attributes\n # TODO\n end", "title": "" }, { "docid": "5bf8eb3b0fe6ff455b0be044bdcff171", "score": "0.7206643", "text": "def attributes\n @attributes ||= find_attributes\n end", "title": "" }, { "docid": "381990efd36f90fc5a2c91239b6fc103", "score": "0.7195281", "text": "def attributes\n @attributes ||= {}\n end", "title": "" }, { "docid": "298215eb0499ad80a8997348da648764", "score": "0.71907455", "text": "def _attributes\n @attributes\n end", "title": "" }, { "docid": "1df35e55dff47ef7475129b982830e49", "score": "0.7150425", "text": "def attributes\n config.attributes || model_adapter.model_attributes\n end", "title": "" }, { "docid": "a45c2e2f4db6f240a91d651d3594135d", "score": "0.71431303", "text": "def attributes\n model_representer.attributes\n end", "title": "" }, { "docid": "4a87d35c3000003f51975f311dbb13eb", "score": "0.71230316", "text": "def populate_attributes\n self.class.normal_attribute_list.each do |normal_attribute|\n self.public_send \"#{normal_attribute}=\", raw_data[normal_attribute]\n end\n\n self.class.time_attribute_list.each do |time_attribute|\n time = raw_data[time_attribute]\n time = Time.parse(time) if !time.nil?\n self.public_send \"#{time_attribute}=\", time\n end\n\n self.class.collection_attribute_mappings.each do |collection_attribute, klass|\n collection = raw_data[collection_attribute] || []\n collection = {'data' => collection}\n collection = klass.response_collection(collection)\n self.public_send \"#{collection_attribute}=\", collection\n end\n end", "title": "" }, { "docid": "946853fd0be683f7f0123b3deb24249a", "score": "0.71027565", "text": "def attributes\n @attributes ||= generalized? ? [] : Attribute.from_model(domain, model)\n end", "title": "" }, { "docid": "050a6ced68ab29d4937de9cf5178bea0", "score": "0.7090378", "text": "def attributes\r\n @attributes ||= attributes!\r\n end", "title": "" }, { "docid": "90b2703ce9ccb96f3826f6494b8a6922", "score": "0.7084615", "text": "def attributes()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "90b2703ce9ccb96f3826f6494b8a6922", "score": "0.7084615", "text": "def attributes()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "79690a0ff3a12aab2dc841047df869a7", "score": "0.70653975", "text": "def attributes\n load_attributes! unless attributes_loaded?\n @attributes.values\n end", "title": "" }, { "docid": "79690a0ff3a12aab2dc841047df869a7", "score": "0.70653975", "text": "def attributes\n load_attributes! unless attributes_loaded?\n @attributes.values\n end", "title": "" }, { "docid": "3176232519a4cfb908ce3f8a51dc4697", "score": "0.70610356", "text": "def attributes\n @_attributes ||= attributes_from_data\n end", "title": "" }, { "docid": "9bf13538d4d44bd3fa9a180c9207112c", "score": "0.7049764", "text": "def set_attributes\n self.class.attributes.each do |attr|\n model_instance.public_send(\"#{attr}=\", read_attribute(attr))\n end\n end", "title": "" }, { "docid": "032608d9209809c6071f87175d1f7491", "score": "0.7046891", "text": "def attributes\n super.merge({\n\n })\n end", "title": "" }, { "docid": "912a53da9e0b11c55b4fda95beebe9c7", "score": "0.7041251", "text": "def attributes\n @_attributes\n end", "title": "" }, { "docid": "f1fe23c6e9fe16b4dc1bc9f7c2a3c396", "score": "0.70338446", "text": "def attributes\n unless @attributes_loaded\n load_attributes\n end\n @attributes\n end", "title": "" }, { "docid": "047ed79335b05f65828ed9cc6bed0ab6", "score": "0.7033785", "text": "def read_attributes\n @_attributes\n end", "title": "" }, { "docid": "9b59d4514b75284cfc8d6320d462ce72", "score": "0.7033392", "text": "def attributes\n @attributes ||= {}\n\n @attributes\n end", "title": "" }, { "docid": "5ac8c5fae55dd70f43044e5665c5ce54", "score": "0.7021032", "text": "def attributes\n @attributes ||= {}\n end", "title": "" }, { "docid": "5ac8c5fae55dd70f43044e5665c5ce54", "score": "0.7021032", "text": "def attributes\n @attributes ||= {}\n end", "title": "" }, { "docid": "5ac8c5fae55dd70f43044e5665c5ce54", "score": "0.7021032", "text": "def attributes\n @attributes ||= {}\n end", "title": "" }, { "docid": "5ac8c5fae55dd70f43044e5665c5ce54", "score": "0.7021032", "text": "def attributes\n @attributes ||= {}\n end", "title": "" }, { "docid": "0a8beccd61734cebf68e94f8e1acdfaf", "score": "0.7015999", "text": "def attributes\n @attributes ||= {}\n end", "title": "" }, { "docid": "0a8beccd61734cebf68e94f8e1acdfaf", "score": "0.7015999", "text": "def attributes\n @attributes ||= {}\n end", "title": "" }, { "docid": "0a8beccd61734cebf68e94f8e1acdfaf", "score": "0.7015999", "text": "def attributes\n @attributes ||= {}\n end", "title": "" }, { "docid": "0a8beccd61734cebf68e94f8e1acdfaf", "score": "0.7015999", "text": "def attributes\n @attributes ||= {}\n end", "title": "" }, { "docid": "769947254caf72a975c7e1a52a499964", "score": "0.7014341", "text": "def attributes; @_attributes; end", "title": "" }, { "docid": "2c564f588cb90d4303efb30dc2aa98f8", "score": "0.7009419", "text": "def requested_attributes; end", "title": "" }, { "docid": "562ac8560aa47dd20f40fd1fdb4d9669", "score": "0.70068717", "text": "def attributes\n data.require(:attributes)\n end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.6993131", "text": "def attributes; end", "title": "" } ]
13567753eeb144557c4ceae97dc62077
If this is a preflight OPTIONS request, then shortcircuit the request, return only the necessary headers and return an empty text/plain.
[ { "docid": "b96f261ce0ac7dfb30fc9386ff4750af", "score": "0.69418806", "text": "def cors_preflight_check\n cors_headers\n render :text => '', :content_type => 'text/plain'\n end", "title": "" } ]
[ { "docid": "9e36f0e05c194cf638c1399a231c6c79", "score": "0.7639121", "text": "def handle_options_request\n head(:ok) if request.request_method == \"OPTIONS\"\n end", "title": "" }, { "docid": "18fd73266177c195768a536fc446d0e8", "score": "0.7632858", "text": "def handle_options_request\n head(:ok) if request.request_method == \"OPTIONS\"\n end", "title": "" }, { "docid": "8d3983740832eb21df9e5e4beec964bb", "score": "0.7410906", "text": "def http_OPTIONS request, response\n raise HTTP404NotFound, path if self.empty?\n response.status = status_code :no_content\n response.header['Allow'] = self.http_methods.join ', '\n end", "title": "" }, { "docid": "8ce17ec8d680d21873286e08d9722e42", "score": "0.7409185", "text": "def cors_preflight_check\n if request.method == :options\n cors_set_access_control_headers\n render text: ''\n end\n end", "title": "" }, { "docid": "11ec3ae8b906ec73c6fafbd6d2e694d4", "score": "0.7335788", "text": "def http_OPTIONS request, response\n response.status = status_code :no_content\n http_method_regexp = /\\Ahttp_([A-Z]+)\\z/\n response.header['Allow'] = self.allowed_methods.join ', '\n self.do_OPTIONS( request, response ) if self.respond_to? :do_OPTIONS\n end", "title": "" }, { "docid": "5d23b51a19f060a6d5889ebaf3e0edb4", "score": "0.7326278", "text": "def cors_preflight_check\n if request.method == 'OPTIONS'\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS, PUT, DELETE'\n headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\n headers['Access-Control-Max-Age'] = '1728000'\n\n render text: '', content_type: 'text/plain'\n end\n end", "title": "" }, { "docid": "f6390cd814cc204aa97f4fdc18350e4e", "score": "0.7307685", "text": "def cors_preflight_check\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'Access-Control-Allow-Origin, X-Requested-With, X-Prototype-Version, Content-Type'\n headers['Access-Control-Max-Age'] = '1728000'\n render text: \"\" if request.method == \"OPTIONS\"\n end", "title": "" }, { "docid": "f6390cd814cc204aa97f4fdc18350e4e", "score": "0.7307685", "text": "def cors_preflight_check\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'Access-Control-Allow-Origin, X-Requested-With, X-Prototype-Version, Content-Type'\n headers['Access-Control-Max-Age'] = '1728000'\n render text: \"\" if request.method == \"OPTIONS\"\n end", "title": "" }, { "docid": "f6390cd814cc204aa97f4fdc18350e4e", "score": "0.7307685", "text": "def cors_preflight_check\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'Access-Control-Allow-Origin, X-Requested-With, X-Prototype-Version, Content-Type'\n headers['Access-Control-Max-Age'] = '1728000'\n render text: \"\" if request.method == \"OPTIONS\"\n end", "title": "" }, { "docid": "91c5c2baa6f84f9ac3d416f0ca22b5e5", "score": "0.73014385", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "f6f729e61c76c280cc267d936ad4b27f", "score": "0.7288662", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = '*'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "f6f729e61c76c280cc267d936ad4b27f", "score": "0.7288662", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = '*'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "e0746a2d5fc83ce61510cade2b43ee20", "score": "0.72868156", "text": "def cors_preflight_check\n if request.method == 'OPTIONS'\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '',\n :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "cc09e6cb616b2ffce3e33ef224c9e1ae", "score": "0.72844124", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Headers'] = '*'\n headers['Access-Control-Max-Age'] = '*'\n render :text => '', :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "a7030e319e7a9b2d82f4aec0d73c616d", "score": "0.727485", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = '*'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "4cd36faa9aaeb15c4a74e66241343b8b", "score": "0.7272299", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'GET'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "2991f5a8f3349af8eb58c398bc4a3aaf", "score": "0.72520024", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Max-Age'] = '1728000'\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\n render :text => '', :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "aee4d65e0e5379aaf480f78f4121b5db", "score": "0.7251601", "text": "def cors_preflight_check\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS, PATCH'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version, API-VERSION, Authorization, Content-Type'\n headers['Access-Control-Max-Age'] = '1728000'\n head(:ok) if request.request_method == 'OPTIONS'\n end", "title": "" }, { "docid": "308d3f7d0cc4db25ab4fa22fb872dde5", "score": "0.7233319", "text": "def preflight?\n request.request_method == 'OPTIONS' &&\n !request.headers['Authorization'].present?\n end", "title": "" }, { "docid": "43ee35666ace892b9fe8d4a0ad66a1f1", "score": "0.7231105", "text": "def cors_preflight_check\n if request.method == :options\n\theaders['Access-Control-Allow-Origin'] = '*'\n\theaders['Access-Control-Allow-Methods'] = 'PUT,DELETE,AUTH,POST, GET, OPTIONS'\n\theaders['Access-Control-Allow-Headers'] = '*'\n\theaders['Access-Control-Max-Age'] = '1728000'\n\trender :text => '', :content_type => 'text/plain'\n end\nend", "title": "" }, { "docid": "c95a7c9e437a0f9d719812b49a69e801", "score": "0.72276586", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] =\n 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n render text: '', content_type: 'text/plain'\n end\n end", "title": "" }, { "docid": "670ca4b5c4728ff2cdc7257560a0e222", "score": "0.7215954", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n render text: '', content_type: 'text/plain'\n end\n end", "title": "" }, { "docid": "f325f31c8fd34aa31cc22b7cb64dd0b5", "score": "0.721473", "text": "def cors_preflight_check\r\n\r\n if request.method == :options\r\n headers['Access-Control-Allow-Origin'] = '*'\r\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\r\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\r\n headers['Access-Control-Max-Age'] = '1728000'\r\n render :text => '', :content_type => 'text/plain'\r\n\r\n end\r\n end", "title": "" }, { "docid": "4d88ba995fc81c06a5313755f0b68e95", "score": "0.72143316", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "eddab6fe16024781f0fc4af924c209d0", "score": "0.7212913", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "eddab6fe16024781f0fc4af924c209d0", "score": "0.7212913", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "eddab6fe16024781f0fc4af924c209d0", "score": "0.7212913", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "eddab6fe16024781f0fc4af924c209d0", "score": "0.7212913", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "eddab6fe16024781f0fc4af924c209d0", "score": "0.7212913", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "eddab6fe16024781f0fc4af924c209d0", "score": "0.7212913", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "eddab6fe16024781f0fc4af924c209d0", "score": "0.7212913", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "83bd31668d2a12cc5fb97f6916a1523d", "score": "0.7205396", "text": "def cors_preflight_check\n if request.method == :options\n headers[\"Access-Control-Allow-Origin\"] = \"*\"\n headers[\"Access-Control-Allow-Methods\"] = \"POST, GET, OPTIONS\"\n headers[\"Access-Control-Allow-Headers\"] = \"X-Requested-With, X-Prototype-Version\"\n headers[\"Access-Control-Max-Age\"] = \"1728000\"\n render text: \"\", content_type: \"text/plain\"\n end\n end", "title": "" }, { "docid": "c586b22ad07358ba19b67d210f73910b", "score": "0.72034425", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "03778a4f63c0b580db9046669523c3c2", "score": "0.7202493", "text": "def cors_preflight_check\n if request.method == \"OPTIONS\"\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'Authorization,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,X-Prototype-Version,If-Modified-Since,Cache-Control,Content-Type'\n headers['Access-Control-Max-Age'] = '1728000'\n render :body => nil, :status => 204\n end\n end", "title": "" }, { "docid": "0b66bd1404dac43e596f247120314cad", "score": "0.71995217", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS, DELETE'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "a0981516131f18abf3263105b718fc32", "score": "0.71992683", "text": "def cors_preflight_check\n if request.method.downcase == 'options'\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, Content-Type, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "a0981516131f18abf3263105b718fc32", "score": "0.71992683", "text": "def cors_preflight_check\n if request.method.downcase == 'options'\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, Content-Type, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "3b9a3ab4494cc66a07a6cff86dd85859", "score": "0.7184488", "text": "def cors_preflight_check\n if request.headers[\"HTTP_ORIGIN\"] and access_control_allow_origin\n headers['Access-Control-Allow-Origin'] = request.headers[\"HTTP_ORIGIN\"]\n headers['Access-Control-Expose-Headers'] = 'ETag'\n headers['Access-Control-Allow-Methods'] = 'GET, POST, PATCH, PUT, DELETE, OPTIONS, HEAD'\n headers['Access-Control-Allow-Headers'] = '*,X-Requested-With,X-Prototype-Version,Content-Type,If-Modified-Since,If-None-Match,Auth-User-Token'\n headers['Access-Control-Max-Age'] = '1728000'\n headers['Access-Control-Allow-Credentials'] = 'true'\n\n if request.method == :options\n return render(:text => '', :content_type => 'text/plain')\n end\n end \n end", "title": "" }, { "docid": "3b9a3ab4494cc66a07a6cff86dd85859", "score": "0.7184488", "text": "def cors_preflight_check\n if request.headers[\"HTTP_ORIGIN\"] and access_control_allow_origin\n headers['Access-Control-Allow-Origin'] = request.headers[\"HTTP_ORIGIN\"]\n headers['Access-Control-Expose-Headers'] = 'ETag'\n headers['Access-Control-Allow-Methods'] = 'GET, POST, PATCH, PUT, DELETE, OPTIONS, HEAD'\n headers['Access-Control-Allow-Headers'] = '*,X-Requested-With,X-Prototype-Version,Content-Type,If-Modified-Since,If-None-Match,Auth-User-Token'\n headers['Access-Control-Max-Age'] = '1728000'\n headers['Access-Control-Allow-Credentials'] = 'true'\n\n if request.method == :options\n return render(:text => '', :content_type => 'text/plain')\n end\n end \n end", "title": "" }, { "docid": "ec83d90927a02aabb00705192853b9a0", "score": "0.7171062", "text": "def cors_preflight_check\n\t\tif request.method == \"OPTIONS\"\n\t\t\theaders['Access-Control-Allow-Origin'] = '*'\n\t\t\theaders['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n\t\t\theaders['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n\t\t\theaders['Access-Control-Max-Age'] = '100'\n\t\t\trender :text => '', :content_type => 'text/plain'\n\t\tend\n\tend", "title": "" }, { "docid": "71bc2f3b3e52701ca7b2dd7ee8bfbc37", "score": "0.71697104", "text": "def cors_preflight_check\n if request.method == \"OPTIONS\"\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version, X-CSRF-Token, Authorization'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "c5567a2f3e31ae3f759b2490a4dfdc77", "score": "0.71521264", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = '*'\n headers['Access-Control-Max-Age'] = '1728000'\n #render :text => '', :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "b9203a82c9007033ade3f1a3865629ee", "score": "0.71429104", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version, Token'\n render :text => '', :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "f5109443e75ba0676a908c2b38164049", "score": "0.7127561", "text": "def cors_preflight_check\n\t\tif request.method == :options\n\t\t\theaders['Access-Control-Allow-Origin'] = '*'\n\t\t\theaders['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\n\t\t\theaders['Access-Control-Request-Method'] = '*'\n\t\t\theaders['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\t \n\t\t\trender :text => '', :content_type => 'text/plain'\n\t\tend\n\tend", "title": "" }, { "docid": "a80a6e2902b3ceb3a466f86043a607cf", "score": "0.7119223", "text": "def cors_preflight_check\n\t\tif request.method == :options\n\t\t\theaders['Access-Control-Allow-Origin'] = '*'\n\t\t\theaders['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\n\t\t\theaders['Access-Control-Request-Method'] = '*'\n\t\t\theaders['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\n\t\t\theaders['Access-Control-Max-Age'] = '1728000'\n\t\t\trender :text => '', :content_type => 'text/plain'\n\t\tend\n\tend", "title": "" }, { "docid": "a80a6e2902b3ceb3a466f86043a607cf", "score": "0.7119223", "text": "def cors_preflight_check\n\t\tif request.method == :options\n\t\t\theaders['Access-Control-Allow-Origin'] = '*'\n\t\t\theaders['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\n\t\t\theaders['Access-Control-Request-Method'] = '*'\n\t\t\theaders['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\n\t\t\theaders['Access-Control-Max-Age'] = '1728000'\n\t\t\trender :text => '', :content_type => 'text/plain'\n\t\tend\n\tend", "title": "" }, { "docid": "a80a6e2902b3ceb3a466f86043a607cf", "score": "0.7119223", "text": "def cors_preflight_check\n\t\tif request.method == :options\n\t\t\theaders['Access-Control-Allow-Origin'] = '*'\n\t\t\theaders['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\n\t\t\theaders['Access-Control-Request-Method'] = '*'\n\t\t\theaders['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\n\t\t\theaders['Access-Control-Max-Age'] = '1728000'\n\t\t\trender :text => '', :content_type => 'text/plain'\n\t\tend\n\tend", "title": "" }, { "docid": "eaabcb03a58ded3378005b51e728393b", "score": "0.7111211", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = 'https://byhtada.github.io'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "4802578f38b507260648f0605f7c038c", "score": "0.7109288", "text": "def cors_preflight_check\n puts '>>>>>> cors_preflight_check'\n if request.method == :options\n puts '>>>>>> method is options'\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "8f48beba2c05c40547eeb52dc1879735", "score": "0.71090573", "text": "def cors_preflight_check\n\t if request.method == :options\n\t headers['Access-Control-Allow-Origin'] = '*'\n\t headers['Access-Control-Allow-Methods'] = 'GET'\n\t headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n\t headers['Access-Control-Max-Age'] = '1728000'\n\t render :text => '', :content_type => 'text/plain'\n\t end\n\tend", "title": "" }, { "docid": "1b0cf6f4b7d52b27480617aa4cd93b36", "score": "0.71069235", "text": "def cors_preflight_check\n\t if request.method == :options\n\t\theaders['Access-Control-Allow-Origin'] = '*'\n\t\theaders['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS, PUT'\n\t\theaders['Access-Control-Allow-Headers'] = '*'\n\t\theaders['Access-Control-Request-Method'] = '*'\n\t\theaders['Access-Control-Max-Age'] = '1728000'\n\t\trender :text => '', :content_type => 'text/plain'\n\t end\n\tend", "title": "" }, { "docid": "dc5ea2c0e5ba581efc736cff34c2198b", "score": "0.70997787", "text": "def cors_preflight_check\n if request.method == :options\n raise \"elad\"\n response.headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "fe154407ea9f33af5df05a5ffe973af6", "score": "0.7099179", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\nend", "title": "" }, { "docid": "fe154407ea9f33af5df05a5ffe973af6", "score": "0.7099179", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\nend", "title": "" }, { "docid": "fe154407ea9f33af5df05a5ffe973af6", "score": "0.7099179", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\nend", "title": "" }, { "docid": "65632aceb2ca8d95ee260fbc6a0b61c7", "score": "0.70991147", "text": "def cors_headers\n headers 'Access-Control-Allow-Origin' => '*',\n 'Access-Control-Allow-Headers' => 'Content-Type, Authorization'\n\n halt 200 if request.request_method == 'OPTIONS'\n end", "title": "" }, { "docid": "187222872c1d94ab26204a38f16358a3", "score": "0.70971113", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = allowed_origin\n headers['Access-Control-Allow-Methods'] = 'PUT, POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-CSRF-Token'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "3c739939b5905e7725f7d233e21a9945", "score": "0.7088683", "text": "def cors_preflight_check\n\t\tif request.method.downcase.to_sym == :options\n\t\t\theaders['Access-Control-Allow-Origin'] = '*'\n\t\t\theaders['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n\t\t\theaders['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n\t\t\theaders['Access-Control-Max-Age'] = '1728000'\n\t\t\trender :text => '', :content_type => 'text/plain'\n\t\tend\n\tend", "title": "" }, { "docid": "64d19ae7d2e465aa7870d8ed307263e9", "score": "0.7087178", "text": "def cors_preflight_check\n logger.debug \"in cors_preflight_check{ request: #{request.original_fullpath}, method :#{request.method} }\"\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PATCH, PUT, DELETE'\n headers['Access-Control-Allow-Headers'] = '*'\n headers['Access-Control-Max-Age'] = '1728000'\n head :no_content\n end\n end", "title": "" }, { "docid": "72e6337498c331d32d995451b7dcb9fc", "score": "0.70820355", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n # render :text => '', :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "72e6337498c331d32d995451b7dcb9fc", "score": "0.70820355", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n # render :text => '', :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "763c1f7948dea0d320d2ce28e6ff808a", "score": "0.70795524", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, X_XSRF_TOKEN, X-Prototype-Version, Content-Type'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "6c0691ee717468fa6ca5124c8a815607", "score": "0.70491546", "text": "def cors_preflight_check\n if request.method == \"OPTIONS\"\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = %w{GET POST PUT DELETE}.join(\",\")\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/xml'\n end\n end", "title": "" }, { "docid": "29338710f3328893ebe83a405f76129a", "score": "0.7046466", "text": "def cors_preflight_check\n\t # puts \"***preflight: method = #{request.method}\"\n\t if request.method == :options\n\t headers['Access-Control-Allow-Origin'] = '*'\n\t headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n\t headers['Access-Control-Allow-Headers'] = '*'\n\t headers['Access-Control-Max-Age'] = '1728000'\n\t render :text => '', :content_type => 'text/plain'\n\t end\n\tend", "title": "" }, { "docid": "31a3f1e40faae4fb5c250062d36ea9f3", "score": "0.7031841", "text": "def cors_preflight_check\n if request.method == 'OPTIONS'\n headers['Access-Control-Allow-Origin'] = 'http://localhost:8000'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version, Content-Type'\n headers['Access-Control-Allow-Credentials'] = 'true'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "e49fbe4584b348d49417c23b407efaeb", "score": "0.70128894", "text": "def preflight?\n\t\treturn self.origin &&\n\t\t\tself.verb == :OPTIONS &&\n\t\t\tself.header.access_control_request_method\n\tend", "title": "" }, { "docid": "c702f1d249e6aed018ae0f4c3bc0a9d0", "score": "0.7006614", "text": "def cors_preflight_check\n\t\tif request.method == :options\n\t\t\theaders['Access-Control-Allow-Origin'] = '*'\n\t\t\theaders['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\n\t\t\theaders['Access-Control-Request-Method'] = '*'\n\t\t\theaders['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\n\t\t\theaders['Access-Control-Max-Age'] = '1728000'\n\t\t\trender :text => '', :content_type => 'text/plain'\n\t\tend\n\t\tputs \"cors_preflight_check done\"\n\tend", "title": "" }, { "docid": "99847e38f5c6540a6afd389fe2ca91d2", "score": "0.6995621", "text": "def cors_preflight_check\n\t\t\t\tif request.method == :options\n\t\t\t\t\theaders['Access-Control-Allow-Origin'] = '*'\n\t\t\t\t\theaders['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\n\t\t\t\t\theaders['Access-Control-Request-Method'] = '*'\n\t\t\t\t\theaders['Access-Control-Allow-Headers'] = 'Origin, x-xsrf-token, X-Requested-With, Content-Type, Accept, Authorization'\n\t\t\t\t\theaders['Access-Control-Max-Age'] = '1728000'\n\t\t\t\t\trender :text => '', :content_type => 'text/plain'\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "66e073eb7ed046e3e59e5aad1c66b9ea", "score": "0.6989654", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = request.env['HTTP_ORIGIN']\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = %w{Origin Accept Content-Type X-Requested-With X-CSRF-Token}.join(\",\")\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "8808ebab0ed04a0152fc2a6090abc04a", "score": "0.69875574", "text": "def cors_preflight_check\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version,Accept,Origin'\n if request.method == :options\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\nend", "title": "" }, { "docid": "2836e67ad05002bbe12b2ce7db570b34", "score": "0.69735026", "text": "def cors_preflight_check\n\t\tif request.method == :options\n\t\t\theaders['Access-Control-Allow-Origin'] = 'http://localhost:4200'\n\t\t\theaders['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n\t\t\theaders['Access-Control-Request-Method'] = '*'\n\t\t\theaders['Access-Control-Allow-Headers'] = '*'\n\t\t\theaders['Access-Control-Max-Age'] = '1728000'\n\t\t\trender :text => '', :content_type => 'text/plain'\n\t\tend\n\tend", "title": "" }, { "docid": "76fe1d4d18056922dea88bbddd508869", "score": "0.69516754", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = 'http://pizzatime.ovh, http://admin.pizzatime.ovh'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = 'POST, PUT, DELETE, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'application/json'\n end\n end", "title": "" }, { "docid": "34682d2542a1ed40a32389e0368a9c70", "score": "0.694409", "text": "def cors_preflight_check\n if request.method == \"OPTIONS\"\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'GET, PUT, POST, DELETE, OPTIONS, PATCH'\n headers['Access-Control-Allow-Headers'] = 'X-CSRF-Token, X-Requested-With, X-Prototype-Version, content-type, api-token'\n headers['Access-Control-Max-Age'] = '1728000'\n render(text: '', content_type: 'text/plain')\n false\n end\n true\n end", "title": "" }, { "docid": "1e7930aaebb2fffdfb3f8c5b2ce60449", "score": "0.6928247", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = 'http://localhost:9292'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = 'http://localhost:9292'\n headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\n render :text => '', :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "dd8820d184847660953ff23e9b76da30", "score": "0.6899694", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = '*'\n headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\n end\n end", "title": "" }, { "docid": "eaea0e58b32305f22847af30760d2bc0", "score": "0.6893648", "text": "def options\n unless Qa.config.cors_headers?\n head :not_implemented\n return\n end\n response.headers['Access-Control-Allow-Origin'] = '*'\n response.headers['Access-Control-Allow-Methods'] = 'GET, OPTIONS'\n head :no_content\n end", "title": "" }, { "docid": "6358ad58f9305b09f5b4bc5888375767", "score": "0.688019", "text": "def cors_options\n head :ok\n end", "title": "" }, { "docid": "9dc8615a75341aaef48e1deba1263a40", "score": "0.685957", "text": "def cors_preflight_check\n if request.method == :options\n #headers['Access-Control-Allow-Origin'] = request.headers['Origin'] if request.headers && request.headers['Origin']\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version, Content-Type, Origin, Accept'\n #headers['Access-Control-Allow-Credentials'] = 'true'\n headers['Access-Control-Max-Age'] = '1728000'\n render :text => '', :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "2be3220dfcab4f3a15a0b8533d2a052f", "score": "0.6859446", "text": "def options?; request_method == \"OPTIONS\" end", "title": "" }, { "docid": "e46525416a93cf9c4e12516f05be869c", "score": "0.6836499", "text": "def do_OPTIONS(request, response)\n log_request(request)\n response.header['Access-Control-Allow-Origin'] = '*'\n response.header['Access-Control-Allow-Methods'] = 'POST, OPTIONS'\n response.header['Access-Control-Allow-Headers'] = %w[Accept\n Bugsnag-Api-Key Bugsnag-Integrity\n Bugsnag-Payload-Version\n Bugsnag-Sent-At Content-Type\n Origin].join(',')\n\n response.status = Server.status_code\n end", "title": "" }, { "docid": "56a212ca660eae805290f4e575ba550f", "score": "0.6818827", "text": "def cors_preflight_check\n\t\tresponse.headers['Access-Control-Allow-Origin'] = request.headers['Origin'] || '*'\n\t\tresponse.headers['Access-Control-Allow-Credentials'] = 'true' \n \tif request.method == :options\n\t \theaders['Access-Control-Allow-Origin'] = '*'\n\t headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n\t headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n\t headers['Access-Control-Max-Age'] = '1728000'\n\t render plain: '', :content_type => 'text/plain'\n\t end\n\tend", "title": "" }, { "docid": "d0be9833d471cf7887a48119801c3c47", "score": "0.68179786", "text": "def do_OPTIONS(request, response)\n super\n\n response.header['Access-Control-Allow-Methods'] = 'POST, OPTIONS'\n response.status = Server.status_code('OPTIONS')\n end", "title": "" }, { "docid": "d0be9833d471cf7887a48119801c3c47", "score": "0.68179786", "text": "def do_OPTIONS(request, response)\n super\n\n response.header['Access-Control-Allow-Methods'] = 'POST, OPTIONS'\n response.status = Server.status_code('OPTIONS')\n end", "title": "" }, { "docid": "7b901fc038c5c48e01298d8f68930dcd", "score": "0.6801343", "text": "def cors_preflight_check\n\t if request.method == :options\n\t headers['Access-Control-Allow-Origin'] = '*'\n\t headers['Access-Control-Allow-Methods'] = 'GET, OPTIONS'\n\t headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\n\t headers['Access-Control-Max-Age'] = '1728000'\n\t end\n\tend", "title": "" }, { "docid": "6979f651e1a37a23593973e2bae023fa", "score": "0.67808276", "text": "def cors_preflight_check\n logger.info \">>> responding to CORS request\"\n render :text => '', :content_type => 'text/plain'\n end", "title": "" }, { "docid": "6979f651e1a37a23593973e2bae023fa", "score": "0.67808276", "text": "def cors_preflight_check\n logger.info \">>> responding to CORS request\"\n render :text => '', :content_type => 'text/plain'\n end", "title": "" }, { "docid": "6979f651e1a37a23593973e2bae023fa", "score": "0.67808276", "text": "def cors_preflight_check\n logger.info \">>> responding to CORS request\"\n render :text => '', :content_type => 'text/plain'\n end", "title": "" }, { "docid": "6979f651e1a37a23593973e2bae023fa", "score": "0.67808276", "text": "def cors_preflight_check\n logger.info \">>> responding to CORS request\"\n render :text => '', :content_type => 'text/plain'\n end", "title": "" }, { "docid": "0e3854374bdea8dacc304ccb72dd7b84", "score": "0.6777042", "text": "def do_OPTIONS(req, res)\n res[\"allow\"] = \"GET,HEAD,POST,OPTIONS\"\n end", "title": "" }, { "docid": "9da0d1c0d895467bd1d10f0af4db5423", "score": "0.6744128", "text": "def cors_preflight_check\n if request.method == 'OPTIONS'\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version, Token'\n headers['Access-Control-Max-Age'] = '1728000'\n end\n end", "title": "" }, { "docid": "a72f61607df4b8b6bae8c9b244a2d879", "score": "0.674215", "text": "def do_OPTIONS(_req, res)\n res['allow'] = 'GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS,CONNECT'\n end", "title": "" }, { "docid": "9f038079853cc659f930c6a6036d261f", "score": "0.67279714", "text": "def set_cors_headers\n url = URI(request.url)\n\n response.set_header('Access-Control-Allow-Origin', \"#{url.scheme}://#{url.host}\")\n response.set_header('Access-Control-Allow-Methods', 'GET')\n response.set_header('Access-Control-Allow-Headers', 'Accept, Content-Type')\n response.set_header('Vary', 'Origin')\n\n render plain: '', content_type: 'text/plain' if request.method == 'OPTIONS'\n end", "title": "" }, { "docid": "ca6a4ed66ab5ad5ec87329244b127077", "score": "0.6726596", "text": "def accept_cors_request\n if request.env[\"HTTP_ORIGIN\"].present?\n headers[\"Access-Control-Allow-Origin\"] = request.env[\"HTTP_ORIGIN\"]\n headers[\"Access-Control-Allow-Methods\"] = \"POST, GET, OPTIONS\"\n headers[\"Access-Control-Allow-Headers\"] = \"Content-Type, Origin, Accept\"\n end\n\n if request.request_method == \"OPTIONS\"\n headers[\"Access-Control-Max-Age\"] = \"86400\"\n headers[\"Content-Length\"] = \"0\"\n headers[\"Content-Type\"] = \"text/plain\"\n render text: \"\"\n end\n end", "title": "" }, { "docid": "5c5483ab89b50b810d8550c95fe6f01b", "score": "0.67217827", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = 'http://faymotherapp.herokuapp.com'\n headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'\n headers['Access-Control-Request-Method'] = 'http://faymotherapp.herokuapp.com'\n headers['Access-Control-Allow-Headers'] = 'Origin, X-Requested-With, Content-Type, Accept, Authorization'\n render :text => '', :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "0209b8e0c2daa88d324baae9dc6fa004", "score": "0.67004925", "text": "def do_OPTIONS(_req, res)\n res['allow'] = 'GET,HEAD,POST,OPTIONS,CONNECT,PUT'\n end", "title": "" }, { "docid": "054b74366fe6f73614c38b10e0ea9819", "score": "0.6693003", "text": "def cor\n\t\theaders[\"Access-Control-Allow-Origin\"] = \"*\"\n\t\theaders[\"Access-Control-Allow-Methods\"] = %w{GET POST PUT DELETE}.join(\",\")\n\t\theaders[\"Access-Control-Allow-Headers\"] = %w{Origin Accept Content-Type X-Requested-With X-CSRF-Token}.join(\",\")\n\t\thead(:ok) if request.request_method == \"OPTIONS\"\n\tend", "title": "" }, { "docid": "acae1378d2da137e71ac1a7091739ce8", "score": "0.66902643", "text": "def cors_preflight_check\n if request.method == :options\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version, Content-Length, bookmarklet_session_token, Content-Type'\n headers['Access-Control-Max-Age'] = '1728000'\n render :json => {}, :content_type => \"application/json\"\n end\n end", "title": "" }, { "docid": "0a6e59352f2cf111d4ca2d5d41d21dc2", "score": "0.6681724", "text": "def cors_preflight_check\n if request.method == :options\n # headers['Access-Control-Allow-Origin'] = \"http://www.postiles.com\"\n headers['Access-Control-Allow-Origin'] = \"*\"\n headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'X-Requested-With, X-Prototype-Version'\n render :text=>'', :content_type => 'text/plain'\n end\n end", "title": "" }, { "docid": "9b2748cedb47575a09f6863fac8a2a8c", "score": "0.66649497", "text": "def preflight?\n cors? && options?\n end", "title": "" }, { "docid": "234ce46326d7ed7bce0ce2773f647d25", "score": "0.663642", "text": "def cors_preflight_check\n render :text => '', :content_type => 'text/plain'\n end", "title": "" } ]
ab941da932450b8a05d4ccb596e7ef93
GET /flavors GET /flavors.json
[ { "docid": "ae9e558ae2f45b4bf1c16a6a6a067196", "score": "0.0", "text": "def index\n @flavors = Flavor.where(instock:[\"Yes\"]).order('name ASC')\n @outstock = Flavor.where(instock:[\"No\"]).order('name ASC')\n set_meta_tags title: \"Flavors\",\n site: \"B's Ice Cream\",\n reverse: true,\n description: \"Check out our unique homemade flavors made right in our shop\",\n keywords: \"best ice cream, homemade ice cream, ice cream, ice cream near me, south shore ice cream, ice cream places near me, ice cream shop, ice cream shops near me, best ice cream near me, ice cream nearby, homemade ice cream near me, ice cream parlour, ice cream stores near me, ice cream parlour near me, creamery near me, the ice cream shop, ice cream around me, nearest ice cream shop, homemade vanilla ice cream, nearest ice cream place, good ice cream near me, closest ice cream, cream ice cream, places to get ice cream near me, ice cream company, best ice cream places near me\" \n end", "title": "" } ]
[ { "docid": "1456e7381c1fe0365cee7301c70e4d10", "score": "0.81710523", "text": "def flavors\n login\n\n uri = @services['compute'] + 'flavors/detail'\n\n body = get uri\n\n body['flavors'].map do |flavor|\n Flavor.new flavor\n end\n end", "title": "" }, { "docid": "25d2b49c24e480b0979da24f2fc7416e", "score": "0.8127812", "text": "def flavors\n actuator = Actuator.find(params[:id])\n respond_to do |format|\n format.html { render json: actuator.flavors}\n format.json { render json: actuator.flavors}\n end\n end", "title": "" }, { "docid": "c95be4ff1a5b3f42efa0819c9bba0bd3", "score": "0.8027804", "text": "def get_flavors\n request(\n :expects => 200,\n :method => 'GET',\n :parser => Fog::Parsers::Compute::Slicehost::GetFlavors.new,\n :path => 'flavors.xml'\n )\n end", "title": "" }, { "docid": "3eb23b9a11b72b0c552608bc03eedf61", "score": "0.7984704", "text": "def get_flavors\n puts \"Getting flavor list\"\n flavors = @conn.list_flavors\n\n for flavor in flavors.body['flavors']\n puts flavor\n end\n\n return flavors.body['flavors'][0]\n end", "title": "" }, { "docid": "b4183b121d392448c5cbe8716a6c4f6d", "score": "0.74766034", "text": "def show\n\t\t@bean = Bean.find(params[:id])\n\t\t@flavors = @bean.flavors.to_json\n\tend", "title": "" }, { "docid": "98e11b51aa63772dc2443e780894e443", "score": "0.7180385", "text": "def list_flavors_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.list_flavors ...'\n end\n if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"limit\"]\" when calling DefaultApi.list_flavors, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"limit\"]\" when calling DefaultApi.list_flavors, must be greater than or equal to 1.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"offset\"]\" when calling DefaultApi.list_flavors, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/flavors'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'FlavorsCollection' \n\n # auth_names\n auth_names = opts[:auth_names] || ['UserSecurity']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#list_flavors\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "05744ccf5cf9cd785b9fd483b1f90ed7", "score": "0.7151782", "text": "def list_flavors(opts = {})\n data, _status_code, _headers = list_flavors_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "d36d249434803da0a4387617c2a86335", "score": "0.6951752", "text": "def get_flavor(name)\n response = @conn[:nova].get do |req|\n req.url \"/v2/#{@tenant}/flavors\"\n req.headers = self.headers\n end\n\n if response.status != 200\n exception_message = \"Get flavors request failed, error code: #{response.status}, #{response.body}\"\n raise Exceptions::OSApiException.new(exception_message)\n end\n\n begin\n flav = json(response.body)[:flavors].detect { |net| net[:name] == name }\n rescue\n raise Exceptions::OSApiException.new(\"No flavors returned by /v2/#{options[:tenant]}/flavors\")\n end\n\n return flav[:id] if flav\n raise Exceptions::OSApiException.new(\"No #{name} flavor returned by /v2/#{options[:tenant]}/flavors\")\n end", "title": "" }, { "docid": "831b4d1509bc44e58f3a933b6ca84ba4", "score": "0.6721897", "text": "def flavor\n requires :flavor_id\n @flavor ||= service.flavors.get(flavor_id.to_i)\n end", "title": "" }, { "docid": "d1b21236bcc0f0a405114d820851da44", "score": "0.6513311", "text": "def index\n @flavors = current_user.flavors.all\n @algorithms = [[\"Facebook\",\"fbook\"],[\"Timeliness\",\"time\"],[\"Mix\",\"fbook_plus_time\"]] #would like to not have to hardcode this\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @flavors }\n end\n end", "title": "" }, { "docid": "f4120c48acf370ce8dff7c4e6e8036f0", "score": "0.6495867", "text": "def populate\n response = @connection.dbreq(\"GET\",@dbmgmthost,\"#{@dbmgmtpath}/flavors/#{CloudDB.escape(@id.to_s)}\",@dbmgmtport,@dbmgmtscheme)\n CloudDB::Exception.raise_exception(response) unless response.code.to_s.match(/^20.$/)\n data = JSON.parse(response.body)['flavor']\n @id = data[\"id\"]\n @name = data[\"name\"]\n @ram = data[\"ram\"]\n @vcpus = data[\"vcpus\"]\n @links = data[\"links\"]\n true\n end", "title": "" }, { "docid": "9aafe5d460d43a3b05280d904b9d216d", "score": "0.62911946", "text": "def show\n @sm_flavor = SmFlavor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sm_flavor }\n end\n end", "title": "" }, { "docid": "7373100c1d3c0a34942dc58ca0361d3d", "score": "0.6256971", "text": "def new\n @flavor = Flavor.new\n @user = current_user\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @flavor }\n end\n end", "title": "" }, { "docid": "ce310365e42e9114037fb1a3bc58de5a", "score": "0.62529695", "text": "def query_flavor(sCloudObj, sQuery, hParams)\n flavor_name = hParams['server#flavor_name']\n # list = forj_query_flavor(sCloudObj, sQuery, hParams)\n # query_single(sCloudObj, list, sQuery, flavor_name)\n query_single(sCloudObj, sQuery, flavor_name)\n end", "title": "" }, { "docid": "72df5939e9cee5cec78acee9159bf07f", "score": "0.6223593", "text": "def flavour(name)\n flavour = name\n\n if @version_flavours.nil?\n (@available_versions || []).each do |v|\n v[:allowed_flavours] << flavour unless flavour.blank?\n end\n else\n @version_flavours << flavour unless flavour.blank?\n end\n end", "title": "" }, { "docid": "5582b5d1067c8289d5be5a66b1a1af73", "score": "0.6158332", "text": "def show_flavor_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.show_flavor ...'\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling DefaultApi.show_flavor\"\n end\n pattern = Regexp.new(/^\\d+$/)\n if @api_client.config.client_side_validation && id !~ pattern\n fail ArgumentError, \"invalid value for 'id' when calling DefaultApi.show_flavor, must conform to the pattern #{pattern}.\"\n end\n\n # resource path\n local_var_path = '/flavors/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Flavor' \n\n # auth_names\n auth_names = opts[:auth_names] || ['UserSecurity']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#show_flavor\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "c2b863659f3cd9af0dc5546cd1089fe5", "score": "0.61193854", "text": "def flavor\n CloudServers::Flavor.new(@connection,self.flavorId)\n end", "title": "" }, { "docid": "87b20c0053eb525d3f2179a82439e3a1", "score": "0.6095801", "text": "def query_flavor(sCloudObj, sQuery, hParams)\n sFlavor_name = hParams[:flavor_name]\n oList = forj_query_flavor(sCloudObj, sQuery, hParams)\n query_single(sCloudObj, oList, sQuery, sFlavor_name)\n end", "title": "" }, { "docid": "914a545a734ab5bbe6cdd19616b1d9cc", "score": "0.60469323", "text": "def get_flavor(flavor_id)\n request(\n :expects => 200,\n :method => 'GET',\n :parser => Fog::Parsers::Bluebox::GetFlavor.new,\n :path => \"api/block_products/#{flavor_id}.xml\"\n )\n end", "title": "" }, { "docid": "ba7120358fec0833e4323f8794f1f120", "score": "0.6014368", "text": "def forj_query_flavor(sCloudObj, sQuery, hParams)\n sFlavor_name = hParams[:flavor_name]\n oSSLError = SSLErrorMgt.new\n begin\n oList = controler.query(sCloudObj, sQuery)\n rescue => e\n if not oSSLError.ErrorDetected(e.message,e.backtrace, e)\n retry\n end\n end\n oList\n end", "title": "" }, { "docid": "4a22517922197ec04f01aebdbf679e6d", "score": "0.5999528", "text": "def show\n @order_flavor = OrderFlavor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @order_flavor }\n end\n end", "title": "" }, { "docid": "cd6967ce9c80bbed89c44343c9c00095", "score": "0.5989274", "text": "def show\n @flavor = Flavor.find(params[:id])\n\n @story = @flavor.get_story(@flavor.read_index)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @flavor }\n end\n end", "title": "" }, { "docid": "208018f899299d5db0270642be0f3f4e", "score": "0.59505284", "text": "def index\n render json: @variants\n end", "title": "" }, { "docid": "73b202168b9914a63e92d4c67b51198d", "score": "0.59250754", "text": "def index\n @fabric_variants = FabricVariant.all\n end", "title": "" }, { "docid": "dfc2171cb526948d94b7a291e4d0ceb8", "score": "0.5924677", "text": "def flavors_table\n # We don't have \"flavors\" actually, you can just pick from the menu.\n # Let's shim in place the standard openstack flavors so people can get started without making loads of decisions.\n\n columns = [\n ui.color(\"| FLAVOR\", :bold, :green),\n ui.color(\"| CORES\", :bold, :green),\n ui.color(\"| RAM\", :bold, :green),\n ui.color(\"| DISK\", :bold, :green)\n ]\n\n # tiny\n columns << \"| tiny\"\n columns << \"| 1\"\n columns << \"| 1024\"\n columns << \"| 25GB [LOCAL]\"\n\n # small\n columns << \"| small\"\n columns << \"| 2\"\n columns << \"| 2048\"\n columns << \"| 100GB [LOCAL]\"\n\n\n # medium\n columns << \"| medium\"\n columns << \"| 4\"\n columns << \"| 4096\"\n columns << \"| 150GB [LOCAL]\"\n\n\n # large\n columns << \"| large\"\n columns << \"| 8\"\n columns << \"| 8192\"\n columns << \"| 200GB [LOCAL]\"\n\n\n # xlarge\n columns << \"| xlarge\"\n columns << \"| 16\"\n columns << \"| 16384\"\n columns << \"| 300GB [LOCAL]\"\n end", "title": "" }, { "docid": "1b408c2ace4be9ec5cd22b09e32b1dd7", "score": "0.59208816", "text": "def create\n @flavor = Flavor.new(flavor_params)\n\n respond_to do |format|\n if @flavor.save\n format.html { redirect_to @flavor, notice: 'Flavor was successfully created.' }\n format.json { render :show, status: :created, location: @flavor }\n else\n format.html { render :new }\n format.json { render json: @flavor.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c58fde7fedd6d0ac02018032c13f5042", "score": "0.591945", "text": "def index\n @farmings = Farming.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @farmings }\n end\n end", "title": "" }, { "docid": "3d3173c231ca11fe732add3b46a8c039", "score": "0.58912593", "text": "def index\n\t\t@schemes = Scheme.all\n\n\t\trender json: @schemes\n\tend", "title": "" }, { "docid": "7cb6598f2e93b1ea79a8e9424f8ab61c", "score": "0.5821186", "text": "def show_flavor(id, opts = {})\n data, _status_code, _headers = show_flavor_with_http_info(id, opts)\n data\n end", "title": "" }, { "docid": "a46c318a48ebbf18beea376fa5dcfd57", "score": "0.58114034", "text": "def flavors\n FlavorBrand.all.select {|fb| fb.brand == self}.map(&:flavor).uniq\n end", "title": "" }, { "docid": "da0423a0991827ca599550049f055032", "score": "0.5785477", "text": "def set_flavor\n @flavor = Flavor.find(params[:id])\n end", "title": "" }, { "docid": "da0423a0991827ca599550049f055032", "score": "0.5785477", "text": "def set_flavor\n @flavor = Flavor.find(params[:id])\n end", "title": "" }, { "docid": "da0423a0991827ca599550049f055032", "score": "0.5785477", "text": "def set_flavor\n @flavor = Flavor.find(params[:id])\n end", "title": "" }, { "docid": "0cb15a6190f40b925fb9252d8d089c8e", "score": "0.5771252", "text": "def index\n favorites = Favorite.all\n render json: favorites\n end", "title": "" }, { "docid": "2ca2a06855cf8fe5b92e1b217834e27e", "score": "0.5768247", "text": "def brands\n respond_to do |format|\n format.json { render json: { \"brands\" => Brand.all_for_site.order(:name) } }\n end\n end", "title": "" }, { "docid": "c620e13e3770c0a8fce991c05d0f0dbb", "score": "0.5728711", "text": "def show\n @farm = Farm.find(params[:id])\n @products = @farm.products\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @farm }\n end\n end", "title": "" }, { "docid": "7277e8356c3c719b444a3e6295313f4c", "score": "0.57171917", "text": "def add_cloud_database_flavors(extra_properties = {})\n add_cloud_collection(:cloud_database_flavors, extra_properties) do |builder|\n # Model we take just from a DB, there is no flavors API\n builder.add_properties(:strategy => :local_db_find_references) if targeted?\n end\n end", "title": "" }, { "docid": "fbdcbb72db2c19da1d0fd289f86c7aca", "score": "0.5711679", "text": "def show\n @farming = Farming.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @farming }\n end\n end", "title": "" }, { "docid": "1329c8688847cb5b9f3f971732352102", "score": "0.5706492", "text": "def see_all_pez\n @flavors.join(\", \")\n end", "title": "" }, { "docid": "1536c5be1108cc7501a218428ae5d516", "score": "0.5701562", "text": "def add_flavor_to_tea\n @tea = Tea.find(params[:id])\n @flavor = Flavor.find(params[:flavor_id])\n\n @tea.flavors << @flavor\n\n render json: @tea, include: :flavors\n end", "title": "" }, { "docid": "eb6315d4712a3f0716d6e880af008e98", "score": "0.5691103", "text": "def new\n @sm_flavor = SmFlavor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sm_flavor }\n end\n end", "title": "" }, { "docid": "0188b1a45e3c4f5f1e6218a77fb8af04", "score": "0.569061", "text": "def show\n respond_to do |format|\n format.html\n format.json { render json: @favorite }\n end\n end", "title": "" }, { "docid": "c8e03ab5f08828447209344446c794a5", "score": "0.56879485", "text": "def show\n @cloud = Cloud.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cloud }\n end\n end", "title": "" }, { "docid": "cbc33f36805e2b1a3485610595023ca1", "score": "0.5680931", "text": "def index\n render json: Favorite.all(params[\"id\"])\n end", "title": "" }, { "docid": "1816ab0441f5723f06cc34aeebafdb0a", "score": "0.56795394", "text": "def index\n @variations = Variation.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @variations }\n end\n end", "title": "" }, { "docid": "93d7b36794b96380caa881cc274f58ea", "score": "0.567515", "text": "def show\n render json: MangaBookshelf.find_shelves(params[:id])\n end", "title": "" }, { "docid": "2c97ce0b6c1fdcb9ab9b05c2abbbb9b6", "score": "0.5668988", "text": "def index\n @selection_flute_sizes = SelectionFluteSize.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @selection_flute_sizes }\n end\n end", "title": "" }, { "docid": "4ae7f0e26999746df1de8dfc9a4e55ea", "score": "0.5668504", "text": "def show\n favorite = Favorite.find(params[:id])\n render json: favorite\n end", "title": "" }, { "docid": "f457ab03cea512136b1354976c90a1e4", "score": "0.5667469", "text": "def show\n respond_to do |format|\n format.json { render json: @brand, status: 200 }\n end\n end", "title": "" }, { "docid": "c087e564948d0e82e29f16cbee2d7c0b", "score": "0.5665655", "text": "def destroy\n @flavor = Flavor.find(params[:id])\n @flavor.destroy\n\n respond_to do |format|\n format.html { redirect_to flavors_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "df2e9382f192d8ff4a8cd1f45c988f44", "score": "0.5662434", "text": "def show\n @family = load_family\n\n respond_to do |format|\n format.html\n format.json\n end \n end", "title": "" }, { "docid": "64b10be47f404f3531e374bdde8013a9", "score": "0.5659741", "text": "def destroy\n @flavor.destroy\n respond_to do |format|\n format.html { redirect_to flavors_url, notice: 'Flavor was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "67af21c62f8b8cd5ee60d5d84980babc", "score": "0.5657924", "text": "def index\n @favs = Favourite.all\n render json: @favs\n end", "title": "" }, { "docid": "5a7aa3a12b75470427a767afd43e3305", "score": "0.56340426", "text": "def set_flavour\n @flavour = Flavour.find(params[:id])\n end", "title": "" }, { "docid": "dc1f6baf700401be36d0d8497bd0cb57", "score": "0.562313", "text": "def index\n @themes = Theme.all\n\n render json: @themes\n end", "title": "" }, { "docid": "3194310fb8bb5704baf06bb1c2f99819", "score": "0.56141555", "text": "def show\n render json: @favourites\n end", "title": "" }, { "docid": "e6157977d5189bca0274a7c5faf09a47", "score": "0.560597", "text": "def index\n @repository_variants = RepositoryVariant.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @repository_variants }\n end\n end", "title": "" }, { "docid": "6ae21dbfe6e4438f84e0f57500f0394a", "score": "0.56027865", "text": "def get(flavor_id)\n self.class.new(:service => service).all.find {|flavor| flavor.id == flavor_id}\n end", "title": "" }, { "docid": "e7944d7a54326c0a6e28f5f6a5e80507", "score": "0.55942535", "text": "def list_brands\n brands = Brand.all.select('id', 'name')\n\n render json: {status: 0, data: {brands: brands}}\n end", "title": "" }, { "docid": "d98e1df30111e24f343b87df05cc8649", "score": "0.5591592", "text": "def get_flavor(id)\n OpenStack::Compute::Flavor.new(self,id)\n end", "title": "" }, { "docid": "c883271d30ef75cd011e9b3494b20c0e", "score": "0.5584358", "text": "def show\n @version = Version.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @version.files.map {|e| {name: e, _id:\"blarg\"}} }\n end\n end", "title": "" }, { "docid": "3ff7379e13325d63f2b229437645d0ff", "score": "0.5582851", "text": "def show\n @flavour = Flavour.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @flavour }\n end\n end", "title": "" }, { "docid": "cc04a06c33edffe50017c3f96d0a283a", "score": "0.5575627", "text": "def query_flavor_list\n get_resource_list('compute', 'flavors', 'flavors')\n puts 'The list of Compute Templates in this PowerVC cloud are:'\n headers = ['Compute Templates']\n print_table(headers, @resource_print_list)\n footer\n end", "title": "" }, { "docid": "9091445ab95149ce8ca5539d327139f2", "score": "0.55748963", "text": "def show\n render json: @species\n end", "title": "" }, { "docid": "98d1d3eb82e46d3e9c7c7f498ac20f59", "score": "0.556631", "text": "def show\n @vision = Vision.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vision }\n end\n end", "title": "" }, { "docid": "98d1d3eb82e46d3e9c7c7f498ac20f59", "score": "0.556631", "text": "def show\n @vision = Vision.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vision }\n end\n end", "title": "" }, { "docid": "98d1d3eb82e46d3e9c7c7f498ac20f59", "score": "0.556631", "text": "def show\n @vision = Vision.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vision }\n end\n end", "title": "" }, { "docid": "6bebe36ac5e7113d2e5fb44445078b63", "score": "0.5563045", "text": "def show\n @featuring = Featuring.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @featuring }\n end\n end", "title": "" }, { "docid": "9246480837d81831ad7a09ed87a877a6", "score": "0.5561967", "text": "def get(flavor_id)\n self.class.new(:connection => connection).all.detect { |flavor| flavor.id == flavor_id }\n end", "title": "" }, { "docid": "08b8df47830b917b16580231e6def907", "score": "0.5554797", "text": "def show\n @foundry = Foundry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @foundry }\n end\n end", "title": "" }, { "docid": "46c29b91176a86a83a7f5689f14389a6", "score": "0.55483204", "text": "def microformats(flavor, data, options = {})\n unless @@ENDPOINTS['microformats'].key?(flavor)\n return { 'status' => 'ERROR', 'statusInfo' => 'microformats parsing for ' + flavor + ' not available' }\n end\n\n # Add the URL encoded data to the options and analyze\n options[flavor] = data\n return analyze(@@ENDPOINTS['microformats'][flavor], options)\n end", "title": "" }, { "docid": "0597dd4edcc27d176a3e026f4bb391aa", "score": "0.55418795", "text": "def get_flavor(id)\n OpenStack::Compute::Flavor.new(self,id)\n end", "title": "" }, { "docid": "e27729d4ea768b422214fdf952e2065f", "score": "0.55386406", "text": "def get_brandings\n request :get,\n '/v3/brandings.json'\n end", "title": "" }, { "docid": "86ef3b85fe49205afa373ff1adffe272", "score": "0.553265", "text": "def show\n render json: @favorite\n end", "title": "" }, { "docid": "aa19bcdf2513479452b86cec99da2687", "score": "0.5528586", "text": "def show\n @color_family = ColorFamily.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @color_family }\n end\n end", "title": "" }, { "docid": "81f8eaefcc58e8bedc77f521aa2d48df", "score": "0.55260986", "text": "def index\n @species = Species.where(query_params)\n render json: @species\n end", "title": "" }, { "docid": "8cd95c28c296fecc49cc5108c28592a5", "score": "0.5522899", "text": "def create\n @flavour = Flavour.new(flavour_params)\n\n respond_to do |format|\n if @flavour.save\n format.html { redirect_to @flavour, notice: 'Flavour was successfully created.' }\n format.json { render :show, status: :created, location: @flavour }\n else\n format.html { render :new }\n format.json { render json: @flavour.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f730d70168edc9e0233ed9cb958f4839", "score": "0.55177826", "text": "def filter_compute_flavors(api, profile, constrained)\n flavor_list = api.flavors.to_a\n if constrained\n hdd = profile.select_entries(/Storage/, /Usage/)\n ram = profile.select_entries(/Memory/, /Used/)\n hdd = hdd.first.to_i\n ram = ram.first.to_i\n\n flavor_list.select! { |flavor| flavor.disk > hdd && flavor.ram > ram }\n end\n flavor_list.map! { |flavor| { name: flavor.name, id: flavor.id } }\n rescue Fog::Errors::TimeoutError, Excon::Errors::Timeout\n retry_exit('Unable to fetch flavor list.')\n retry\n end", "title": "" }, { "docid": "bd2b9fb7c1941dfc791aa00afb7b64c2", "score": "0.5517366", "text": "def brands\n param! :platform_code, Integer, required: true\n\n brands = PlatformBrand.get_platform_brands params[:platform_code], params[:is_text]\n render json: brands,\n each_serializer: PlatformBrandSerializer::Brand,\n root: \"data\"\n end", "title": "" }, { "docid": "f429f370cb322f1b45dcf737b647166f", "score": "0.55118436", "text": "def index\n @variants = @step.variants\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @variants }\n end\n end", "title": "" }, { "docid": "36bc028e303984bf434b9535c6f51cb1", "score": "0.5508539", "text": "def index\n @versions = Version.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @versions }\n end\n end", "title": "" }, { "docid": "f5f912a003336e9e771617843a04f539", "score": "0.5484676", "text": "def index\n render json: Vnf.all\n end", "title": "" }, { "docid": "6ee3de5a0b6927591ac74f707c69f1e1", "score": "0.54696244", "text": "def index\n @habits = Habit.all\n\n render json: @habits\n end", "title": "" }, { "docid": "70633c7f8b9b725b4bc1bda301c1d117", "score": "0.5460307", "text": "def show\n @family = Family.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @family }\n end\n end", "title": "" }, { "docid": "5885a5e51dbd977fad683383ef203b7f", "score": "0.54392165", "text": "def show\n render json: @fabric\n end", "title": "" }, { "docid": "b45d13ab94617884f073a6f4ec259380", "score": "0.54387593", "text": "def index\n @favourites = Favourite.all\n render json: @favourites\n end", "title": "" }, { "docid": "5b63d9f1c736159aa3e09783cdfdb8d3", "score": "0.54384017", "text": "def show\n @frustration = Frustration.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @frustration }\n end\n end", "title": "" }, { "docid": "fd26d6d1919c1b08fd0491c9ee7f0cee", "score": "0.5433128", "text": "def index\n @vet_labs = VetLab.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @vet_labs }\n end\n end", "title": "" }, { "docid": "2695f265ee3aac4aed7f07bde49fab5a", "score": "0.5433057", "text": "def index\n @branches = Api::V1::Branch.all\n\n render json: @branches\n end", "title": "" }, { "docid": "1bf812cde4dad9f5011a763c33e22139", "score": "0.5419823", "text": "def show\n @favorite_resource = FavoriteResource.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @favorite_resource }\n end\n end", "title": "" }, { "docid": "ef5e2057ec63d77ac4c1d469132ab545", "score": "0.54198223", "text": "def index\n @themes = Theme.order(:id).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @themes.as_json(only: [:id,:description, :image_name, :name ,:image_name_selection]) }\n end\n end", "title": "" }, { "docid": "14c25127ca2898d7615e00cf32396481", "score": "0.5414153", "text": "def json_index_themes\n @themes = Theme.order(:id)\n respond_to do |format|\n format.json { render json: @themes }\n end\n end", "title": "" }, { "docid": "aff921908b7c5d2d1c4f0d8a753338b4", "score": "0.54103494", "text": "def show\n @family = Family.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @family }\n end\n end", "title": "" }, { "docid": "aff921908b7c5d2d1c4f0d8a753338b4", "score": "0.54103494", "text": "def show\n @family = Family.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @family }\n end\n end", "title": "" }, { "docid": "b927d9e5a8b214a777c81b986e0cf48f", "score": "0.5406032", "text": "def brands\n call_api('/brands')\n end", "title": "" }, { "docid": "a7ad4cf085ae8d0fa1cc64bc2d094f4c", "score": "0.5404696", "text": "def show\n @favorite = Favorite.find(params[:id])\n render json:@favorite\n end", "title": "" }, { "docid": "36ceef01de87bc90489679091e0f5a6b", "score": "0.5400431", "text": "def get_favs\n beers = @user_beer.get_favs(@current_user)\n\n render json: {\n status: 200,\n beers: beers,\n errors: nil\n }\n end", "title": "" }, { "docid": "412d852338bb30718da88ea656e79ac8", "score": "0.53973264", "text": "def index\n @lavoraziones = Lavorazione.all\n end", "title": "" }, { "docid": "c7f446e62cb439245b1d488e24b811ac", "score": "0.53930837", "text": "def flavor_params\n params.fetch(:flavor, {})\n end", "title": "" }, { "docid": "8162b36f494b42733751d83f4fb0450f", "score": "0.5391486", "text": "def index\n @favs = Fav.all\n favs_list = ActiveModel::ArraySerializer.new(@favs, each_serializer: FavSerializer)\n res = { list: favs_list }\n render json: res\n end", "title": "" }, { "docid": "40baaebecc229ce7d34614cfc975d2e6", "score": "0.5389951", "text": "def index\n @votos = Voto.all\n\n render json: @votos\n end", "title": "" } ]
bb41053e1f4e5a43d553cb8acd6c5131
Send an error notification to New Relic
[ { "docid": "aa3cfc84ffa71fbc21e8151121f35598", "score": "0.0", "text": "def log(log)\n # Send error messages as Runtime exceptions\n exception =\n if log.exception\n log.exception\n else\n error = RuntimeError.new(log.message)\n error.set_backtrace(log.backtrace) if log.backtrace\n error\n end\n # For more documentation on the NewRelic::Agent.notice_error method see:\n # http://rubydoc.info/github/newrelic/rpm/NewRelic/Agent#notice_error-instance_method\n # and https://docs.newrelic.com/docs/ruby/ruby-agent-api\n ::NewRelic::Agent.notice_error(exception, formatter.call(log, self))\n true\n end", "title": "" } ]
[ { "docid": "6a7d1518bd1870dffb794ab2aca3371c", "score": "0.69033", "text": "def error\n NotificationMailer.error\n end", "title": "" }, { "docid": "abb1447df9d269f382bc18be84c3a373", "score": "0.6799402", "text": "def log_error(error)\n ::NewRelic::Agent.logger.error \"Error establishing connection with New Relic Service at #{control.server}:\", error\n end", "title": "" }, { "docid": "3fd63789960499807d98dcb5b1e5a18e", "score": "0.67910093", "text": "def notify_error(error)\n @error = error\n\n mail to: 'alessandro.asac@gmail.com', subject: 'Application Error Notification'\n end", "title": "" }, { "docid": "7dc9bc3c5bd790bb02f9125fbdeeeb18", "score": "0.67062515", "text": "def handle_resend_errored(error)\n Airbrake.notify error, registration: registration.reg_identifier\n Rails.logger.error \"Error resending renewal email for registration #{registration.reg_identifier}\"\n\n message = I18n.t(\"resend_renewal_email.messages.error.heading\", email: registration.contact_email)\n description = I18n.t(\"resend_renewal_email.messages.error.details\")\n\n flash_error(message, description)\n end", "title": "" }, { "docid": "49c87f605456a6263e5acaa0ff4c6005", "score": "0.66965324", "text": "def error(exception)\n @recipients = \"Blavel Administrator <blavel@blavel.com>\"\n @subject = \"Error notification!\"\n @from = \"Blavel! <blavel@blavel.com>\"\n @sent_on = Time.now\n @body[:exception] = exception\n end", "title": "" }, { "docid": "8d8f590b78c8b78b2d0dd7d9def77e44", "score": "0.66085184", "text": "def error_occured(error)\n @error = error\n\n mail to: \"navpreet.singh.k@gmail.com\", :subject => \"Error incident\"\n end", "title": "" }, { "docid": "7aab4c97cea246e85f404a16d38e6325", "score": "0.65938777", "text": "def exception_notification(error, params=nil)\n params.delete(:password) if params\n @params = params\n @error = error\n mail({\n :subject => \"DocumentCloud exception (#{Rails.env}:#{`hostname`.chomp}): #{error.class.name}\",\n :from => NO_REPLY,\n :to => EXCEPTIONS\n })\n end", "title": "" }, { "docid": "7e13260f53a5dd2c79ba0aa84303a91a", "score": "0.65384936", "text": "def error(error_message)\n @error = error_message\n mail to: \"to@example.com\", subject: 'Depot App Error Incident'\n end", "title": "" }, { "docid": "e83449ff39861952dd5683deb1642b91", "score": "0.6500481", "text": "def error_occured(error)\n @error = error\n\n mail to: 'maren.heltsche@gmail.com', subject: 'An Error has occured'\n end", "title": "" }, { "docid": "14094631db7a7475dfa06eed33387807", "score": "0.64794874", "text": "def occured(error)\n @error = error\n mail to: \"emmanuel_cousin@hotmail.fr\", subject: \"Error Incident Notification\"\n end", "title": "" }, { "docid": "7d6537b617adb86e2c58ad9cbbf458a2", "score": "0.64763165", "text": "def notify_error(exception)\n @exception = exception\n\n mail to: \"admin@rails6bookstore.com\", subject: \"Rails 6 Bookstore Error!!\"\n end", "title": "" }, { "docid": "b3eab4e60b7a1d3b6671957028460a4a", "score": "0.64759743", "text": "def application_failure(error)\n @error = error\n\n mail to: \"elan.dubrofsky@gmail.com\", subject: \"Application failure in Depot\"\n end", "title": "" }, { "docid": "4b66e4436e39f8907c0fde47cc627204", "score": "0.6427213", "text": "def notification_error(options = {})\n Rails.logger.error(\"!! NOTIFICATIONS FAILED.\")\n subject = \"Notifications not sent due to error\"\n user_id = EolConfig.find_by_parameter('notification_error_user_id').value\n to = user_id ? User.find(user_id) : User.first\n @user = options[:user] || 'unknown'\n @note_ids = options[:note_ids] || ['unknown']\n @error = options[:error] || 'unknown'\n @frequency = options[:fqz].to_s || 'unknown'\n @backtrace = options[:backtrace].to_s || 'unknown'\n set_locale(to)\n mail(\n to: to.email\n )\n end", "title": "" }, { "docid": "fb9489ab0dba035c9e9c7bdfb63aea5a", "score": "0.6354837", "text": "def error(exception)\n @exception = exception\n mail to: \"nettiks@live.com\", subject: \"Rescue error occurred: #{exception}\"\n end", "title": "" }, { "docid": "f618a09938bbdc59b41349658f855fc5", "score": "0.63452846", "text": "def bad_cart(error)\n @error = error\n\n mail to: \"robin.e.jayaswal.18@dartmouth.edu\", subject: \"Error Notification\"\n end", "title": "" }, { "docid": "28dd81d0d645fc39c6952e50a9612373", "score": "0.63028425", "text": "def error_occurred(error)\n @error = error\n mail to: \"seivadmas@gmail.com\", subject: \"Danger, Will Robinson\"\n end", "title": "" }, { "docid": "736885236b5fd086c1ec28151f664fce", "score": "0.6288204", "text": "def notify_devs(error)\n ApplicationMailer.notify(\n body: {error: error, input_params: @params},\n data: {},\n subject: \"Error in SignUp Job\"\n ).deliver\n end", "title": "" }, { "docid": "2f6adbea3da045a6defa5263b66ccf57", "score": "0.625251", "text": "def error_occured(error)\n @error = error\n\n mail to: \"andy@example.com\", :subject => 'Depot Mail Error Encountered'\n end", "title": "" }, { "docid": "d43616fd0a40de5e2804eb60fa05b5d3", "score": "0.6232541", "text": "def report_error(error)\n @error = error\n mail \n end", "title": "" }, { "docid": "ce09fde1d2ba85f7afd427cb8517c6a1", "score": "0.622934", "text": "def failed_update(event)\n error \"Update failed: #{event.payload[:update]}\"\n\n Mailer.exception(\n event.payload[:exception],\n event.payload[:update],\n event.payload[:database_queries]\n ).deliver_now\n end", "title": "" }, { "docid": "0013a8f4d89b12bfa6c6572c1bdf7c9b", "score": "0.6227507", "text": "def error_report(resource, error)\n logger.warn(\"Unable to report update error #{error}; nil resource\") unless resource.present?\n return unless resource.present?\n\n assign_variables(resource)\n @backtrace = to_backtrace(error)\n mail(to: @submission_error_emails, bcc: @bcc_emails,\n subject: \"#{rails_env} Submitting dataset \\\"#{@resource.title}\\\" (doi:#{@resource.identifier_value}) failed\")\n end", "title": "" }, { "docid": "bfff6142003c7193bb0f9c4b24509057", "score": "0.621515", "text": "def error\n ProductMailer.error\n end", "title": "" }, { "docid": "7c47b04adcecfeff95c5afac5630ac9d", "score": "0.6202396", "text": "def raise_server_error!; end", "title": "" }, { "docid": "a8cbbb27221b936e4dd388eb504817ae", "score": "0.61882156", "text": "def notify_error message, time=3\n _notify(message, time, 'error')\n end", "title": "" }, { "docid": "cbd397d6677b5309daa15c29efe0dbf3", "score": "0.6171425", "text": "def error_report(resource, error)\n logger.warn(\"Unable to report update error #{error}; nil resource\") unless resource.present?\n return unless resource.present?\n\n assign_variables(resource)\n @backtrace = error.full_message\n mail(to: @submission_error_emails, bcc: @bcc_emails,\n subject: \"#{rails_env}Submitting dataset \\\"#{@resource.title}\\\" (doi:#{@resource.identifier_value}) failed\")\n end", "title": "" }, { "docid": "d36eea44bceed716ce84206ce0229a6e", "score": "0.61488307", "text": "def failed(error)\n @error = error\n\n mail to: ENV[\"ADMIN_EMAIL\"]\n end", "title": "" }, { "docid": "9564bd374687ef2ae654b32c2b0ae39e", "score": "0.613924", "text": "def error(*args, &block)\n Event.deliver :error, self, *args, &block\n end", "title": "" }, { "docid": "d0cc2b73596d72be666bb7768fbda1dd", "score": "0.6135872", "text": "def error_event(err, env)\n {\n type: 'error.internal',\n to: 'tech@lynr.co',\n subject: \"[#{env['HTTP_HOST']}] #{err.class} on #{env['PATH_INFO']}\",\n err: { class: err.class, message: err.message, backtrace: err.backtrace },\n req: env.dup.delete_if { |k, v| k.start_with?('rack.') || k.start_with?('puma.') }\n }\n end", "title": "" }, { "docid": "5f48a55f05d6211e91dfd2e0b9d519ba", "score": "0.61102706", "text": "def send_error_email(error)\n @error = error\n mail( :to => 'cave.survey.project+error@gmail.com',\n :subject => 'Error reported' )\n end", "title": "" }, { "docid": "4cd825e36b5b5b6b3a5adcd6c2ae0f7f", "score": "0.6109827", "text": "def notify_error(reason)\n Rails.logger.info(\"Will notify error to ExperimentManager: #{reason}\")\n begin\n information_service = InformationService.instance\n address = information_service.sample_public_url('experiment_managers')\n raise 'There is no available experiment manager instance' if address.nil?\n schema = 'https' # TODO - temporary, change to config entry\n\n Rails.logger.debug \"Connecting to experiment manager on #{address}\"\n res = RestClient::Request.execute(\n method: :post,\n url: \"#{schema}://#{address}/experiments/#{self.experiment_id.to_s}/mark_as_complete.json\",\n payload: {status: 'error', reason: reason},\n user: self.experiment_manager_credentials['user'],\n password: self.experiment_manager_credentials['password'],\n verify_ssl: false\n )\n Rails.logger.debug \"Experiment manager response: #{res}\"\n raise 'Error while sending error message' if JSON.parse(res)['status'] != 'ok'\n rescue RestClient::Exception, StandardError => e\n Rails.logger.info \"Unable to connect with experiment manager, please contact administrator: #{e.to_s}\"\n end\n end", "title": "" }, { "docid": "23d30d556d1203116a2afcf05efd90a9", "score": "0.60885876", "text": "def error(message)\n @message = message\n\n mail subject: 'Pragmatic Store Error'\n end", "title": "" }, { "docid": "7a8d9f016e91631cd9715d15bdd6b0e9", "score": "0.6086603", "text": "def error!(error, atts={})\n Effective::OrdersMailer.order_error(\n order: qb_request.try(:order),\n error: error,\n to: EffectiveQbSync.error_email,\n subject: \"Quickbooks failed to synchronize order ##{qb_request.try(:order).try(:to_param) || 'unknown'}\",\n template: 'qb_sync_error'\n ).deliver_now\n\n update!(atts.reverse_merge(last_error: error))\n end", "title": "" }, { "docid": "6d2ad456f6e440a7e508d2889c8b48e3", "score": "0.60260123", "text": "def server_error(exception)\n # Whatever code that handles the exception\n\n ExceptionNotifier.notify_exception(exception,\n :env => request.env, :data => {:message => \"was doing something wrong\"})\n end", "title": "" }, { "docid": "123eff6777ea7c620e934f8cf0651cd0", "score": "0.6021268", "text": "def send_failure_email\n Notifier.order_support_request( self, \" Had an ERROR and needs attention\").deliver\n end", "title": "" }, { "docid": "1fece659e44043b8e3522185576ea748", "score": "0.6002631", "text": "def report_error\n @status = STATUS_ERROR\n end", "title": "" }, { "docid": "bfa739ea7482d2704cef6b6850cac1e7", "score": "0.59973955", "text": "def sendError(errText)\n # an error is written as an interaction thusly:\n # (commentBody is used for the error text)\n j = { 'kind' => 'error' , 'commentBody' => errText }\n return writeInteraction(j)\n end", "title": "" }, { "docid": "44a634075981f30551f1239b2ba72e8b", "score": "0.59874713", "text": "def error(cart)\n @cart = cart\n\n mail to: \"brunoraphael89@gmail.com\", subject: 'A error occurred'\n end", "title": "" }, { "docid": "da039ba8c21c3ba6a517dcfa95b057c0", "score": "0.59796184", "text": "def report_error(err)\n case err.message\n when /^#{REPOSITORY_CREATION_FAILED}/\n GitHubClassroom.statsd.increment(\"exercise_repo.create.repo.fail\")\n when /^#{REPOSITORY_COLLABORATOR_ADDITION_FAILED}/\n GitHubClassroom.statsd.increment(\"exercise_repo.create.adding_collaborator.fail\")\n when /^#{REPOSITORY_STARTER_CODE_IMPORT_FAILED}/\n GitHubClassroom.statsd.increment(\"exercise_repo.create.importing_starter_code.fail\")\n when /^#{TEMPLATE_REPOSITORY_CREATION_FAILED}/\n GitHubClassroom.statsd.increment(\"exercise_repo.create.repo.with_templates.failed\")\n else\n GitHubClassroom.statsd.increment(\"exercise_repo.create.fail\")\n end\n end", "title": "" }, { "docid": "419bf687832ad6fae160e41a914ce051", "score": "0.5974548", "text": "def send_error_email(exception)\n send_to_email = \"dev@pebblecode.com\"\n send_from_email = settings.send_from_email\n subject = \"[#{settings.environment}] Vistazo: an error occurred\"\n\n @url = APP_CONFIG[\"base_url\"]\n @backtrace = \"\"\n exception.backtrace.each { |e| @backtrace += \"#{e}\\n\" }\n @exception = \"#{exception.class}: #{exception.message}\"\n\n send_google_email(send_from_email, send_to_email, subject, erb(:error_email, :layout => false))\nend", "title": "" }, { "docid": "6918dfd7f40a6e0db8b7fa02d62895a8", "score": "0.5965287", "text": "def broadcast_error(error)\n ActionCable.server.broadcast(\n GroupRepositoryCreationStatusChannel.channel(group_id: group.id, group_assignment_id: group_assignment.id),\n error: error,\n status: invite_status.status\n )\n end", "title": "" }, { "docid": "8f25f58c0470d19321aadd411ececaf1", "score": "0.59553283", "text": "def error(message); end", "title": "" }, { "docid": "bc1bd5f2e157970064d95a83de3bc9e3", "score": "0.5954128", "text": "def email_error\n #not yet implemented\n end", "title": "" }, { "docid": "b3d0e7bb52de015f52e1e06c962b6ad8", "score": "0.59461254", "text": "def email_failed_message\n Notifier.deliver_survey_stalled_notification(self)\n end", "title": "" }, { "docid": "d704e38fe9ac9994f7ace9df158d23c3", "score": "0.59416467", "text": "def notify(exception, options = {})\n return if [\"development\", \"test\"].include? configuration.stage.downcase\n\n options[:exception] = exception\n notice = Notice.new(options)\n\n url = URI.parse(\"#{ configuration.url }/errors\")\n RestClient.post(url.to_s, notice.to_param)\n end", "title": "" }, { "docid": "0edd2ead52953bda22763c9322634908", "score": "0.5941549", "text": "def monitoring_failure(message, event)\n setup_message(\"call center monitoring failure: #{message}\", \"The following event triggered, but an error was encountered.\\n\\nTime: #{Time.now}\\n\\nError: #{message}\\n\\nEvent: #{event.to_s}\\n\\n#{event.inspect}\\n\\n\", :no_email_log)\n @recipients = [\"exceptions_critical@halomonitoring.com\"]\n end", "title": "" }, { "docid": "b40f8bc393ef5908d998da12810400bd", "score": "0.59330547", "text": "def report_error\n GitHubClassroom.statsd.increment(\"v2_group_exercise_repo.create.fail\")\n end", "title": "" }, { "docid": "086b73766acc99a16f1c2f70e1f01dd2", "score": "0.5931528", "text": "def notify_error(exception, options = {})\n if Rails.env == \"production\"\n begin\n AdminMailer.error(exception, session.to_hash, params, request.env, current_user).deliver\n rescue\n logger.error(\"ERROR SENDING ERROR NOTIFICATION: #{$!.to_s}: #{$!.message}\\n#{$!.backtrace.to_a.join(\"\\n\")}\")\n end\n end\n # still show error page unless requested not to\n raise exception unless options[:dont_re_raise]\n end", "title": "" }, { "docid": "7cb2b2357a6b0280dfdc5080265cfba1", "score": "0.5922664", "text": "def on_error(error); end", "title": "" }, { "docid": "7cb2b2357a6b0280dfdc5080265cfba1", "score": "0.5922664", "text": "def on_error(error); end", "title": "" }, { "docid": "1d8e045b31c8300087415c43637d3722", "score": "0.59119815", "text": "def notify_error(exception, options = {})\n if Rails.env == \"production\"\n begin\n AdminMailer.error(exception, session.to_hash, params, request.env, current_user).deliver\n rescue\n logger.error(\"ERROR SENDING ERROR NOTIFICATION: #{$!.to_s}: #{$!.message}\\n#{$!.backtrace.to_a.join(\"\\n\")}\")\n end\n end\n # still show error page unless requested not to\n raise exception unless options[:dont_re_raise]\n end", "title": "" }, { "docid": "9a1a2a36b2017df350ab963282e34d1b", "score": "0.5908526", "text": "def error(str)\n notify(\"error\", str)\n end", "title": "" }, { "docid": "7fc1e28600f06670710fd0e1093d85b8", "score": "0.59040385", "text": "def mail_error(e)\n x = MailGem::Mail.new\n x.from = \"<email-address>\"\n x.to = \"<email-address>\"\n x.subject = \"Server Loading Error\"\n x.body = e.message\n x.send\nend", "title": "" }, { "docid": "52dd75971c96eb7a18f4e953bdce7bb2", "score": "0.589209", "text": "def generateError(ns_id, status, message)\n message = {\n :nsd_id => ns_id,\n :status => status,\n :cause => message\n }\n return message\n end", "title": "" }, { "docid": "06990f82728a2419714fd9be864348ab", "score": "0.58867586", "text": "def client_side_error\n #throw 'Client side error! Params: ', params.as_json\n ErrorMailer.warning_message('Client side error', params.as_json).deliver\n end", "title": "" }, { "docid": "ff8d49ef6c2a8ba5cd4e93dc54d3e9ce", "score": "0.5885655", "text": "def exception(user_project, error)\n @error = error\n @project = user_project.project\n mail to: user_project.user.email, subject: \"BatBugger (#{@project.name} : #{error.title})\"\n end", "title": "" }, { "docid": "68be477472d7e73d9634def4fda1910c", "score": "0.5882107", "text": "def error_notifier\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "title": "" }, { "docid": "f6c110d3f129489b13e257a9a5e7bcee", "score": "0.5877177", "text": "def send_error_report\n ReportMailer.send_error_report(self).deliver_later\n end", "title": "" }, { "docid": "f6c110d3f129489b13e257a9a5e7bcee", "score": "0.587717", "text": "def send_error_report\n ReportMailer.send_error_report(self).deliver_later\n end", "title": "" }, { "docid": "540f43b0b6224f560b5db443cd7f6500", "score": "0.5873876", "text": "def server_error(exception)\n AdminNotifier.exception_report(\n exception,\n exception.backtrace,\n session.instance_variable_get(\"@data\"),\n params,\n request.env).deliver\n end", "title": "" }, { "docid": "d6002497c2ec786f737fa98f23294282", "score": "0.58668876", "text": "def log_error(notification_type)\n uuid = SecureRandom.uuid\n error_msg = \"An #{notification_type} notification with id #{required_params[:id]} could not be found. \" \\\n \"Error ID: #{uuid}\"\n Rails.logger.error(error_msg)\n render json: { message: error_msg }, status: :internal_server_error\n end", "title": "" }, { "docid": "2df544af118bd56b4e99acb6a117c904", "score": "0.5861487", "text": "def raise_delivery_errors; end", "title": "" }, { "docid": "ccf21ecb2779a42a247040905c29c414", "score": "0.5853941", "text": "def error(error_recipients, job, execution_message, error_message)\n @application = Ubiquo::Settings.get(:app_name)\n @job = job\n @error_message = error_message\n @execution_message = execution_message\n\n subject = \"[#{app_name} #{Rails.env} CRON JOB ERROR] for job: #{job}\"\n mail(:to => error_recipients,\n :subject => subject)\n end", "title": "" }, { "docid": "a2da32169f2c24c928be81ee87f712ec", "score": "0.5839959", "text": "def broadcast_error(error, invite_status, group_assignment, group)\n ActionCable.server.broadcast(\n GroupRepositoryCreationStatusChannel.channel(group_id: group.id, group_assignment_id: group_assignment.id),\n error: error,\n status: invite_status.status\n )\n end", "title": "" }, { "docid": "7836cdd3289117fd48ffb51437746bfb", "score": "0.5831891", "text": "def sent_notifications\n # sent email to admin if error\n end", "title": "" }, { "docid": "7fb8fd5c995d5343c849510e90688308", "score": "0.58291936", "text": "def error!; end", "title": "" }, { "docid": "7fb8fd5c995d5343c849510e90688308", "score": "0.58291936", "text": "def error!; end", "title": "" }, { "docid": "1da2db3b12a09b207c10a74108a569dc", "score": "0.58236706", "text": "def send_error_order\n order = Order.where(status: \"error\").first\n OrderMailer.send_order(\n order: order,\n status: \"error\",\n email: order.user.email, # send to brand/landing (currently just sending to Landing)\n subject: \"Landing International: Order Error/Dispute\"\n )\n end", "title": "" }, { "docid": "1fb14acedbf737a45ae3359c1a1f8932", "score": "0.58205163", "text": "def notify_devs(error_data, subject='Error while WhitelistManagement::ProcessAndRecordEvent')\n ApplicationMailer.notify(\n body: {},\n data: {error_data: error_data},\n subject: subject\n ).deliver\n end", "title": "" }, { "docid": "05db3170829e0e06b9e5e2c5b3cf7263", "score": "0.5816281", "text": "def send_error message\n send_data \"ERROR: \" + message\n end", "title": "" }, { "docid": "6b97a1304bdc80b4aa53ed5006a7ee48", "score": "0.58132285", "text": "def notify_runtime_error(result, options)\n message = \"An error occurred: #{ result['error'] }\"\n Formatter.error(message)\n Formatter.notify(message, :title => 'Jasmine error', :image => :failed, :priority => 2) if options[:notification]\n end", "title": "" }, { "docid": "eda97fef6f94673148930c0e0e059845", "score": "0.580676", "text": "def generateError(ns_id, status, message)\n message = {\n nsd_id: ns_id,\n status: status,\n cause: message\n }\n message\n end", "title": "" }, { "docid": "eda97fef6f94673148930c0e0e059845", "score": "0.580676", "text": "def generateError(ns_id, status, message)\n message = {\n nsd_id: ns_id,\n status: status,\n cause: message\n }\n message\n end", "title": "" }, { "docid": "f487c8c608a0085b5076b2304c73fc90", "score": "0.5805579", "text": "def email_error (msg, dns_response)\n puts msg\n puts dns_response\n puts \"=================\"\nend", "title": "" }, { "docid": "4e07895593426b36d8640a2c2bf9ed32", "score": "0.5805011", "text": "def send_failure_mail(_e)\n # body = e.json_body\n # err = body[:error]\n # DeveloperMailer.failure_notice(err[:type], err[:message]).deliver_later\n end", "title": "" }, { "docid": "f3ffd61a2b131d76c73eb4d9b0cb47a9", "score": "0.57984364", "text": "def registration_error\n end", "title": "" }, { "docid": "80f62532efd85a23329f14132b123e80", "score": "0.5793388", "text": "def send_error(error_message)\n file_set.errors.add('Error:', error_message)\n Hyrax.config.callback.run(:after_import_url_failure, file_set, user, warn: false)\n operation.fail!(file_set.errors.full_messages.join(' '))\n end", "title": "" }, { "docid": "40a8144526db2ab7c9d99dbed7f74cd2", "score": "0.5790069", "text": "def error(what)\r\n\t\t\tmessage 'ERROR: ' + what.to_s, :error\r\n\t\tend", "title": "" }, { "docid": "1c06a74ebf8394880f097982e24a7fc2", "score": "0.5769415", "text": "def error\n end", "title": "" }, { "docid": "9b44ed7d06c1b54dcf5898bae6597246", "score": "0.57685935", "text": "def send_error(e, res)\n res.status = 500\n res['Content-Type'] = 'application/json'\n body = { code: -1, error: \"#{e.class}: #{e.message}\" }\n body[:backtrace] = e.backtrace\n res.body = @shell.data(body).json(@shell.indent)\n @shell.logger.warn(Impl.format_error(e))\n\tend", "title": "" }, { "docid": "c48d9a687c0597943b3a902492779ee1", "score": "0.57670903", "text": "def error\n end", "title": "" }, { "docid": "c48d9a687c0597943b3a902492779ee1", "score": "0.57670903", "text": "def error\n end", "title": "" }, { "docid": "c48d9a687c0597943b3a902492779ee1", "score": "0.57670903", "text": "def error\n end", "title": "" }, { "docid": "69dc02e0439f5e37c7be2800ce7696a6", "score": "0.57632136", "text": "def receive_issue\n super\n rescue ActiveRecord::RecordInvalid, MailHandler::MissingInformation, MailHandler::UnauthorizedAction,\n RedmineHtmlMailHandler::Error, ActionView::Template::Error => e\n notify(user: user, email: email, receiver: :invalid_new_issue, exc: e)\n end", "title": "" }, { "docid": "d4d78812d16654aea2542e7b538d1e39", "score": "0.5748471", "text": "def errata_error\n end", "title": "" }, { "docid": "ff6cfc959ec7d1c8530874787502f005", "score": "0.57423884", "text": "def error(event) end", "title": "" }, { "docid": "e4707d1cf023ff66dbb30f28c6a1a2ec", "score": "0.5739245", "text": "def error(exception, session = nil, params = nil, env = nil, user = nil)\n @exception = exception\n @session = session\n @params = params\n @env = env\n @user = user\n path = (env && env['REQUEST_URI']) ? (\": \" + env['REQUEST_URI']) : \"\"\n exception_name = @exception ? \": #{@exception.class} #{@exception.message}\" : \"\"\n mail(:to => configatron.webmaster_emails, :subject => \"Error#{path}#{exception_name}\")\n end", "title": "" }, { "docid": "7fe682f1763cf297ddd01483e67a3427", "score": "0.5738942", "text": "def notify_error(photo, error, params)\n \t@photo = photo\n @error = error\n @params = params\n to = [\"lienptb@elarion.com\", \"adrian@appiphany.com.au\"]\n\n mail :to => email_to(to), :subject => \"[Pocket Prints] Error when uploading Photo\"\n end", "title": "" }, { "docid": "eadc822148d3c545aef4f9e5fc4b3e42", "score": "0.5737332", "text": "def notify_failure!(exception)\n mail[:subject] = \"[Backup::Failed] #{model.label} (#{model.trigger})\"\n mail[:body] = read_template('notify_failure', Binder.bind(:model => @model, :exception => exception))\n mail.deliver!\n end", "title": "" }, { "docid": "89fd7859ed037d333f3d1b39cc5c119b", "score": "0.57352036", "text": "def error; end", "title": "" }, { "docid": "89fd7859ed037d333f3d1b39cc5c119b", "score": "0.57352036", "text": "def error; end", "title": "" }, { "docid": "89fd7859ed037d333f3d1b39cc5c119b", "score": "0.57352036", "text": "def error; end", "title": "" }, { "docid": "89fd7859ed037d333f3d1b39cc5c119b", "score": "0.57352036", "text": "def error; end", "title": "" }, { "docid": "89fd7859ed037d333f3d1b39cc5c119b", "score": "0.57352036", "text": "def error; end", "title": "" }, { "docid": "89fd7859ed037d333f3d1b39cc5c119b", "score": "0.57352036", "text": "def error; end", "title": "" }, { "docid": "89fd7859ed037d333f3d1b39cc5c119b", "score": "0.57352036", "text": "def error; end", "title": "" }, { "docid": "89fd7859ed037d333f3d1b39cc5c119b", "score": "0.57352036", "text": "def error; end", "title": "" }, { "docid": "89fd7859ed037d333f3d1b39cc5c119b", "score": "0.57352036", "text": "def error; end", "title": "" }, { "docid": "89fd7859ed037d333f3d1b39cc5c119b", "score": "0.57352036", "text": "def error; end", "title": "" }, { "docid": "89fd7859ed037d333f3d1b39cc5c119b", "score": "0.57352036", "text": "def error; end", "title": "" }, { "docid": "793c2f8d06b67d2a72aeea16a396dc0a", "score": "0.5729221", "text": "def push_error_message(msg)\n push_message(:error, msg)\n end", "title": "" }, { "docid": "dd9392d508c21ca3eb5d913a43aedb14", "score": "0.57261825", "text": "def error\n raise \"something went wrong\"\n end", "title": "" } ]
84e7c108cfb1d26d8783fb7264366cfd
GET /albums/new GET /albums/new.xml
[ { "docid": "5cbefb835fc9161782529ea0890c22e1", "score": "0.7020873", "text": "def new\n @album = Album.new\n @album.album_photos.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @album }\n end\n end", "title": "" } ]
[ { "docid": "ff91011b4f9d665c77ddb75c8acc00a4", "score": "0.7923828", "text": "def new\n @album = current_account.albums.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @album }\n end\n end", "title": "" }, { "docid": "4163cbd1ddbf2a53d1c65fa1d212e264", "score": "0.76302975", "text": "def new\n @album = Album.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @album }\n end\n end", "title": "" }, { "docid": "4163cbd1ddbf2a53d1c65fa1d212e264", "score": "0.76302975", "text": "def new\n @album = Album.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @album }\n end\n end", "title": "" }, { "docid": "4163cbd1ddbf2a53d1c65fa1d212e264", "score": "0.76302975", "text": "def new\n @album = Album.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @album }\n end\n end", "title": "" }, { "docid": "4163cbd1ddbf2a53d1c65fa1d212e264", "score": "0.76302975", "text": "def new\n @album = Album.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @album }\n end\n end", "title": "" }, { "docid": "ac7d7b8e7d011f0cdf99581dd2d10768", "score": "0.7580006", "text": "def new \n @album = Album.new(params[:album])\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @album }\n end\n end", "title": "" }, { "docid": "d8ea92674709f0dd2fb4356f9af8565d", "score": "0.7330169", "text": "def new\n @photo_album = PhotoAlbum.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @photo_album }\n end\n end", "title": "" }, { "docid": "0e617b35b0a6b6810d981f01a9120a69", "score": "0.72903734", "text": "def new\n @photo_album = PhotoAlbum.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @photo_album }\n end\n end", "title": "" }, { "docid": "e95275e29546b2185a7326c2d3c430ba", "score": "0.7115756", "text": "def new\n @album = Album.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @album }\n end\n end", "title": "" }, { "docid": "e95275e29546b2185a7326c2d3c430ba", "score": "0.7115756", "text": "def new\n @album = Album.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @album }\n end\n end", "title": "" }, { "docid": "5d78e0d86922e24905eabf6446468104", "score": "0.70460564", "text": "def new\r\n\r\n @album = Album.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @album }\r\n end\r\n end", "title": "" }, { "docid": "7edc01f80ee31e54a95328a19d9998ff", "score": "0.70364374", "text": "def new\n @album = Album.new\n\n respond_to do |format|\n format.html # new.html.erb\n #format.json { render json: @album }\n end\n end", "title": "" }, { "docid": "0ffce837e4fc29fde262988e6fd222bd", "score": "0.70025456", "text": "def new\n @artists = Artist.find(:all)\n @features = Feature.find(:all)\n @album = Album.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @album }\n end\n end", "title": "" }, { "docid": "40ba816c438aa98fe4f513957edd2ddc", "score": "0.6994215", "text": "def new\n @album = current_user.albums.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @album }\n end\n end", "title": "" }, { "docid": "55ea79a46410e4962f5976a43272029b", "score": "0.6857815", "text": "def new\n @album = Album.new\n @images = Image.all(:conditions => {:album_id => nil})\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @album }\n end\n end", "title": "" }, { "docid": "f2f799f6e49b863c161c01b6f96f1dfe", "score": "0.6857161", "text": "def new\n @album = Album.new\n 1.upto(3) { @album.photos.build }\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @album }\n end\n end", "title": "" }, { "docid": "192cea6835f937da0a5f173aaf07ac10", "score": "0.6806801", "text": "def new\n @album = Album.new\n @genres = Genre.find(:all, :order => \"name\")\n @artists = Artist.find(:all, :order => \"name\")\n @movies = Movie.find(:all, :order => \"name\")\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @album }\n end\n end", "title": "" }, { "docid": "949faa4381d5be8b529e2fbaf66457f6", "score": "0.67807084", "text": "def new\n @group = Group.find(params[:group_id])\n @album = @group.albums.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @album }\n end\n end", "title": "" }, { "docid": "2674717878169c66e92ac4871290534b", "score": "0.672535", "text": "def new\n @albumm = Albumm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @albumm }\n end\n end", "title": "" }, { "docid": "28a2a76078e8fa4d3d77adc64ca5ee27", "score": "0.6676688", "text": "def new\n @album = Album.new\n render :new\n end", "title": "" }, { "docid": "b433771da603d1713c1384811cb39bcc", "score": "0.6665616", "text": "def create\n @album = Album.new(params[:album])\n\n respond_to do |format|\n if @album.save\n flash[:notice] = 'Album was successfully created.'\n format.html { redirect_to(@album) }\n format.xml { render :xml => @album, :status => :created, :location => @album }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @album.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c4c2d95c9b7ab4a491e675ee3a7381fa", "score": "0.6662438", "text": "def create\n \n @album = Album.new(params[:album])\n \n respond_to do |format|\n if @album.save\n flash[:notice] = 'Album was successfully created.'\n format.html { redirect_to(@album) }\n format.xml { render :xml => @album, :status => :created, :location => @album }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @album.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "305e2410bcbc8832dd90009739e9f123", "score": "0.6660512", "text": "def new\n @album = Album.new\n @title = \"new\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @album }\n format.js {}\n end\n end", "title": "" }, { "docid": "b6a2eb85a5f21cc34400cbc2b5058bd3", "score": "0.66511977", "text": "def create\n @album = Album.new(params[:album])\n \n respond_to do |format|\n if @album.save\n flash[:notice] = 'Album was successfully created.'\n format.html { redirect_to(@album) }\n format.xml { render :xml => @album, :status => :created, :location => @album }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @album.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "42d95b62c13380bc600a9b824f80ced3", "score": "0.6617132", "text": "def create\n @album = current_account.albums.new(params[:album])\n\n respond_to do |format|\n if @album.save\n flash[:notice] = 'album was successfully created.'\n format.html { redirect_to( :action => 'edit', :id => @album.id) }\n format.xml { render :xml => @album, :status => :created, :location => @album }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @album.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bb10b798f23cdb32ef31e2d8f658b000", "score": "0.66020876", "text": "def new\r\n @album = Album.new\r\n end", "title": "" }, { "docid": "acea7e3dd0ced2cc14e04e4a6d99282f", "score": "0.6592017", "text": "def new\n @user_album = UserAlbum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user_album }\n end\n end", "title": "" }, { "docid": "811e6f92e28266204a99ebbc68065144", "score": "0.65823734", "text": "def new\n @album = Album.find(params[:album_id])\n @photo = Photo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @photo }\n end\n end", "title": "" }, { "docid": "e0e63aa34ac87db16e68e88f32c4c745", "score": "0.6579775", "text": "def new\n @album = Album.find(params[:album_id])\n @photo = Photo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @photo }\n end\n end", "title": "" }, { "docid": "2c6dd71fe1badb4e6aaa9c2ccd76f39a", "score": "0.6566408", "text": "def new\n @song = Song.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @song }\n end\n end", "title": "" }, { "docid": "2c6dd71fe1badb4e6aaa9c2ccd76f39a", "score": "0.6566408", "text": "def new\n @song = Song.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @song }\n end\n end", "title": "" }, { "docid": "2c6dd71fe1badb4e6aaa9c2ccd76f39a", "score": "0.6566408", "text": "def new\n @song = Song.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @song }\n end\n end", "title": "" }, { "docid": "2c6dd71fe1badb4e6aaa9c2ccd76f39a", "score": "0.6566408", "text": "def new\n @song = Song.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @song }\n end\n end", "title": "" }, { "docid": "2c6dd71fe1badb4e6aaa9c2ccd76f39a", "score": "0.6566408", "text": "def new\n @song = Song.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @song }\n end\n end", "title": "" }, { "docid": "2c6dd71fe1badb4e6aaa9c2ccd76f39a", "score": "0.6566408", "text": "def new\n @song = Song.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @song }\n end\n end", "title": "" }, { "docid": "37240e5debe0087e172be7242a72bb83", "score": "0.6562252", "text": "def new\n @album = Album.find_by_slug(params[:album_id])\n @album_item = AlbumItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @album_item }\n end\n end", "title": "" }, { "docid": "fa7de8818596a06752b02a3b4b562e6c", "score": "0.6554306", "text": "def new\n @album = Album.new\n end", "title": "" }, { "docid": "fa7de8818596a06752b02a3b4b562e6c", "score": "0.6554306", "text": "def new\n @album = Album.new\n end", "title": "" }, { "docid": "e53d4a7a89fe91b8ad596361ccb2f09b", "score": "0.6532513", "text": "def new\n @gallery = Gallery.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @gallery }\n end\n end", "title": "" }, { "docid": "e53d4a7a89fe91b8ad596361ccb2f09b", "score": "0.6532513", "text": "def new\n @gallery = Gallery.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @gallery }\n end\n end", "title": "" }, { "docid": "fd83e9c14db589412835ce8a5f9c39f1", "score": "0.65051305", "text": "def new\n @artist = Artist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @artist }\n end\n end", "title": "" }, { "docid": "c24401b9e3db61ac4f3602e75bb3c76c", "score": "0.6493626", "text": "def new\n @album_owned = AlbumOwned.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @album_owned }\n end\n end", "title": "" }, { "docid": "c317ae000ad433a772237c6ec4f51017", "score": "0.64715624", "text": "def new\n @photo = @allbum.photos.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @photo }\n end\n end", "title": "" }, { "docid": "95f462f858faae0f0fd25594d594cb36", "score": "0.6446758", "text": "def new\n @album = Album.new\n @photo = @album.photos.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @photo }\n end\n end", "title": "" }, { "docid": "711932448b041d9e9db14e3d48858cc7", "score": "0.644359", "text": "def new\n @album2photo = Album2photo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @album2photo }\n end\n end", "title": "" }, { "docid": "f53a29f97b59ee723f9ac42b7472feae", "score": "0.6437654", "text": "def new\n @photo = Photo.new\n @photo.album_id = params[:album_id]\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @photo }\n end\n end", "title": "" }, { "docid": "7b4f2a03b869ec789a583cac60a99650", "score": "0.6406039", "text": "def create\n @album = Album.new(params[:album])\n respond_to do |format|\n if @user.albums << @album\n flash[:notice] = 'Album was successfully created.'\n format.html { redirect_to user_albums_path(@user) }\n format.xml { render :xml => @album, :status => :created, :location => @album }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @album.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5158ea74e9cf59d1496181efa176d314", "score": "0.6386497", "text": "def new\n @photo_set = PhotoSet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @photo_set }\n end\n end", "title": "" }, { "docid": "21a45db0041828210bf9275fe6809683", "score": "0.63753945", "text": "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", "title": "" }, { "docid": "b1434552d49aa9fc1907ae5651050fe6", "score": "0.63541067", "text": "def new\n @tags_songs = TagsSongs.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tags_songs }\n end\n end", "title": "" }, { "docid": "95ee0cf504b39563c3bc74203568b0aa", "score": "0.63539875", "text": "def new\n @photo = Photo.new\n\t@albums = Album.find_all_by_twit_id(params[:view_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @photo }\n end\n end", "title": "" }, { "docid": "6a8a0118bc145beb05285e5ec1f12e59", "score": "0.63509154", "text": "def new\n \n @album = @user.albums.new\n respond_to do |format|\n format.js { render 'new' }\n format.html # show.html.erb\n end\n end", "title": "" }, { "docid": "f5521804b68731396b97381c9921789c", "score": "0.6339923", "text": "def new\n @foto_album = FotoAlbum.create\n @foto = Foto.new\n\n params[:albom_id] = @foto_album.id\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @foto_album }\n end\n end", "title": "" }, { "docid": "81193affed4d2c67e54c3fcc5b9dea1f", "score": "0.63278794", "text": "def new\n @photo = Photo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @photo }\n end\n end", "title": "" }, { "docid": "7fd6924d25da2645795ddfbf32cc6831", "score": "0.630795", "text": "def new\n @gallery_asset = GalleryAsset.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @gallery_asset }\n end\n end", "title": "" }, { "docid": "8f29fd16e9795bcf7d3802708b42370e", "score": "0.63026637", "text": "def new\n @photo = Photo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @photo }\n end\n end", "title": "" }, { "docid": "8f29fd16e9795bcf7d3802708b42370e", "score": "0.63026637", "text": "def new\n @photo = Photo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @photo }\n end\n end", "title": "" }, { "docid": "8f29fd16e9795bcf7d3802708b42370e", "score": "0.63026637", "text": "def new\n @photo = Photo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @photo }\n end\n end", "title": "" }, { "docid": "8f29fd16e9795bcf7d3802708b42370e", "score": "0.63026637", "text": "def new\n @photo = Photo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @photo }\n end\n end", "title": "" }, { "docid": "f8c5957edd26954ad1ee66a916352459", "score": "0.6289886", "text": "def new\n @gallery = Gallery.new\n @gallery.photos.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @gallery }\n end\n end", "title": "" }, { "docid": "a734ff744a594bab251145f0add2e754", "score": "0.628581", "text": "def create_albums\n url = 'https://stg-resque.hakuapp.com/albums.json'\n uri = URI(url)\n response = Net::HTTP.get(uri)\n albums = JSON.parse(response)\n\n albums.each do |album|\n Album.create!(album.except('id'))\n end\nend", "title": "" }, { "docid": "254626d33ff87e00b3cfe915e1231164", "score": "0.62781173", "text": "def index\n @albums = Album.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @albums }\n end\n end", "title": "" }, { "docid": "a1d740760001c8eecb1da7b67dde3d68", "score": "0.6268794", "text": "def new\r\n @photo = Photo.new\r\n \r\n if params[:id] != nil\r\n @album = Album.find(params[:id])\r\n if @album != nil\r\n @photo.ALBUM_ID = @album.ID\r\n end\r\n end\r\n\r\n @albums = Album.all\r\n @albums_map = {}\r\n @albums.each do |album| \r\n @albums_map[album.TITLE] = album.ID\r\n end\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @photo }\r\n end\r\n end", "title": "" }, { "docid": "68ffd4fc3a8f70c7c86464d3f5ce6bb3", "score": "0.62660193", "text": "def new\n @album = Album.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json do\n render json: { rows: (@album.nil? ? [] : [@album.marshall]),\n status: (@album.nil? ? 404 : 200),\n total: (@album.nil? ? 0 : 1) }\n end\n end\n end", "title": "" }, { "docid": "bf5dd2255a8c4f306bf9f55d55847741", "score": "0.6262136", "text": "def index\n @albums = Album.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @albums }\n end\n end", "title": "" }, { "docid": "bf5dd2255a8c4f306bf9f55d55847741", "score": "0.6262136", "text": "def index\n @albums = Album.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @albums }\n end\n end", "title": "" }, { "docid": "b5d6db24a2a8b4d9a745d65bc7041182", "score": "0.62579083", "text": "def new\n @photo = Photo.new\n @albums = Album.where('user_id=?',session[:user_id]).latest\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @photo }\n end\n end", "title": "" }, { "docid": "e2680143b2d9236bce9766f80800e817", "score": "0.62476367", "text": "def new\n @folder = Folder.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @folder }\n end\n end", "title": "" }, { "docid": "e2680143b2d9236bce9766f80800e817", "score": "0.62476367", "text": "def new\n @folder = Folder.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @folder }\n end\n end", "title": "" }, { "docid": "0c9f026732585f301bb939ab77576231", "score": "0.6237636", "text": "def new\n @namespace = Namespace.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @namespace }\n end\n end", "title": "" }, { "docid": "60d877de1ea802f7aa3d2bf8caaa5b73", "score": "0.6236156", "text": "def new\n @library = Library.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @library }\n end\n end", "title": "" }, { "docid": "ee3fc71f2173c0a500673d09e42f107f", "score": "0.62311506", "text": "def new\n @book = Book.new :copies => 1\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @book }\n end\n end", "title": "" }, { "docid": "0ae157f187fb787a7ef6cfc2d416c4d9", "score": "0.62285966", "text": "def new\n @album_genre = AlbumGenre.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @album_genre }\n end\n end", "title": "" }, { "docid": "0b25ac977a69905ed86d8a092a11150e", "score": "0.6223334", "text": "def index\n @albums = @user.albums\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @albums }\n end\n end", "title": "" }, { "docid": "811f2399b197d5d0291c4c244a06b31f", "score": "0.620974", "text": "def new\n @album = Album.new\n\n 3.times do\n @album.tracks.build\n end\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @album }\n end\n end", "title": "" }, { "docid": "d804792b7a29302e702bc47ef1bbe72e", "score": "0.6209257", "text": "def new\n @cat = Cat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @cat }\n end\n end", "title": "" }, { "docid": "254e7c4d22d56c9babb7cb47b3459275", "score": "0.6207855", "text": "def new\n @atom = Atom.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @atom }\n end\n end", "title": "" }, { "docid": "e62fd5db2745181646387f2612bf83a9", "score": "0.6194813", "text": "def create\n @album = Album.new(params[:album])\n\n respond_to do |format|\n if @album.save\n format.html { redirect_to @album, notice: 'Album was successfully created.' }\n format.json { render json: @album, status: :created, location: @album }\n else\n format.html { render action: \"new\" }\n format.json { render json: @album.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e62fd5db2745181646387f2612bf83a9", "score": "0.6194813", "text": "def create\n @album = Album.new(params[:album])\n\n respond_to do |format|\n if @album.save\n format.html { redirect_to @album, notice: 'Album was successfully created.' }\n format.json { render json: @album, status: :created, location: @album }\n else\n format.html { render action: \"new\" }\n format.json { render json: @album.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e62fd5db2745181646387f2612bf83a9", "score": "0.6194813", "text": "def create\n @album = Album.new(params[:album])\n\n respond_to do |format|\n if @album.save\n format.html { redirect_to @album, notice: 'Album was successfully created.' }\n format.json { render json: @album, status: :created, location: @album }\n else\n format.html { render action: \"new\" }\n format.json { render json: @album.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "47b626d625a5d979758830f8087da2be", "score": "0.6186237", "text": "def new\n @musica = Musica.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @musica }\n end\n end", "title": "" }, { "docid": "12c467c42e43579ad354fa86f91239a4", "score": "0.6185487", "text": "def new\n @assettrack = Assettrack.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @assettrack }\n end\n end", "title": "" }, { "docid": "57bdc7008735e6338733738ea034c20b", "score": "0.6181292", "text": "def new\n @gallery_item = GalleryItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @gallery_item }\n end\n end", "title": "" }, { "docid": "a83173640f77272bfb6f58a0a65c7e67", "score": "0.61783683", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => new_vurl }\n end\n end", "title": "" }, { "docid": "3adad734876dadb7818a0b6bf445a936", "score": "0.6177661", "text": "def new\n @fine_artist = FineArtist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @fine_artist }\n end\n end", "title": "" }, { "docid": "d9ec896083d18af703d4518a3b79c931", "score": "0.61713564", "text": "def new\n @title = \"New Company\"\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @company }\n end\n end", "title": "" }, { "docid": "0e31944992c4ce9a30159e1b02b29ddc", "score": "0.61683744", "text": "def new\n @catalog = Catalog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @catalog }\n end\n end", "title": "" }, { "docid": "0e31944992c4ce9a30159e1b02b29ddc", "score": "0.61683744", "text": "def new\n @catalog = Catalog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @catalog }\n end\n end", "title": "" }, { "docid": "1054888e97c7d5bdd0a3da2887258d18", "score": "0.6168334", "text": "def new\n @music_albums = current_user.music_albums\n music_album_id = params[:music_album_id]\n \n @music = Music.new\n @music.music_album_id = music_album_id\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @music }\n end\n end", "title": "" }, { "docid": "61ef8a3b2216442126d4818dd2d446c6", "score": "0.6150652", "text": "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", "title": "" }, { "docid": "319a865882d8654c00fba7a65bdc7c71", "score": "0.6146331", "text": "def new\n @collection = Collection.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @collection }\n end\n end", "title": "" }, { "docid": "46ccab90c5322fa72e0480c9a7f18b44", "score": "0.6146073", "text": "def new\n @podcast = Podcast.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @podcast }\n end\n end", "title": "" }, { "docid": "46ccab90c5322fa72e0480c9a7f18b44", "score": "0.61459", "text": "def new\n @podcast = Podcast.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @podcast }\n end\n end", "title": "" }, { "docid": "8b4e44185b3f39b550fa325139fa6e7d", "score": "0.61411464", "text": "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", "title": "" }, { "docid": "5111a95a277450d7aca3da9081b770b2", "score": "0.6138902", "text": "def create\n @photo_album = PhotoAlbum.new(params[:photo_album])\n\n respond_to do |format|\n if @photo_album.save\n flash[:notice] = 'PhotoAlbum was successfully created.'\n format.html { redirect_to(@photo_album) }\n format.xml { render :xml => @photo_album, :status => :created, :location => @photo_album }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @photo_album.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "df14be495c7e6aabd53c1e7857074745", "score": "0.6135468", "text": "def show\n @album = Album.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @album }\n end\n end", "title": "" }, { "docid": "df14be495c7e6aabd53c1e7857074745", "score": "0.6135468", "text": "def show\n @album = Album.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @album }\n end\n end", "title": "" }, { "docid": "df14be495c7e6aabd53c1e7857074745", "score": "0.6135468", "text": "def show\n @album = Album.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @album }\n end\n end", "title": "" }, { "docid": "bd6df89f1ac8aa964675e38fdea9d5ba", "score": "0.61318666", "text": "def new\n @repo = Repo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @repo }\n end\n end", "title": "" }, { "docid": "41650db805ea0751d4314f77d3199296", "score": "0.6126851", "text": "def new\n @recurso = Recurso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @recurso }\n end\n end", "title": "" } ]
2f8f66f5df2f41f072b0f2688f86f966
If labeled attribute has xpath with it
[ { "docid": "92db14806ab2ab6d610ff8c8d20d48a1", "score": "0.66821724", "text": "def xpath\n attr_value('xpath')\n end", "title": "" } ]
[ { "docid": "757fe82dfbe7c3d29e1ecd5c67e567c2", "score": "0.6587439", "text": "def is_xpath(value)\n value.start_with?(\"fhir:\") && value.include?(\"@\")\n end", "title": "" }, { "docid": "d28fc322426424ce1997b9a60873635c", "score": "0.64256877", "text": "def label\n ids = filtered_attributes(:id, :name).values\n if ids.any?\n query = Capybarista::Queries::XPath.labels_for(*ids)\n return session.first(:xpath, query)\n else\n return nil\n end\n end", "title": "" }, { "docid": "c0d901b2744ecf48b7fff01747acc053", "score": "0.62586474", "text": "def label_by_text_exists(label_text)\n return @browser.label(:text, label_text).exist?\nend", "title": "" }, { "docid": "42a6c053f32ba408d27236eccccea0fb", "score": "0.6181521", "text": "def label!\n ids = filtered_attributes(:id, :name).values\n\n if ids.any?\n query = Capybarista::Queries::XPath.labels_for(*ids)\n return session.find(:xpath, query)\n else\n raise Capybara::ElementNotFound, \"The element has no labels\"\n end\n end", "title": "" }, { "docid": "068f4404267de3a50cc1fb964bdcda4f", "score": "0.6137213", "text": "def check_by_xpath(xpath)\n find(:xpath, xpath).set(true)\n end", "title": "" }, { "docid": "254822e0bc64d15598e1b5f4c3044932", "score": "0.6130051", "text": "def has_input_for_attribute?(name)\n node.has_selector?(\"input[name='#{field_prefix}[#{name}]']\")\n end", "title": "" }, { "docid": "9abb38c240c0eafe6f8215ca27199271", "score": "0.6070508", "text": "def matches_xpath?(xpath, **options, &optional_filter_block); end", "title": "" }, { "docid": "5dce4a2cc7a133406a354cf35e69e571", "score": "0.6026129", "text": "def xpath_search\n \"descendant-or-self::a[contains(@href,'metrics') and \\\n starts-with(@href, '#{Gitlab.config.gitlab.url}')]\"\n end", "title": "" }, { "docid": "d7fbb092960c0a2627681860633e9d23", "score": "0.60113966", "text": "def attribute_present?(attr_name); end", "title": "" }, { "docid": "f427e2d9b17582089eee2f91d514839d", "score": "0.59889185", "text": "def xpath()\r\n assert_exists\r\n @element.path\r\n end", "title": "" }, { "docid": "d52ffe15a1d3bd6c18e89b8564d6e0d7", "score": "0.5970192", "text": "def xpaths_visible_contains element, value\n xpaths string_visible_contains element, value\n end", "title": "" }, { "docid": "d5d0023fa3239d2ba13f8d2e84b28202", "score": "0.594797", "text": "def test_xpath_converts_silly_notation_to_text_matches\r\n _assert_xml '<x><a>wrong one</a><a>b</a></x>'\r\n assert{ xpath(:a, :'.' => :b) == xpath('//a[ . = \"b\" ]') }\r\n end", "title": "" }, { "docid": "a6706242bfd1f22e35a49eb738774100", "score": "0.59447676", "text": "def attribute?(name)\n `#{@el}.hasAttribute(#{name})`\n end", "title": "" }, { "docid": "2acd6d600117e68ee997d524ec2ca95f", "score": "0.5888019", "text": "def attr?(name)\n !node.getAttribute(name.to_s).nil?\n end", "title": "" }, { "docid": "a3aed8724b13176f307004ccdf03997f", "score": "0.5885824", "text": "def match_link_by_label(elem, arg)\n case arg\n when :image\n /img /.match?(elem.to_s)\n when Regexp\n arg.match?(elem.to_s)\n when String\n elem.to_s.index(arg)\n else\n true\n end\n end", "title": "" }, { "docid": "283a5e7b05e4a9e7bd3b624e64ee995c", "score": "0.58634436", "text": "def picked?(node)\n node.xpath(\"@alienexposure:pickflag\", \"alienexposure\" => \"http://www.alienskin.com/exposure#\").first&.value&.to_i == ALIENSKIN_FLAG_PICK\nend", "title": "" }, { "docid": "bb6f76f0d6a149caf8ba01a983369181", "score": "0.58526635", "text": "def test_xpath_dsl\r\n assert_xhtml 'hit\r\n <a href=\"http://antwrp.gsfc.nasa.gov/apod/\"\r\n >apod</a>\r\n daily!'\r\n assert do\r\n\r\n xpath :a, \r\n :href => 'http://antwrp.gsfc.nasa.gov/apod/',\r\n ?. => 'apod' # the <code>?.</code> resolves to XPath: <code>a[ . = \"apod\" ]</code>\r\n\r\n end\r\n end", "title": "" }, { "docid": "e0fe0b2722230cdf8524d951464541f7", "score": "0.58515215", "text": "def find_by_attribute(selector, value)\n detect{|node| value === node.attribute(selector) }\n end", "title": "" }, { "docid": "a1d7235a33ea38a40f0dd570cae74c29", "score": "0.5851166", "text": "def find_eles_by_attr_include tag, attr, value\n @driver.find_elements :xpath, %Q(#{tag}[contains(@#{attr}, '#{value}')])\n end", "title": "" }, { "docid": "ac0029a31336d98b40a959929c161e29", "score": "0.5826955", "text": "def verifySignEventLabel\n # assert element_present?(:xpath, \"//*[@id='body']/div[3]/nav/a[2]/div\")\n end", "title": "" }, { "docid": "9d994d20c5985af8c74af0b09b0f9994", "score": "0.5814133", "text": "def exists\r\n @attr_expression.exists\r\n end", "title": "" }, { "docid": "863366d33da25473ada8dff97f734ce6", "score": "0.58091605", "text": "def label_by_class_exists(label_class)\n return @browser.label(:class, cuke_class(label_class)).exist?\nend", "title": "" }, { "docid": "20c6cb9827408692d07549b4a1856495", "score": "0.58041745", "text": "def check_by_xpath(xpath)\n @log.debug \" Start check_by_xpath(#{xpath})\"\n find(:xpath, xpath).set(true)\n end", "title": "" }, { "docid": "8bae2e21a0fd1f83272d89a4f64b2c19", "score": "0.5796094", "text": "def have_xpath(expected, &block)\n HaveXpath.new(expected, &block)\n end", "title": "" }, { "docid": "a310e2e2203e68484328df84df9e504d", "score": "0.57855844", "text": "def has_attribute?(attr_name); end", "title": "" }, { "docid": "a310e2e2203e68484328df84df9e504d", "score": "0.57855844", "text": "def has_attribute?(attr_name); end", "title": "" }, { "docid": "f86f27dad9836b3e323be1a44ac67864", "score": "0.57749087", "text": "def label_ok?\n\n return true if @elements['label'].empty?\n\n if @elements['label'].length > 1\n error \"The manifest document lists more than one label - at most one can be specfied.\"\n return\n end\n\n @label = @elements['label'].shift\n end", "title": "" }, { "docid": "265ae9470ca73e20d575869bfe43cbc3", "score": "0.57708156", "text": "def find_ele_by_attr_include tag, attr, value\n @driver.find_element :xpath, %Q(#{tag}[contains(@#{attr}, '#{value}')])\n end", "title": "" }, { "docid": "d207fc8230b954023b02e30fc064e7a6", "score": "0.5768068", "text": "def input_locator_by_label(label)\n {:xpath => \"//label[contains(., \\\"#{label}\\\")]/following-sibling::div//input\"}\n end", "title": "" }, { "docid": "72954c3c303eb29ce5cf431a146fa0bd", "score": "0.576367", "text": "def have_attribute(label, value)\n HaveAttributeMatcher.new(label, value)\n end", "title": "" }, { "docid": "6542fd77d5ca0e043d43f293bfeaac88", "score": "0.5756035", "text": "def alocate(path, found)\n step = path[0]\n if step.start_with?('@') # attribute\n raise InvalidPath.new(path) unless 1 == path.size\n\n if instance_variable_defined?(:@attributes)\n step = step[1..-1]\n sym_step = step.to_sym\n @attributes.each do |k, v|\n found << v if ('?' == step or k == step or k == sym_step)\n end\n end\n else # element name\n if (i = step.index('[')).nil? # just name\n name = step\n qual = nil\n else\n name = step[0..i-1]\n raise InvalidPath.new(path) unless step.end_with?(']')\n\n i += 1\n qual = step[i..i] # step[i] would be better but some rubies (jruby, ree, rbx) take that as a Fixnum.\n if '0' <= qual and qual <= '9'\n qual = '+'\n else\n i += 1\n end\n index = step[i..-2].to_i\n end\n if ['?', '*'].include?(name)\n match = nodes\n elsif '^' == name[0..0] # 1.8.7 thinks name[0] is a fixnum\n case name[1..-1]\n when 'Element'\n match = nodes.select { |e| e.is_a?(Element) }\n when 'String', 'Text'\n match = nodes.select { |e| e.is_a?(String) }\n when 'Comment'\n match = nodes.select { |e| e.is_a?(Comment) }\n when 'CData'\n match = nodes.select { |e| e.is_a?(CData) }\n when 'DocType'\n match = nodes.select { |e| e.is_a?(DocType) }\n else\n # puts \"*** no match on #{name}\"\n match = []\n end\n else\n match = nodes.select { |e| e.is_a?(Element) and name == e.name }\n end\n unless qual.nil? or match.empty?\n case qual\n when '+'\n match = index < match.size ? [match[index]] : []\n when '-'\n match = index <= match.size ? [match[-index]] : []\n when '<'\n match = 0 < index ? match[0..index - 1] : []\n when '>'\n match = index <= match.size ? match[index + 1..-1] : []\n when '@'\n k, v = step[i..-2].split('=')\n if v\n match = match.select { |n| n.is_a?(Element) && (v == n.attributes[k.to_sym] || v == n.attributes[k]) }\n else\n match = match.select { |n| n.is_a?(Element) && (n.attributes[k.to_sym] || n.attributes[k]) }\n end\n else\n raise InvalidPath.new(path)\n end\n end\n if (1 == path.size)\n match.each { |n| found << n }\n elsif '*' == name\n match.each { |n| n.alocate(path, found) if n.is_a?(Element) }\n match.each { |n| n.alocate(path[1..-1], found) if n.is_a?(Element) }\n else\n match.each { |n| n.alocate(path[1..-1], found) if n.is_a?(Element) }\n end\n end\n end", "title": "" }, { "docid": "c4ce38f5b497fd5bba1488d2486cd334", "score": "0.5741", "text": "def local_xpath\n xpath = (\"#{xmlns}:\" unless xmlns.blank? ).to_s + (options[:path] || name).to_s\n\n xpath += \"[#{options[:if]}]\" if options[:if] and options[:if].is_a? String\n xpath += \"[not(#{options[:unless]})]\" if options[:unless] and options[:unless].is_a? String\n\n xpath\n end", "title": "" }, { "docid": "90997dd4eaedd1f33a7de2a287a028f4", "score": "0.57315314", "text": "def have_xpath(expected, &block)\n HaveXpath.new(expected, &block)\n end", "title": "" }, { "docid": "d08290433366a0292412a54e39001873", "score": "0.5720905", "text": "def refute_matches_xpath(*args, &optional_filter_block); end", "title": "" }, { "docid": "5fc85be1aad7788bdf083e1956298a67", "score": "0.57090425", "text": "def label_with_locale(mark1, mark2)\n if element_exists(\"* marked:'#{mark1}'\")\n return \"* marked:'#{mark1}'\"\n elsif element_exists(\"* marked:'#{mark2}'\")\n return \"* marked:'#{mark2}'\"\n else\n return false\n end\nend", "title": "" }, { "docid": "a3648f149f316d89048a30afa7acb24e", "score": "0.5706759", "text": "def read_attribute path, attribute_name\n if is_new?\n return nil\n end\n\n nodes = path.eval_xpath(@doc)\n if nodes.length == 0\n return nil\n end\n nodes[0].get_attribute attribute_name\n end", "title": "" }, { "docid": "48e6732642af67d2742ee232e243fc84", "score": "0.56881565", "text": "def xpath_visible_contains element, value\n xpath string_visible_contains element, value\n end", "title": "" }, { "docid": "6c132d0552a5f68add426ff80d5262ef", "score": "0.5668132", "text": "def attribute?( name )\n return heading.attribute?(name)\n end", "title": "" }, { "docid": "a1664e1279fee732e51218c64b30d2d6", "score": "0.5668084", "text": "def keyword_condition_present?(keyword)\n exists?({:xpath => \"//h1[contains(.,\\\"#{keyword}\\\")]\"})\n end", "title": "" }, { "docid": "5f4b4cf13a95a639004b69f45aa1014f", "score": "0.56208134", "text": "def not_matches_xpath?(xpath, **options, &optional_filter_block); end", "title": "" }, { "docid": "a55c08f723b3d48e4396a607b47abc72", "score": "0.56151044", "text": "def contains_xpath?\n xpath_result_set = @xml_document.xpath(@xpath, @namespaces)\n yield(xpath_result_set) if block_given?\n !xpath_result_set.empty?\n end", "title": "" }, { "docid": "249b03a4c67f08bb48867cbed63fdc7b", "score": "0.56091315", "text": "def visit_label(node); end", "title": "" }, { "docid": "249b03a4c67f08bb48867cbed63fdc7b", "score": "0.56091315", "text": "def visit_label(node); end", "title": "" }, { "docid": "c17ae599230b22e4389b7aa99f4aef54", "score": "0.55961436", "text": "def test_nested_xpath_text\r\n _assert_xml '<boats><a>frig</a><b>ates</b></boats>'\r\n\r\n assert{ xpath :boats, ?. => 'frigates' }\r\n end", "title": "" }, { "docid": "d488769d707297f1b33c3cca5e5921ac", "score": "0.5574049", "text": "def matches_xpath?(xpath, **options, &optional_filter_block)\n matches_selector?(:xpath, xpath, **options, &optional_filter_block)\n end", "title": "" }, { "docid": "b07d4f1c69733dca2a82c14dc00088ab", "score": "0.55599785", "text": "def xpath xpath_str\n find_element :xpath, xpath_str\n end", "title": "" }, { "docid": "db1252107dccec2028e1f305fbe3e36e", "score": "0.5542673", "text": "def xpath_contains(node, xpath, text)\n node.xpath(xpath).xpath(\"./text()[contains(.,'#{text}')]\").length > 0\n end", "title": "" }, { "docid": "9009bd52863698f9088d547e11170214", "score": "0.5540743", "text": "def attribute(name, text)\r\n\t\t\r\n\t\tre = Regexp.new(text)\r\n\t\txp = build_xpath(@tags) + \"/@\" + name\r\n\t\tprove_entry(re, xp)\r\n\t\t\r\n\tend", "title": "" }, { "docid": "8318b4dfccde1d43a7cf8df76f884583", "score": "0.5520012", "text": "def validate_label(l)\n l.nil? or l.to_s.index(/['=]/) ? false : true\n end", "title": "" }, { "docid": "303187c6e7932a0216b5056ac9836bfd", "score": "0.5515256", "text": "def test_various_xpath\n #@doc = REXML::Document.new('<r a=\"1\"><p><c b=\"2\"/></p></r>')\n doc = REXML::Document.new('<r a=\"1\"><p><c b=\"2\">3</c></p></r>')\n\n [['/r', REXML::Element],\n ['/r/p/c', REXML::Element],\n ['/r/attribute::a', Attribute],\n ['/r/@a', Attribute],\n ['/r/attribute::*', Attribute],\n ['/r/@*', Attribute],\n ['/r/p/c/attribute::b', Attribute],\n ['/r/p/c/@b', Attribute],\n ['/r/p/c/attribute::*', Attribute],\n ['/r/p/c/@*', Attribute],\n ['//c/attribute::b', Attribute],\n ['//c/@b', Attribute],\n ['//c/attribute::*', Attribute],\n ['//c/@*', Attribute],\n ['.//node()', REXML::Node ],\n ['.//node()[@a]', REXML::Element ],\n ['.//node()[@a=\"1\"]', REXML::Element ],\n ['.//node()[@b]', REXML::Element ], # no show, why?\n ['.//node()[@b=\"2\"]', REXML::Element ]\n ].each do |xpath,kind|\n begin\n REXML::XPath.each( doc, xpath ) do |what|\n assert_kind_of( kind, what, \"\\n\\nWrong type (#{what.class}) returned for #{xpath} (expected #{kind.name})\\n\\n\" )\n end\n rescue Exception\n puts \"PATH WAS: #{xpath}\"\n raise\n end\n end\n\n [\n ['/r', 'attribute::a', Attribute ],\n ['/r', '@a', Attribute ],\n ['/r', 'attribute::*', Attribute ],\n ['/r', '@*', Attribute ],\n ['/r/p/c', 'attribute::b', Attribute ],\n ['/r/p/c', '@b', Attribute ],\n ['/r/p/c', 'attribute::*', Attribute ],\n ['/r/p/c', '@*', Attribute ]\n ].each do |nodepath, xpath, kind|\n begin\n context = REXML::XPath.first(doc, nodepath)\n REXML::XPath.each( context, xpath ) do |what|\n assert_kind_of kind, what, \"Wrong type (#{what.class}) returned for #{xpath} (expected #{kind.name})\\n\"\n end\n rescue Exception\n puts \"PATH WAS: #{xpath}\"\n raise\n end\n end\n end", "title": "" }, { "docid": "adecdd60faad8338b2c345d2be68ff26", "score": "0.55149657", "text": "def attribute?\r\n node_type == ATTRIBUTE_NODE\r\n end", "title": "" }, { "docid": "8cb449c7faa8a2c9798bea80fb5a912f", "score": "0.55057186", "text": "def xpaths_visible_exact element, value\n xpaths string_visible_exact element, value\n end", "title": "" }, { "docid": "23bea44c9aba4358e73de5eafbe0f63d", "score": "0.5505287", "text": "def verify_attribute element_locator, attribute_name, value_pattern\r\n command('verifyAttribute', \"#{element_locator}@#{attribute_name}\",\r\n value_pattern)\r\n end", "title": "" }, { "docid": "e9b474952713e25b9458d24aa7035b54", "score": "0.5498582", "text": "def is_node_label?\n regex = /[,]*[n|r][0-9]+/\n true if self =~ regex\n end", "title": "" }, { "docid": "2e814ef792075653efbaf90829567cd6", "score": "0.5490528", "text": "def xpath(*args)\n capybara_element(*args).try(:path)\n end", "title": "" }, { "docid": "a987b3fefcd216d7b7b4361a4025b310", "score": "0.54865634", "text": "def as_xpath\n xpath = '/'\n @path.each{|x|\n case x\n when String\n xpath += '/' + x\n when Hash\n xpath += '['\n x.each_with_index do |(name, value), index|\n if index > 0\n xpath += ' and '\n end\n xpath += '@' + name.to_s + '=\"' + value + '\"'\n end\n xpath += ']'\n end\n }\n xpath\n end", "title": "" }, { "docid": "d03a5dc36bec19dec2c61d3c9f5cdcfd", "score": "0.5475962", "text": "def is_special_node label\n\t\t\tSPECIAL_PREFIXES.each do |prefix|\n\t\t\t\tif label.start_with? prefix\n\t\t\t\t\treturn true\n\t\t\t\tend\n\t\t\tend\n\n\t\t\treturn false\n\t\tend", "title": "" }, { "docid": "4ea2201d20e37e9d537b9a70214dc67c", "score": "0.5469303", "text": "def test_contains\n source = <<-EOF\n <foo>\n <a href=\"mailto:a@b.c\">a@b.c</a>\n <a href=\"http://www.foo.com\">http://www.foo.com</a>\n </foo>\n EOF\n doc = Document.new source\n\n [['o', 2], ['foo', 1], ['bar', 0]].each { |test|\n search, expected = test\n set = doc.elements.to_a(\"//a[contains(@href, '#{search}')]\")\n assert_equal expected, set.size\n }\n end", "title": "" }, { "docid": "6fa2e58600e1e44905b9fda47142ce6b", "score": "0.5467827", "text": "def attribute(selector)\n @node.find(selector).text\n rescue Capybara::ElementNotFound\n nil\n end", "title": "" }, { "docid": "0265a6f3d4d31229ae77abe96d6d33c4", "score": "0.54674745", "text": "def is_label?\n return label==true\n end", "title": "" }, { "docid": "ebd0ebfe6debc5b2ffe4ef661b5db495", "score": "0.5466585", "text": "def findElementByXpath(xpathArg)\n\t\nend", "title": "" }, { "docid": "d921aaa3d759b31b824cfdef208549aa", "score": "0.54602766", "text": "def xpath\n xml.xpath\n end", "title": "" }, { "docid": "d921aaa3d759b31b824cfdef208549aa", "score": "0.54602766", "text": "def xpath\n xml.xpath\n end", "title": "" }, { "docid": "467fe2e833fe36a7e092d7ebe95a7dc5", "score": "0.5450338", "text": "def _test_attr # test_attr object attribute ?(label)\r\n obj_id, attribute = @operands\r\n\r\n branch (zobj obj_id).has_attribute? attribute\r\n end", "title": "" }, { "docid": "f910479955c77be5ea30e18ef8f03a75", "score": "0.54464936", "text": "def forced_xpath?\n !@meth['options']['xpath'].nil?\n end", "title": "" }, { "docid": "4013a590539183b5c20d6feaa81f8dd3", "score": "0.5430052", "text": "def label_target\n :\"#{attribute_name}\"\n end", "title": "" }, { "docid": "d56fc320a60ec0003bd9478400938c40", "score": "0.541729", "text": "def at_xpath(*args)\n xpath(*args).first\n end", "title": "" }, { "docid": "d56fc320a60ec0003bd9478400938c40", "score": "0.541729", "text": "def at_xpath(*args)\n xpath(*args).first\n end", "title": "" }, { "docid": "b3ab3dbcd6c24fbceaa401ef9d851346", "score": "0.54170245", "text": "def find_eles_by_attr class_name, attr, value\n @driver.find_elements :xpath, string_attr_exact(class_name, attr, value)\n end", "title": "" }, { "docid": "10b6df425f06f6cf62a1dabfbfbc42ca", "score": "0.5411621", "text": "def is_label?\n label != nil\n end", "title": "" }, { "docid": "825a0191975fb0ebd6863cc0799eedb3", "score": "0.54004025", "text": "def is_in_here target, root\n return root.css(\"#{target[0]}[#{target[1]}=#{target[2]}]\").size > 0\nend", "title": "" }, { "docid": "97dc0299b38cb3b792752869e5856a3c", "score": "0.5394193", "text": "def attribute?(attribute)\r\n assert_exists\r\n @element.get_attribute(attribute.to_s.downcase)\r\n end", "title": "" }, { "docid": "cc2ac5cad0891f921f6d5fff427fef15", "score": "0.5387581", "text": "def nested?(attribute) #:doc:\r\n attribute[:name].to_s.match(/\\./) ? true : false\r\n end", "title": "" }, { "docid": "88995cd37c56002bc72cfef8db6eaa21", "score": "0.5381347", "text": "def any(name)\n return @root.xpath(\"meta/#{name}[@meta='yes']\").length > 0\n end", "title": "" }, { "docid": "83b1346726bf7bc1b7d3b592873f4a64", "score": "0.53790146", "text": "def xpath_search\n 'descendant-or-self::a[@href]'\n end", "title": "" }, { "docid": "bba009b79f43fee0cc99601b73c9a695", "score": "0.53784084", "text": "def has_link?(locator)\n !with_locator('a', locator).nil?\n end", "title": "" }, { "docid": "32ea992250effa96b7f2bb6362c4fe2c", "score": "0.5374253", "text": "def line_of(node)\n node.xpath(\"preceding::*[name() = 'lb'][1]\")\n end", "title": "" }, { "docid": "f863dc7b6705c37c45ae4294abaf6786", "score": "0.5373273", "text": "def at_xpath(xpath)\n @parser.at_xpath(xpath)\n end", "title": "" }, { "docid": "a0f3befa384edc64153c6a054e9bc096", "score": "0.5372209", "text": "def attr_val(xpath)\n Utilities.attr_val(@entry, xpath)\n end", "title": "" }, { "docid": "cea10299ceb7ba2232efa2d3c91b55ae", "score": "0.5365782", "text": "def attribute?() @type.downcase.start_with?( 'attribute' ); end", "title": "" }, { "docid": "39786f995b5cfdd6865de7e3537b7d58", "score": "0.53627634", "text": "def test_xpath_text_is_not_the_same_as_question_dot_notation\r\n _assert_xml '<Mean>\r\n <Woman>Blues</Woman>\r\n <Woman>Dub</Woman>\r\n </Mean>'\r\n assert do\r\n\r\n xpath(:Woman).text == 'Blues' and\r\n xpath(:Woman, ?. => :Dub).text == 'Dub'\r\n # use a symbol ^ to match a string here, as a convenience\r\n\r\n end\r\n end", "title": "" }, { "docid": "28494542f1df7abf94df34fd0bd32820", "score": "0.53620684", "text": "def label label = nil\n @label = label if label\n @label || (@node.saint.label if @node)\n end", "title": "" }, { "docid": "10481a83639a3f5896786be8e75f2983", "score": "0.53619564", "text": "def has_label?(label)\n @labels.include? label.to_s\n end", "title": "" }, { "docid": "40597164ef1c2ff6096f153ac39876e5", "score": "0.5361601", "text": "def xpath(*args)\n @node.xpath(*args)\n end", "title": "" }, { "docid": "a37b01e710531cbd0d1349577d217527", "score": "0.5357068", "text": "def invlaid_attribute?(attributes)\n attributes[:tag_type_name].blank? \n end", "title": "" }, { "docid": "f0697bc0ff59c2de15d2ea0b5be48d97", "score": "0.5353744", "text": "def xlink?()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "46983ec7b165d5a759f7ca226b4fe434", "score": "0.5350365", "text": "def child_nodes_have_attribute?(attribute_name)\n return true if @__attributes.keys.include?(attribute_name)\n answer = false\n @__children.keys.each do |key|\n if self[key].class.eql?(Array)\n self[key].each do |e|\n answer = e.child_nodes_have_attribute?(attribute_name)\n end\n else\n if self[key].child_nodes_have_attribute?(attribute_name)\n answer = true\n break\n end\n end \n end\n return answer\n end", "title": "" }, { "docid": "b316a64d0687d7538a554430dc864d69", "score": "0.53502345", "text": "def have_xpath(expected, options = {}, &block)\n HaveXpath.new(expected, options, &block)\n end", "title": "" }, { "docid": "0b66f04cbd239598e1056438c4b69439", "score": "0.5330334", "text": "def match?(locator); end", "title": "" }, { "docid": "b6abfb98fec11ecd87160590c8a4f8a5", "score": "0.5329604", "text": "def namespaced_key?(attribute, namespace)\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "fc154fc4c5d61ca35bffbf06355d8dc7", "score": "0.5325878", "text": "def not_matches_xpath?(xpath, **options, &optional_filter_block)\n not_matches_selector?(:xpath, xpath, **options, &optional_filter_block)\n end", "title": "" }, { "docid": "7e82096b4d10b546e3d3116a8c691205", "score": "0.53255045", "text": "def contains_xpath_with_text_value?(text_value)\n contains_text_value = false\n \n contains_xpath? do |xpath_result_set|\n if !xpath_result_set.empty?\n child = xpath_result_set.first.child\n contains_text_value = !child.nil? && child.text? && (child.to_s == text_value)\n end\n end\n \n contains_text_value\n end", "title": "" }, { "docid": "c8d4994daf6d39ee2f183809b433d9f1", "score": "0.53231764", "text": "def refute_xpath(*args, &optional_filter_block); end", "title": "" }, { "docid": "1e3be65dec69742fd4c896f620a3d2ab", "score": "0.53163207", "text": "def attr_val(xpath)\n Utilities::attr_val(@entry, xpath)\n end", "title": "" }, { "docid": "77096594e3e21032d63d3dbe7c099922", "score": "0.5315298", "text": "def xpath_type()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "3d88ffb1ec791bea6fd44cb176c24966", "score": "0.53131163", "text": "def extract_attr_value(xml)\n default_when_xpath_err { @path.first(xml).elements.to_a }\n end", "title": "" }, { "docid": "199c1ada525a56959c8236afd7f49f78", "score": "0.53046095", "text": "def xpath(xpath)\n @parser.xpath(xpath)\n end", "title": "" }, { "docid": "3caea3d51f3169293edd155304ec208d", "score": "0.5291177", "text": "def text_input_xpath(locator, inputvalue)\n end", "title": "" }, { "docid": "fb3ad47838ed27daa73155cd5f3b6a37", "score": "0.5277999", "text": "def label_element_value (identifier, id)\n elements_uri = label_elements_uri(identifier)\n response = GoodData::get(\"#{elements_uri}?id =#{id}\")\n if !(response['attributeElements']['elements'].empty?)\n return response['attributeElements']['elements'][0]['title']\n else\n puts \"WARNING: label #{identifier} doesn't contain element id =#{id}.\"\n puts \"Grep the output directory for '%element%#{label_attribute(identifier)},#{id}%' to find all objects that contains the invalid IDs.\"\n end\n end", "title": "" }, { "docid": "0c2d914d58cea5430969341c15a0ae03", "score": "0.52727824", "text": "def attribute(name)\n attributes.each { |a| return a if a.property.id =~ /\\/#{name}$/ }\n nil\n end", "title": "" } ]
89029c70f2bc06ecd66fccbb1f791ebc
returns/lbtt/ads_amount step in the ADS wizard tax is re calculated
[ { "docid": "b00f9c855af257e52e7b70f0109537b9", "score": "0.86181664", "text": "def ads_amount\n wizard_step(STEPS) { { after_merge: :update_tax_calculations } }\n end", "title": "" } ]
[ { "docid": "54bd79e42ca3ef65cd3d6785441fafa1", "score": "0.7234702", "text": "def payment_amount\n amount - tax\n end", "title": "" }, { "docid": "bedb589a6728d5ca61dada08a6c36b8f", "score": "0.70396155", "text": "def tax_shown_adjustment\n line[:total!] - sum_lines(4, 8)\n end", "title": "" }, { "docid": "44bca9097180a1896709927f0635df16", "score": "0.6949975", "text": "def tax\r\n return 0\r\n end", "title": "" }, { "docid": "c5c4aeb12fd63168512222f1dc3d3ae7", "score": "0.6946927", "text": "def calculate_tax(statecode, dollar)\n \n tax_rate = @taxes[statecode].to_f / 100\n after_tax_amount = dollar * tax_rate\n after_tax_amount \n # binding.pry\nend", "title": "" }, { "docid": "2d774ba648b38b77018f7d42f66d1452", "score": "0.69294953", "text": "def calc_non_gst_inter_tax_amt\n 0\n end", "title": "" }, { "docid": "6c7e37fbf36e812507527c92712cf439", "score": "0.68193036", "text": "def get_total_amount\n\t\tamount=0\n\t\tpurchase_return_line_items.each do |line_item|\n\t\t\tamount+=line_item.amount\n\t\tend\n\t\ttax_line_items.each do |line_item|\n\t\t\ttax_account = line_item.account\n next if (tax_account.accountable_type=='DutiesAndTaxesAccounts' && tax_account.accountable.calculation_method==4 && tax_account.accountable.split_tax == 0)\n\t\t\tamount+=line_item.amount unless line_item.marked_for_destruction?\n\t\tend\n\t\tamount\n\tend", "title": "" }, { "docid": "a351acd7656d5b952ed9a212a643479c", "score": "0.679332", "text": "def total\n amount\n # net #+ net_tax\n end", "title": "" }, { "docid": "ca350f635fafdad640dbc55afe67db1d", "score": "0.6782538", "text": "def total_tax\n tax_sum_total * amount\n end", "title": "" }, { "docid": "fdd44ea571243975b686116c149e01e1", "score": "0.67762375", "text": "def tax_total_base\n conv_tax\n end", "title": "" }, { "docid": "10c2ea25437dff810b8dcc0b49d66fe1", "score": "0.67092174", "text": "def tax\n total_before_tax * @tax\n end", "title": "" }, { "docid": "d99e5f206e457455878937675e341fb1", "score": "0.67086726", "text": "def calcTotalTax(tax)\n \t\t@@totalTax = @@totalTax + tax\n \tend", "title": "" }, { "docid": "8f15522b4dd4afd9b82550987a10ef83", "score": "0.66836774", "text": "def total_amount\n if FedenaInventory.old_tax_mode?\n net_amount = gross_amount + tax_amount(gross_amount)\n net_amount - discount_amount(net_amount) \n else\n net_amount = gross_amount - discount_amount(gross_amount)\n net_amount + tax_amount(net_amount)\n end \n end", "title": "" }, { "docid": "9031373f901deee4967860708f11f1be", "score": "0.6678421", "text": "def tax_sum_total\n tax25_sum + tax12_sum + tax6_sum\n end", "title": "" }, { "docid": "9031373f901deee4967860708f11f1be", "score": "0.6678421", "text": "def tax_sum_total\n tax25_sum + tax12_sum + tax6_sum\n end", "title": "" }, { "docid": "cd96ff5c2e6e34d748b399d8e1251b84", "score": "0.6657578", "text": "def tax_amount\n ((self.total * self.tax ) / 100.0).round(2)\n end", "title": "" }, { "docid": "454ad2a28724df9eb160023f7ecf3059", "score": "0.6633025", "text": "def calculate_tax\n\t\t\tbasic_tax = 0.0\n\t\t\timport_tax = 0.0\n\t\t\tbasic_tax = @price * basic_tax_rate unless tax_exempt?\n\t\t\timport_tax = @price * import_tax_rate if imported?\n\t\t\t#basic_tax = (basic_tax*20).ceil/20\n\t\t\t#import_tax = (import_tax*20).ceil/20\n\t\t\t@tax = basic_tax + import_tax\n\t\t\t@@total_tax += @tax\n\t\tend", "title": "" }, { "docid": "176e3415a5af96c7744ede7518e6f16c", "score": "0.66246814", "text": "def total_amount\n if grn.saved_in_old_tax_mode?\n net_amount = gross_amount + tax_amount(gross_amount)\n net_amount - discount_amount(net_amount) \n else\n net_amount = gross_amount - discount_amount(gross_amount)\n net_amount + tax_amount(net_amount)\n end \n end", "title": "" }, { "docid": "40531f29b58d1d43804eba3c05499158", "score": "0.6606785", "text": "def tax_pct\n 20\n end", "title": "" }, { "docid": "40531f29b58d1d43804eba3c05499158", "score": "0.6606785", "text": "def tax_pct\n 20\n end", "title": "" }, { "docid": "24b6510b80422ede017352fa11345862", "score": "0.6602294", "text": "def taxrate\n 0.10\n end", "title": "" }, { "docid": "db5bc4140a224576be38cf2f05825fba", "score": "0.65962714", "text": "def rrp_inc_sales_tax\n price_get(2).try(:price_amount)\n end", "title": "" }, { "docid": "f4f581a27c2ed6e9abe2b733cb0c9630", "score": "0.65942764", "text": "def amount\n self.net_amount+self.taxes_amount\n end", "title": "" }, { "docid": "77ab3ef8373108d800186cbecb375a15", "score": "0.6543097", "text": "def taxable_amount\n taxable_amount = 0 \n taxable_amount = taxable_amount + self.amount if self.amount\n taxable_amount = taxable_amount + self.smog_fee if self.smog_fee\n taxable_amount = taxable_amount + self.doc_fee if self.doc_fee\n taxable_amount = taxable_amount + self.reg_fee if self.reg_fee\n taxable_amount = taxable_amount + self.other_fee if self.other_fee\n taxable_amount = taxable_amount + self.gap_price if self.gap_price\n taxable_amount = taxable_amount + self.warranty_price if self.warranty_price\n taxable_amount = taxable_amount - self.trade_in_value if self.trade_in_value\n taxable_amount = taxable_amount + self.less_payoff if self.less_payoff\n return taxable_amount\n return taxable_amount\n end", "title": "" }, { "docid": "3d1da314c54aa30f40d51cccba6ee0ce", "score": "0.6531198", "text": "def tax_rate\n 0.10\n end", "title": "" }, { "docid": "616b96b81c91f782d5d9d7b604ad3504", "score": "0.6527649", "text": "def lift_total\n\n end", "title": "" }, { "docid": "78e66b58b258631604db93057f8a028d", "score": "0.6518896", "text": "def total_before_tax\n @items.each do |item|\n @total_before_tax << item.get_base_price\n end\n return @total_before_tax.sum\n end", "title": "" }, { "docid": "65df0b51bd43748b8ef9903b27baa1c0", "score": "0.6513507", "text": "def cal_tax\n\t\t@i_tax=0\n\t\t@s_tax=0\n\t\t@checkout_basket.each do |key, value|\n\t\t\tif value[:i_tax]==\"Y\"\n\t\t\t\tvalue.store(:i_tax,(value[:price]*0.05*20).ceil/20.round(2))\n\t\t\t\t@i_tax+=value[:i_tax]\n\t\t\telse \n\t\t\t\tvalue.store(:i_tax,0)\n\t\t\tend \n\t\t\tif value[:s_tax]==\"Y\"\n\t\t\t\tvalue.store(:s_tax,(value[:price]*0.1*20).ceil/20.round(2))\n\t\t\t\t@s_tax+=value[:s_tax]\n\t\t\telse \n\t\t\t\tvalue.store(:s_tax,0)\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "96dfc0a04c8c2cb94104e653de6648b4", "score": "0.65102524", "text": "def calculate_tax\n return :skipped if purchase_items.empty? or not basket?\n run_callbacks :taxation_updated do\n tax_item.update \\\n display_name: taxation_display_name,\n price: calculate_tax_cost\n end\n end", "title": "" }, { "docid": "efd1f612433952f4c82825775316175a", "score": "0.65093327", "text": "def tax_pct\n 0\n end", "title": "" }, { "docid": "efd1f612433952f4c82825775316175a", "score": "0.65093327", "text": "def tax_pct\n 0\n end", "title": "" }, { "docid": "23ddc83bf1061fc59bee53b0a52de0e9", "score": "0.6500383", "text": "def compute_tax(line); end", "title": "" }, { "docid": "1af731217610e79c81691a90798b8a80", "score": "0.64953536", "text": "def tax_total\n included_tax_total + additional_tax_total\n end", "title": "" }, { "docid": "fce3b5247247d8568fbfa96d6e2140ba", "score": "0.64805686", "text": "def line_tax_total\n order_lines.inject(0) { |sum, l| sum + l.tax_amount }\n end", "title": "" }, { "docid": "f20cdda2ac194d1324ccd9d8d89187da", "score": "0.6479593", "text": "def tax \n price * 0.08 \n end", "title": "" }, { "docid": "1d64a47aea77e5b5b96d248869327e89", "score": "0.64676934", "text": "def add_tax\n \n end", "title": "" }, { "docid": "539fc0bfd6db08e3d6a234b43b4bdb99", "score": "0.6435252", "text": "def import_tax\n if (is_apply_import_tax)\n return (@price.to_f * 0.05)\n end\n return 0\n end", "title": "" }, { "docid": "48f5132306e9440c762e7c552aa5df06", "score": "0.6413569", "text": "def tax\n tax_total = (price * 0.09)\n return tax_total\n end", "title": "" }, { "docid": "aa5ff8ec1a5b9b8bd4cf82c65e8ec3fe", "score": "0.6410865", "text": "def total\n compute_sum('taxed_price')\n end", "title": "" }, { "docid": "0c982f91cfc2390f181cf897d0d4a034", "score": "0.6406917", "text": "def total_tax_booking\n (total_tax25_sum + total_tax12_sum + total_tax6_sum).round(2)\n end", "title": "" }, { "docid": "f4e7bf7f046967da7d8bcf7e1fa55a0d", "score": "0.6406341", "text": "def calculateBillTotal(preTaxAmount, tipPercentage)\n taxRate = 0.031\n taxAmount = preTaxAmount * taxRate\n tipAmount = preTaxAmount * (tipPercentage / 100.0)\n return preTaxAmount + tipAmount + taxAmount\nend", "title": "" }, { "docid": "ff9403b0d78ed6ba0c23e24050afd558", "score": "0.64045817", "text": "def tax_amount\n return 0 if tax.nil? || tax <= 0\n amount = 0\n items.each { |item| amount += item.total if item.taxable? }\n amount * ( tax / 100 )\n end", "title": "" }, { "docid": "24adf149c5fd6a2bf861e9985cf3d85d", "score": "0.6404419", "text": "def calculate_tax\n if self.vendor.net_prices\n # this is for the US tax system\n self.tax_amount = self.total * self.tax / 100.0\n self.total += tax_amount\n else\n # this is for the Europe tax system. Note that self.total already includes taxes, so we don't have to modify it here.\n self.tax_amount = self.total * ( 1 - 1 / ( 1 + self.tax / 100.0))\n end\n end", "title": "" }, { "docid": "9bfa6160424a24515845d8049bfd0afc", "score": "0.64023316", "text": "def tax_total\n conv_tax.round(2)\n end", "title": "" }, { "docid": "93a543053cc7c440b5a80eedd34e0290", "score": "0.63956213", "text": "def repayment_claim_amount\n wizard_step(STEPS) { { setup_step: :repayment_claim_amount_setup_step, cache_index: LbttController } }\n end", "title": "" }, { "docid": "20f97879c6be27c4eb698bbb4841c40c", "score": "0.6394027", "text": "def tax\n\t\t0.0\n\tend", "title": "" }, { "docid": "5bbccd0740715f4f8efb3af54e261ffe", "score": "0.6393392", "text": "def calculateTax()\n\n salesTaxIgnoreRegex = Regexp.new(TaxDetails::SALESTAXIGNORE.join(\"|\"))\n # puts \"sales: #{@item_Product}\"\n if ( salesTaxIgnoreRegex.match(@item_Product) )\n @totalAmtInclTax=@item_price\n @item_salestax=0\n #\t puts \"Sales Tax Ignore\"\n else\n @totalAmtInclTax=@item_price + (@item_price*@salesTax)\n @item_salestax=(@item_price*@salesTax)\n #\t puts \"Sales Tax calculated\"\n end\n importDutyRegex=Regexp.new(TaxDetails::IMPORTTAXDUTY.join(\"|\"))\n # puts \"importduty: #{@item_Product}\"\n if ( importDutyRegex.match(@item_Product) )\n @totalAmtInclTax=@totalAmtInclTax + (@item_price*@importDuty)\n @item_import_duty=@item_price*@importDuty\n #\t puts \"Import Duty Calculated\"\n else\n @item_import_duty=0\n #\t puts \"Import Duty Ignored\"\n end\n\n # puts \" Before ToalAmtInclTax: #{@totalAmtInclTax}\"\n @totalAmtInclTax= @totalAmtInclTax.round(2)\n\n # puts \"Price: #{@item_price}\"\n # puts \"salestax: #{@salestax}\"\n # puts \" After ToalAmtInclTax: #{@totalAmtInclTax}\"\n end", "title": "" }, { "docid": "f73fe2514b76c51cc3e86fbf890214cd", "score": "0.6393171", "text": "def value\n base_value - taxed_value\n end", "title": "" }, { "docid": "aa41c19d38235c148134397755b62938", "score": "0.63931686", "text": "def tax\n price * 0.0095\n end", "title": "" }, { "docid": "dfe89e2df4f0742579c9091ddd86f8bf", "score": "0.63846034", "text": "def calculate_tax(state_code, dol_amt)\n #convert input state to caps\n state_code.upcase!\n #return $ tax amount by: (takes input $ and converts to float) mult. the return from #fetch of the % \n ((dol_amt.to_f) *(@taxes.fetch(state_code.to_sym, nil)/100)).round(2)\n \nend", "title": "" }, { "docid": "0f1f686c755e34296dd3c8019f0a7d9a", "score": "0.63811606", "text": "def pre_tax_item_amount\n line_items.sum(:pre_tax_amount)\n end", "title": "" }, { "docid": "58b2db9c118bd9d3809816f2bded374e", "score": "0.63734895", "text": "def compute_line_item(line_item)\n line_item.adjustments.tax.sum(:amount)\n end", "title": "" }, { "docid": "c34574e14320c664c55ec0d26896df3c", "score": "0.6371704", "text": "def fed_tax_money_owed\n if update_taxable <= 43953 && update_taxable >= 11038\n ((update_taxable-11038) * 0.15)\n elsif update_taxable >= 43953.01 && update_taxable <=87907\n ((update_taxable-43953)*0.22+(4937.25))\n elsif update_taxable >= 87907.01 && update_taxable <=136270\n ((update_taxable-87907)*0.26+(14607.13))\n elsif update_taxable >= 136270.01\n ((update_taxable-136270)*0.29+(27181.51))\n elsif update_taxable <= 11038 && update_taxable > 0\n 0\n else update_taxable < 0\n update_taxable\n end\n end", "title": "" }, { "docid": "6a4e305729584cc9dd972f7e9efd3d43", "score": "0.63571936", "text": "def total_before_tax\n self.delivery_price + self.items_sub_total\n end", "title": "" }, { "docid": "4863b4c3c5df690cbaf648ef1cb2b605", "score": "0.63517344", "text": "def total_tax\n line_items.collect(&:tax).inject(&:+)\n end", "title": "" }, { "docid": "e4e52e67ce9f23c61465702c82af1b71", "score": "0.63421756", "text": "def calculate_tax(requested_by, lbtt, type = :main)\n # when called by a public user requested_by will be nil\n additional_parameters = if requested_by\n { Username: requested_by.username, PartyRef: requested_by.party_refno }\n else\n { Authenticated: 'No' }\n end\n\n call_ok?(:lbtt_calc, additional_parameters.merge!(request_calc(lbtt, type))) do |body|\n convert_calc_relief_claim_back_office_hash(body, lbtt)\n assign_attributes(convert_back_office_hash(body, type))\n end\n end", "title": "" }, { "docid": "41630a58a6e4e2d693411a2471eb5aec", "score": "0.6326652", "text": "def sales_tax\n\n\t\tb = 10%\n\t\ti = 5%\n\t\tt = 0%\n\n\t\twhen tax_type == i\n\t\t\titem_price * 0.05\n\t\tend", "title": "" }, { "docid": "f7a4f06d8aca32d8fe3b805cb2e98351", "score": "0.63262856", "text": "def tax\n if @location == \"imported\" && @exemption == \"taxed\"\n @@total_tax = (@price * 0.15).round(2)\n elsif @location != \"imported\" && @exemption == \"taxed\"\n @@total_tax = (@price * 0.10).round(2)\n elsif @location != \"imported\" && @exemption == \"exempt\"\n @@total_tax = (@price * 0).round(2)\n elsif @location == \"imported\" && @exemption == \"exempt\"\n @@total_tax = (@price * 0.05).round(2)\n end\n @@tax_list = @@tax_list << @@total_tax\n end", "title": "" }, { "docid": "f7a4f06d8aca32d8fe3b805cb2e98351", "score": "0.63262856", "text": "def tax\n if @location == \"imported\" && @exemption == \"taxed\"\n @@total_tax = (@price * 0.15).round(2)\n elsif @location != \"imported\" && @exemption == \"taxed\"\n @@total_tax = (@price * 0.10).round(2)\n elsif @location != \"imported\" && @exemption == \"exempt\"\n @@total_tax = (@price * 0).round(2)\n elsif @location == \"imported\" && @exemption == \"exempt\"\n @@total_tax = (@price * 0.05).round(2)\n end\n @@tax_list = @@tax_list << @@total_tax\n end", "title": "" }, { "docid": "666fd827a9e107f9db12f4479ccf15ea", "score": "0.63196903", "text": "def after_discount_price\n price_with_taxes * (100 - discount) / 100\n end", "title": "" }, { "docid": "959c2abb37444d1ec709de5d5c18d4d8", "score": "0.6317418", "text": "def tax\n price.to_i * TAXRATE\n end", "title": "" }, { "docid": "6bfa63d7504eac3ed604f2f550b1d7cf", "score": "0.6313946", "text": "def tax_total\n line_tax_total + shipping_tax_amount\n end", "title": "" }, { "docid": "68224182a637e0a765114a40ed86df8f", "score": "0.6312095", "text": "def total\n subtotal\n # + tax\n end", "title": "" }, { "docid": "52d25c736c882c0b312257e9ca5a9285", "score": "0.63098276", "text": "def sales_tax_amount\n Calculator.new(quantity, product, price).sales_tax_amount\n end", "title": "" }, { "docid": "bf3acc58424ee161abb673633f3cc59d", "score": "0.6308712", "text": "def tax\n price * 0.09\n end", "title": "" }, { "docid": "bf3acc58424ee161abb673633f3cc59d", "score": "0.6308712", "text": "def tax\n price * 0.09\n end", "title": "" }, { "docid": "d52ee8eecd94b4cbddfdeb2cc48f92f5", "score": "0.6307787", "text": "def sales_tax_amount\n amount = 0\n\n amount += basic_sales_tax if !exempt?\n amount += imported_sales_tax if imported?\n\n # One thing I am unsure about is whether to round here or for each\n # tax applied\n (amount * 20).ceil / 20.0\n end", "title": "" }, { "docid": "977b5fee46edf0814ffa125e8e200fb1", "score": "0.6305911", "text": "def total_tax\n basket.total_tax + shipment_tax_value\n end", "title": "" }, { "docid": "f46bd5cbff299d97f46dc8c2e3d62091", "score": "0.63032717", "text": "def add_tax_and_tip\n self.purchases.each do |purchase|\n purchase.items.each do |item|\n amnt = item.amount*(1.08)\n item.update(amount: (amnt + amnt/1.08*(self.tip.to_f*0.01)).round(2))\n end\n end\n end", "title": "" }, { "docid": "47b8aeb5a7446cb57620f6af60bffac4", "score": "0.6302201", "text": "def calculate_tax_price\n tax = 13 * self.calculate_subtotal_price / 100\n return tax # Returns float\n end", "title": "" }, { "docid": "16080cedb9da3f0c0c521da00e5cee65", "score": "0.6295003", "text": "def tax25_sum\n tax_sum(tax25, 0.25)\n end", "title": "" }, { "docid": "16080cedb9da3f0c0c521da00e5cee65", "score": "0.6295003", "text": "def tax25_sum\n tax_sum(tax25, 0.25)\n end", "title": "" }, { "docid": "3ad7d4e80e5b1438b5d1ee9127fd0ebf", "score": "0.62898344", "text": "def tax_amount\n self.taxes.values.reduce(0, :+)\n end", "title": "" }, { "docid": "079b99300b65f668df256e45c8cacb9f", "score": "0.62772363", "text": "def calculate_total_1(price, tip, tax)\n tax_amount = price * tax\n tip_amount = price * tip\n price + tip_amount + tax_amount\nend", "title": "" }, { "docid": "74b2cbb8ff1e4205abb8393e6f9b8a6f", "score": "0.6274428", "text": "def rrp_exc_sales_tax\n price_get(1).try(:price_amount)\n end", "title": "" }, { "docid": "b02e1132fd9c64ef92cab4802cd8990b", "score": "0.627423", "text": "def invoice_tax\n if address.present?\n self.invoice_tax_amount, self.tax_description = address.invoice_tax(invoice_items_amount)\n else\n self.invoice_tax_amount = 0\n end\n self.invoice_tax_amount\n end", "title": "" }, { "docid": "a8f868dd850c6645903e6a363e8830f9", "score": "0.62711334", "text": "def orig_tax_due\n from_pence_advantageous_round(\n (to_pence(@orig_calculated) + to_pence(@orig_ads_due) + to_pence(@orig_npv_tax_due) +\n to_pence(@orig_premium_tax_due)) -\n (to_pence(@orig_total_reliefs) + to_pence(@orig_total_ads_reliefs))\n )\n end", "title": "" }, { "docid": "adf88e2e41de53fbe881a47e01779bd5", "score": "0.62631637", "text": "def total_tax=(value)\n end", "title": "" }, { "docid": "d77da7f072210240b41051ff9a14989e", "score": "0.62618077", "text": "def tax_rate\n Store::settings.tax_rate/100\n end", "title": "" }, { "docid": "ffe5c0669641067e01949818850cd572", "score": "0.62540364", "text": "def calculate_total_1(price, tip, tax)\n tax_amount = price * tax\n tip_amount = price * tip\n price + tip_amount + tax_amount\nend", "title": "" }, { "docid": "ffe5c0669641067e01949818850cd572", "score": "0.62540364", "text": "def calculate_total_1(price, tip, tax)\n tax_amount = price * tax\n tip_amount = price * tip\n price + tip_amount + tax_amount\nend", "title": "" }, { "docid": "2d90608ccaab92b10aa440f2ecc3c40e", "score": "0.62507427", "text": "def tax_advance_rate_level_one\n BigDecimal.new(0, 15)\n end", "title": "" }, { "docid": "1568fcf429703d984b587c677ff154f2", "score": "0.6248698", "text": "def calculateBalance\n \n self.accountBalance = self.amountPaid.to_f - amountWithTax\n \n end", "title": "" }, { "docid": "e7f8a37bc18f0f5c4f025a6cce3b199b", "score": "0.6245238", "text": "def tax\n price * 0.10\n end", "title": "" }, { "docid": "dba795f26eaa380b45c0f643ee840a23", "score": "0.6238943", "text": "def tax_calculations\n\n ##If both sales_tax and import_tax apply\n ##then multiply the item's price by 1.15\n if (@sales_tax == \"true\") && (@import_tax == \"true\")\n @total_tax = @price * 0.15\n ##If neither sales_tax nor import_tax apply\n ##then print the item's original price\n elsif (@sales_tax == \"false\") && (@import_tax == \"false\")\n @price\n ##If ONLY the sales_tax applies, then multiply the item's\n ##price by 1.10\n elsif (@sales_tax == \"true\" && @import_tax == \"false\")\n @total_tax = (@price * 0.10).round(2)\n ##If ONLY the import_tax applies, then multiply the item's\n ##price by 1.05\n elsif (@sales_tax == \"false\") && (@import_tax == \"true\")\n @total_tax = (@price * 0.05)\n end\n end", "title": "" }, { "docid": "8c2edb6b6f83f7841d154f83d8cca226", "score": "0.6238113", "text": "def tax_calc\n tax = @quantity * @unit_price * @tax_rate\n end", "title": "" }, { "docid": "7c46c5561164d28674e945a9e683b5d5", "score": "0.62378603", "text": "def total_amount_after_discount\n spend_amount_after_discount + @tip_returned_from_levelup\n end", "title": "" }, { "docid": "0b74e4dadca0f72a4a0f2cb1d33624c4", "score": "0.62308365", "text": "def total\n total = price + tax\n end", "title": "" }, { "docid": "466153ba3fed31a28b109a0065fae779", "score": "0.62253386", "text": "def pre_tax_total\n pre_tax_item_amount + shipments.sum(:pre_tax_amount)\n end", "title": "" }, { "docid": "2652652d70c77c28c8fa82cdded2c68d", "score": "0.6223186", "text": "def import_tax\n (\"#{@price}\").to_i * 0.15 + (\"#{@price}\").to_i\n end", "title": "" }, { "docid": "46ad4694c04a6e7b958e1dd577814bac", "score": "0.6222558", "text": "def update_tax_calculations\n process_tax_calculation\n end", "title": "" }, { "docid": "69195f308ff5f5553191996d7b63d65b", "score": "0.6210156", "text": "def total_tax\n @total_tax || line_items.inject(BigDecimal.new('0')) { | sum, line_item | sum + BigDecimal.new(line_item.tax_amount.to_s) }\n end", "title": "" }, { "docid": "97182c3d686bbde8c7f79b93cc013e77", "score": "0.6208163", "text": "def apply_tax(amount, options = {})\n opts = {}.merge(options)\n amount = amount.to_d\n tax2_is_enabled = tax2_enabled.to_i == 1\n tax3_is_enabled = tax3_enabled.to_i == 1\n tax4_is_enabled = tax4_enabled.to_i == 1\n\n\n if self.compound_tax.to_i == 1\n if opts[:precision]\n amount += format(\"%.#{opts[:precision].to_i}f\", (amount* tax1_value/100.0)).to_d\n amount += format(\"%.#{opts[:precision].to_i}f\", (amount* tax2_value/100.0)).to_d if tax2_is_enabled\n amount += format(\"%.#{opts[:precision].to_i}f\", (amount* tax3_value/100.0)).to_d if tax3_is_enabled\n amount += format(\"%.#{opts[:precision].to_i}f\", (amount* tax4_value/100.0)).to_d if tax4_is_enabled\n else\n amount += (amount* tax1_value/100.0)\n amount += (amount* tax2_value/100.0) if tax2_is_enabled\n amount += (amount* tax3_value/100.0) if tax3_is_enabled\n amount += (amount* tax4_value/100.0) if tax4_is_enabled\n end\n else\n tax = 0\n\n if opts[:precision]\n tax += format(\"%.#{opts[:precision].to_i}f\", (amount* tax1_value/100.0)).to_d\n tax += format(\"%.#{opts[:precision].to_i}f\", (amount* tax2_value/100.0)).to_d if tax2_is_enabled\n tax += format(\"%.#{opts[:precision].to_i}f\", (amount* tax3_value/100.0)).to_d if tax3_is_enabled\n tax += format(\"%.#{opts[:precision].to_i}f\", (amount* tax4_value/100.0)).to_d if tax4_is_enabled\n else\n tax += (amount* tax1_value/100.0)\n tax += (amount* tax2_value/100.0) if tax2_is_enabled\n tax += (amount* tax3_value/100.0) if tax3_is_enabled\n tax += (amount* tax4_value/100.0) if tax4_is_enabled\n end\n\n amount += tax\n end\n\n amount\n end", "title": "" }, { "docid": "a27000f6fde3f9af29dcb7b60bf8925d", "score": "0.6206525", "text": "def get_income_tax\n CALC.get_income_tax_amount(get_target_table, 100000)\n end", "title": "" }, { "docid": "bd05d2a842470d2454854bf55e55f730", "score": "0.62063074", "text": "def calculate_total\n total_price = @base_price + (@tax_rate * @base_price)\n return total_price\n end", "title": "" }, { "docid": "de7f04c220c451efd7c8624efa56ae3a", "score": "0.6205746", "text": "def total_with_grat( amount )\r\n amount + tip_amount( amount )\r\nend", "title": "" }, { "docid": "d72e14d6c693697d4a2390b611f2fed2", "score": "0.62008274", "text": "def group_tax_amt(account_id)\n self.tax_line_items.where(:account_id => account_id).sum(:amount)\n end", "title": "" }, { "docid": "96e05d3419e4f68f0b940edf69aba624", "score": "0.6198161", "text": "def total_tax\n (doc/\"total-tax\").to_money\n end", "title": "" }, { "docid": "07c386ee4b7b0f4dcb9662d9cadf4df0", "score": "0.61896336", "text": "def calculate_tax(requested_by)\n additional_parameters = { PartyRef: requested_by.party_refno, Username: requested_by.username }\n\n call_ok?(:slft_calc, additional_parameters.merge!(request_calc)) do |body|\n @total_tax_due = body[:tax_payable][:tax_due]\n @total_credit = body[:tax_payable][:total_credits]\n @tax_payable = body[:tax_payable][:tax_liability]\n end\n end", "title": "" }, { "docid": "2a40c3a3f0e42968a5369f7709dfb598", "score": "0.61730295", "text": "def tax_breakdown\n global_tax_breakdown(offer_request_items, true)\n end", "title": "" }, { "docid": "493ef5f2163ba0f7e6970ba3cf9cc746", "score": "0.61653554", "text": "def tax\n price.to_f * 0.09\n end", "title": "" } ]
9468f6df306c48b31ce42f159c866351
Internal: If the node feeds energy into an aggregator, set the share of the edges entering the aggregator so that any deficit of demand from the producer will be met on the aggregator by its other input edge. production The total amount of energy output by the producer in MWh. For example [Producer] [Deficit] \ / [Aggregator] If the aggregator demands 50 but the producer only ends up supplying 25, the share of the P>A edge is set to 0.5 (50%). The edge between [Deficit] and [Aggregator] is expected to be a flexible and will supply the rest.
[ { "docid": "4c01ad4a20813da7d709a847c8e843d6", "score": "0.74898374", "text": "def inject_aggregator_attributes!(production)\n conv = @node.node\n\n return unless conv.groups.include?(:aggregator_producer)\n\n demand = participant.demand\n edge = conv.output(:useable_heat).edges.first\n\n edge.share = demand.positive? ? production / demand : 0.0\n end", "title": "" } ]
[ { "docid": "b3831601f1f3ba143aeab93092fb4dd2", "score": "0.6664484", "text": "def share\n edge = @node.node.output(:useable_heat).edges.first\n\n if edge.lft_node.key.to_s.include?('aggregator')\n edge.lft_node.output(:useable_heat).edges.first.share\n else\n edge.share\n end\n end", "title": "" }, { "docid": "71dec84a2fce55968a0d69be0d847ae2", "score": "0.64494944", "text": "def demanding_share(edge)\n return 0.0 if edge.loss?\n\n demanding_share = (edge.demand || 0.0) / (demand || 0.0)\n demanding_share.nan? || demanding_share.infinite? ? 0.0 : demanding_share\n end", "title": "" }, { "docid": "07f0e993e9cffb913b3913243125494d", "score": "0.5949706", "text": "def inject_demand!\n producer = participant.producer\n production = producer.output_curve.sum\n\n inject_aggregator_attributes!(production)\n\n # MWh -> MJ\n @node.demand = (production * 3600) / output_efficiency\n\n return unless production.positive?\n\n full_load_hours = production / total_value(:heat_output_capacity)\n\n @node[:full_load_hours] = full_load_hours\n @node[:full_load_seconds] = full_load_hours * 3600\n end", "title": "" }, { "docid": "89f27ad0af6b643009c43db920f298df", "score": "0.5776027", "text": "def child_share\n if get(:child_share)\n get(:child_share)\n elsif to.slots.in(label).edges.one?\n set(:child_share, 1.0)\n elsif demand && demand.zero?\n set(:child_share, 0.0)\n elsif to.demand && to.demand.zero?\n set(:child_share, 1.0)\n elsif demand && to.demand\n set(:child_share, demand / to.demand_for(label))\n end\n end", "title": "" }, { "docid": "108c5b87e036f720ac837cd94c506edd", "score": "0.5721358", "text": "def parent_demand_from_outputs(edge)\n Refinery::Util.strict_sum(edge.to.out_edges.select do |other|\n other.demand ||\n (other.get(:type) != :overflow || other.to == edge.from)\n end, &:demand)\n end", "title": "" }, { "docid": "9ca5d37dcee5e24bfa153214cfa49b24", "score": "0.5613765", "text": "def inject_dumped_energy_attributes!\n # If the output slot has two edges, one a share edge and one inversed\n # flexible, assume that unused energy is dumped through the flexible.\n # Adjust the share edge so that only energy actually emitted by the\n # storage flows.\n output_slot = @node.node.output(@context.carrier)\n\n return if !output_slot || output_slot.edges.length != 2\n\n share_edge = output_slot.edges.detect(&:share?)\n if_edge = output_slot.edges.detect(&:inversed_flexible?)\n\n return unless share_edge && if_edge\n\n total = target_api.demand * output_slot.conversion / 3600\n\n new_share =\n if total.zero?\n 0.0\n else\n @participant.load_curve.sum { |v| v.positive? ? v : 0.0 } / total\n end\n\n share_edge.dataset_set(:share, new_share)\n end", "title": "" }, { "docid": "ad432e3117b6eb805671c5a71b223f31", "score": "0.555585", "text": "def external_value\n edge_demand = edges.map(&:value).compact.sum.to_f\n\n if has_reversed_shares?\n edge_demand / reversed_share_compensation\n else\n edge_demand\n end\n end", "title": "" }, { "docid": "3370312196a6c32d959063dfce7f6561", "score": "0.55316377", "text": "def captured_bio_emissions_from_supplier(edge)\n if edge.demand.positive?\n edge.rgt_node.query.inherited_captured_bio_emissions *\n edge.parent_share * edge.rgt_output.conversion *\n edge.rgt_node.query.output_compensation_factor\n else\n # Don't recurse through any edge with no demand. There won't be any emissions from\n # this path, and we'll get caught in loops in the graph.\n 0.0\n end\n end", "title": "" }, { "docid": "9c658cd637812010d21fec134de7db5f", "score": "0.5493317", "text": "def share(recursing = false)\n if (explicit = get(:share)) then return explicit end\n\n slots = @node.slots.public_send(@direction)\n\n others = slots.reject do |slot|\n slot == self || slot.get(:type) == :elastic\n end\n\n if slots.one?\n set(:share, 1)\n elsif get(:type) == :elastic\n set(:share, 1 - others.sum(&:share)) if others.all?(&:share)\n elsif demand\n node_demand = @node.demand ||\n slots.all?(&:demand) && slots.sum(&:demand)\n\n if node_demand\n if node_demand.zero? && edges.all? { |e| e.get(:type) == :overflow }\n # Special-case for when a node demand is zero, and contains a slot\n # with \"normal\" links, and a slot with overflow links.\n set(:share, 0.0)\n elsif ! recursing && node_demand.zero? &&\n others.all? { |o| o.share(true) }\n # Opposite of the special case above.\n set(:share, 1.0 - others.sum(&:share))\n elsif ! node_demand.zero?\n set(:share, demand / node_demand)\n end\n end\n end\n end", "title": "" }, { "docid": "2e9b7eec03335b1e131802e54df4a2bc", "score": "0.5372626", "text": "def calculate\n @calculation_state = :calculate\n\n # Constant edges are treated differently.\n # They can overwrite the preset_demand of this node\n output_edges.select(&:constant?).each(&:calculate)\n\n # this is an attempt to solve this issue\n # https://github.com/dennisschoenmakers/etengine/issues/258\n input_edges.select(&:constant?).each(&:calculate) if output_edges.any?(&:inversed_flexible?)\n\n # If the demand is already set (is not nil), do not overwrite it.\n if self.demand.nil?\n self.demand ||= update_demand\n end # Demand is set\n @calculation_state = :calculating_after_update_demand\n\n # Now calculate the slots of this node\n slots.each(&:calculate)\n\n # inversed_flexible fills up the difference of the calculated input/output slot.\n output_edges.select(&:inversed_flexible?).each(&:calculate)\n end", "title": "" }, { "docid": "f6c496cabfde8d745cb513f33c17072c", "score": "0.53653985", "text": "def parent_demand(edge)\n super || parent_demand_from_outputs(edge)\n end", "title": "" }, { "docid": "42e0c3ecf932e1b108d2e6f2482e796e", "score": "0.5364309", "text": "def calculate(edge)\n calculated = super\n\n max_demand = edge.max_demand\n max_demand && max_demand < calculated ? max_demand : calculated\n end", "title": "" }, { "docid": "1a8e7c065463993161555f58565c45c3", "score": "0.5309975", "text": "def demand_driven_edges\n suitable_edges = demand_edges_for(node)\n\n if suitable_edges.any? && node.groups.include?(:aggregator_producer)\n return demand_edges_for(suitable_edges[0].lft_node)\n end\n\n suitable_edges\n end", "title": "" }, { "docid": "0433b28932aaf04348de6b038b2ca78b", "score": "0.52626324", "text": "def update_demand\n if output_edges.any?(&:inversed_flexible?) or output_edges.any?(&:reversed?)\n @calculation_state = :update_demand_if_inversed_flexible_or_reversed\n slots.map(&:internal_value).compact.max\n elsif output_edges.empty?\n @calculation_state = :update_demand_if_no_output_edges\n # 2010-06-23: If there is no output edges we take the highest value from input.\n # otherwise left dead end nodes don't get values\n inputs.map(&:internal_value).compact.max\n else\n @calculation_state = :update_demand\n # 2010-06-23: The normal case. Just take the highest value from outputs.\n # We did this to make the gas_extraction gas_import_export thing work\n outputs.map(&:internal_value).compact.max\n end\n end", "title": "" }, { "docid": "ac433b0bb80648b2764860d51e98a67f", "score": "0.52325416", "text": "def capacity_from_other_demand\n node = @context.graph.node(@config.output_capacity_from_demand_of)\n avg_load = node.demand / 8760 / 3600\n\n avg_load * @config.output_capacity_from_demand_share\n end", "title": "" }, { "docid": "fe51dfbc26c0a0b19fa7dffc2a27f717", "score": "0.51861626", "text": "def recursive_factor_without_losses(\n strategy_method,\n node_share_method = nil,\n edge = nil,\n *args,\n include_abroad: false,\n value_type: :factor\n )\n if (!include_abroad && abroad?) || recursive_factor_ignore?\n 0.0\n elsif (return_value = send(strategy_method, edge, *args)) != nil\n return_value\n else\n val = input_edges.map do |edge|\n parent = edge.rgt_node.query\n\n # Exception 1:\n #\n # When import and local production of a carrier is 0 we still need a\n # share of 1, otherwise the costs for fuel will always be 0.\n #\n # Exception 2:\n #\n # If the demand for a node is zero, certain edges are assigned a\n # nil share. If a slot has two edges with nil share, we have to assign\n # shares so they sum up to 1.0 (and not 2.0, if we just did\n # `edge.share || 1.0`, to fix exception 1).\n #\n # Therefore we assign averages, just to make this calculation work.\n #\n # --(constant: share nil)-- [B] (method: 1.0)\n # /\n # slot(conversion: 1.0) <\n # \\\n # --(flexible: share nil)-- [C] (method: 1.0)\n #\n # # (conversion * edge_share * value)\n # (1.0 * 1.0 * 1.0) + (1.0 * 1.0 * 1.0)\n # # => 2.0!\n #\n # => This has been changed in Edge:\n # - flexible are assigned share of 1.0 if nil\n # - constant are assigned share of 0.0 if nil\n #\n edge_share = edge.share\n\n if edge_share.nil?\n # Following code would make sure that combined edge_shares would not\n # be higher than 1.0:\n #\n # total_edge_shares = valid_edges.map(&:share).compact.sum\n # edge_share = (1.0 - total_edge_shares) / valid_edges.length\n edge_share = 1.0\n end\n\n if edge_share.zero?\n # If the share is 0.0 there is no point in continuing with the\n # calculation for this edge, as any result would be multiplied by\n # zero.\n 0.0\n else\n # We have to multiply the share with the conversion of the\n # corresponding slot to deal with following scenario:\n #\n # +---o slot(0.9) <--(1.0)-- [B] (method: 100)\n # | A |\n # +---o slot(0.1) <--(1.0)-- [C] (method: 80)\n #\n # [A] should then be: (0.9 * 1.0 * 100) + (0.1 * 1.0 * 80)\n input = self.input(edge.carrier)\n\n parent_conversion = input&.conversion || 1.0\n\n # Recurse to the parent...\n parent_value = parent.recursive_factor_without_losses(\n strategy_method, node_share_method, edge, *args,\n include_abroad: include_abroad,\n value_type: value_type\n )\n\n edge_share * parent_value * parent_conversion *\n (value_type == :value ? input_compensation_factor : 1.0)\n end\n end\n\n val.sum\n end\n end", "title": "" }, { "docid": "a100c9b76b020e3a67bc7fd204d2bda1", "score": "0.5150905", "text": "def production\n return @production if @production\n\n suppliers =\n @group.adapters.reject do |adapter|\n adapter.participant.is_a?(Fever::Consumer)\n end\n\n return [0.0] * 8760 if suppliers.none?\n\n curves =\n suppliers.map do |adapter|\n input = adapter.node.heat_input_curve\n output = adapter.node.heat_output_curve\n\n # Array may be empty, which means there is no curve.\n if input.first\n # In order to represent heat being produced - but stored for\n # future use - the production curve takes the maximum of the input\n # and output of each producer. This means that energy in a reserve\n # is accounted for twice. Skip this when the input and output\n # curves are the same object.\n input.map.with_index do |val, index|\n val > output[index] ? val : output[index]\n end\n else\n output.first ? output : nil\n end\n end.compact\n\n @production = Merit::CurveTools.add_curves(curves).to_a\n end", "title": "" }, { "docid": "7a577c9d5fec558f75c3f04007e63b25", "score": "0.5118647", "text": "def initialize(producer, share: 1.0)\n @producer = producer\n @share = share\n @demand = 0.0\n end", "title": "" }, { "docid": "0351f524648066de4333c8e615a0866f", "score": "0.5115747", "text": "def payout_per_share(entity, revenue)\n revenue % 10 == 5 ? revenue / 10.0 : super\n end", "title": "" }, { "docid": "e0fb67c8d3232b2c7fee759922aa80ed", "score": "0.51013273", "text": "def parent_share\n if get(:parent_share)\n get(:parent_share)\n elsif from.slots.out(label).edges.one?\n set(:parent_share, 1.0)\n elsif demand && demand.zero?\n set(:parent_share, 0.0)\n elsif demand && from.demand &&\n from.slots.out(label).share &&\n ! from.output_of(label).zero?\n set(:parent_share, demand / from.output_of(label))\n end\n end", "title": "" }, { "docid": "a7651ebc55716cc7d48f3d8fa1c7ef9c", "score": "0.50781816", "text": "def demand\n demands = edges.map(&:demand)\n (demands.all? && demands.sum) || nil\n end", "title": "" }, { "docid": "6e507704c8c6b93de149a43280591def", "score": "0.50481015", "text": "def node_demand\n if @node.demand.nil? && @node.query.number_of_units.zero?\n # Demand may be nil if it is set by Fever, and the producer has no\n # installed units (therefore was omitted from the calculation).\n 0.0\n else\n @node.demand\n end\n end", "title": "" }, { "docid": "154f968ae184dec4528e054d7de9a33f", "score": "0.5048038", "text": "def calculate\n # 2010-06-07 sb\n # I don't remember why I don't use active_edges here.\n # I assume it must be because of inversed_flexible?\n # and [constant with undefined value].\n\n if input?\n active_edges.select(&:constant?).each(&:calculate)\n active_edges.select(&:share?).each(&:calculate)\n\n active_edges.\n select(&:flexible?).\n # Sort by priority, higher numbers first.\n sort_by(&:priority).reverse.\n # Calculate edges with a max_demand first\n partition { |edge| edge.max_demand.present? }.\n flatten.each(&:calculate)\n end\n\n if output?\n edges.select(&:reversed?).each(&:calculate)\n edges.select(&:dependent?).each(&:calculate)\n end\n end", "title": "" }, { "docid": "fdd5a63498c922aa20678dde01a092f7", "score": "0.5044702", "text": "def share\n node.in_slots.map do |slot|\n slot.share * node.output[carrier][slot.carrier]\n end.sum\n end", "title": "" }, { "docid": "60698fe2ee06e78622c87ed1096a78a4", "score": "0.5032536", "text": "def reversed_share_compensation\n comp_share = edges.reduce(0.0) do |comp, edge|\n if edge.reversed? && edge.edge_type == :share && edge.value.nil?\n comp + edge.share\n else\n comp\n end\n end\n\n comp_share >= 1.0 ? 1.0 : 1.0 - comp_share\n end", "title": "" }, { "docid": "f2ad00802fd82ab2ebc42ee4396891a1", "score": "0.50145763", "text": "def appraise_node(node)\n circular_routes, terminal_routes = appraise_node_routes(node)\n ChaosDetector::GraphTheory::NodeMetrics.new(\n node,\n afference: @graph.edges.count { |e| e.dep_node == node },\n efference: @graph.edges.count { |e| e.src_node == node },\n circular_routes: circular_routes,\n terminal_routes: terminal_routes\n )\n end", "title": "" }, { "docid": "8f692322ea58794fc77ba40f9c2ce031", "score": "0.50125414", "text": "def demand\n return @demand if @demand\n\n suppliers =\n @group.adapters.select do |adapter|\n adapter.installed? && adapter.participant.is_a?(Fever::Consumer)\n end\n\n return [0.0] * 8760 if suppliers.none?\n\n @demand = Merit::CurveTools.add_curves(suppliers.map do |adapter|\n adapter.node.heat_input_curve\n end).to_a\n end", "title": "" }, { "docid": "d3355ce2cd7fe6b9df3601b567b14b9e", "score": "0.49796274", "text": "def adjust_energy( amt = nil )\n amt ||= energy_earned\n\n self.energy += amt\t \n self.energy = self.energy_max if self.energy > self.energy_max\n self.energy = 0 if self.energy < 0 \n\n self.last_energy_at = Time.now.utc unless amt.nil?\n\tend", "title": "" }, { "docid": "0076cf0f5d4439a00d5876c4068d0d35", "score": "0.49752966", "text": "def factor_for_primary_demand(stop_condition = :primary_energy_demand?)\n # If the stop condition is satisfied, return the output share of the node minus loss. Losses\n # should not be included in the share from the primary demand node itself, see\n # https://github.com/quintel/etengine/issues/1147.\n #\n # Nodes that do not met the stop condition are at the far-right of the graph.\n public_send(stop_condition) ? 1.0 - loss_output_conversion : 0.0\n end", "title": "" }, { "docid": "105f46efca9290153cfef61a0799bc94", "score": "0.49325645", "text": "def run\n Etsource::Molecules.from_energy_keys.each do |node_key|\n molecule_node = @molecule_graph.node(node_key)\n conversion = molecule_node.from_energy\n energy_node = @energy_graph.node(conversion.source)\n\n molecule_node.demand = Connection.demand(energy_node, conversion)\n end\n\n @molecule_graph.calculate\n @molecule_graph\n end", "title": "" }, { "docid": "2a3727e9d2af55650b670a90cad33788", "score": "0.49155015", "text": "def mutate\n #for the time being we won't take on\n #the ability to mutate the number of\n #nodes and their configuration\n #focussing instead on simple node weight mutation\n \n #first we mutate sigma\n @sigma = @sigma * Math.exp(@tau * gaussian_random)\n @network.each do |tier|\n tier.each do |node|\n node.sigma = @sigma\n node.mutate\n end\n end\n self\n end", "title": "" }, { "docid": "c4d76da9a7c4112b349d1e0cde889183", "score": "0.48213628", "text": "def share_value(price, shares)\n\t\tprice * shares\n\tend", "title": "" }, { "docid": "588c4ac5bad23c336b4b4acfb26e6020", "score": "0.4818494", "text": "def edge_properties(r_edge)\n props = r_edge.properties.except(:demand, :share)\n props[:value] = r_edge.demand.to_f\n\n if r_edge.get(:type) == :share\n props[:share] = (r_edge.get(:reversed) ? r_edge.parent_share : r_edge.child_share).to_f\n end\n\n props\n end", "title": "" }, { "docid": "c06a54a2a73ac245aa1c69fb4260cff8", "score": "0.4811966", "text": "def spread_contamination_decrease(value, node)\n # yes this will again reduce the value in the original node\n value *= DECREASE_SPREAD_REDUCE_FACTOR\n if value >= DECREASE_TO_SPREAD\n node.adjacent_nodes.each do |node|\n decrease_contamination(value, node) if node.rumors[self]\n end\n end\n end", "title": "" }, { "docid": "1b6d7a6303145de83bf6b6b6fed11333", "score": "0.47911945", "text": "def attach_edge!(edge)\n #TODO use argument (edge) on the call to super and make sure tests still pass\n # that way it's clearer that it is being passed on to super\n super\n resources_contributed.store(edge, Extras::Fifo.new)\n self\n end", "title": "" }, { "docid": "8cb300440152a2788922b6e36b3f880a", "score": "0.47820932", "text": "def max_demand(force_recurse = false)\n if get(:max_demand)\n get(:max_demand)\n elsif get(:type) == :flexible && get(:priority).nil?\n # A flexible edge with no priority is not a flex-max edge, and therefore\n # could provide all of the demand.\n set(:max_demand, Float::INFINITY)\n else\n parent_max_demand = from.max_demand(force_recurse)\n\n if parent_max_demand == Float::INFINITY\n # When the parent has no maximum demand, then this node must also have\n # no maximum demand.\n set(:max_demand, Float::INFINITY)\n elsif parent_max_demand && (conversion = from.slots.out(label).share)\n set(:max_demand, parent_max_demand * conversion)\n end\n end\n end", "title": "" }, { "docid": "33d846f1a02473ee6201e087322fd6e4", "score": "0.4773182", "text": "def modularity_gain node, community\n nb_links_to_comm = (get_number_of_links node, community) || 0\n #puts \"node #{node}, comm #{community.id}\"\n #puts \"####################{nb_links_to_comm}\"\n\n tot = community.tot\n deg = @adj_list[node].values.inject(0,:+)\n m2 = @total_weight\n\n # copied from the cpp code\n return nb_links_to_comm.to_f - tot*deg.to_f/m2\n end", "title": "" }, { "docid": "a22137d16753033c197a63784dbb521c", "score": "0.47658402", "text": "def calculate!(order)\n super\n\n @model.set(:demand, [\n # Disallow the calculated value from exceeding the demand specified\n # by the node -- assuming we already know what that demand is.\n strategy.calculate(@model),\n @model.to.demand_for(@model.label),\n @model.from.output_of(@model.label)\n ].compact.min)\n end", "title": "" }, { "docid": "83bc25371194dba918a59e1bdb214a0f", "score": "0.47612375", "text": "def priority_p_set_assoc_energy_usage(assoc)\n# \tchar *child;\n# \tchar *child_str;\n\n\tif (assoc != $assoc_mgr_root_assoc)\n\t\tchild = \"user\";\n\t\tchild_str = assoc.name;\n\telse\n\t\tchild = \"account\";\n\t\tchild_str = assoc.name;\n\tend\n\n\tif ($assoc_mgr_root_assoc.usage_usage_energy_raw != 0)\n\t\tassoc.usage_usage_energy_norm = assoc.usage_usage_energy_raw / $assoc_mgr_root_assoc.usage_usage_energy_raw;\n\telse\n# \t\t/* This should only happen when no usage has occured\n# \t\t * at all so no big deal, the other usage should be 0\n# \t\t * as well here. */\n\t\tassoc.usage_usage_energy_norm = 0;\n\tend\n\n\tdebug(\"Normalized Energy usage for %s %s off %s %Lf / %Lf = %Lf\\n\",\n\t\t child, child_str, assoc.parent_assoc_ptr.acct,\n\t\t assoc.usage_usage_energy_raw,\n\t\t $assoc_mgr_root_assoc.usage_usage_energy_raw,\n\t\t assoc.usage_usage_energy_norm);\n \n# \t/* This is needed in case someone changes the half-life on the\n# \t * fly and now we have used more time than is available under\n# \t * the new config */\n\tif (assoc.usage_usage_energy_norm > 1.0)\n\t\tassoc.usage_usage_energy_norm = 1.0;\n\tend\n\t\n\tif (assoc.parent_assoc_ptr == $assoc_mgr_root_assoc)\n\t\tassoc.usage_usage_energy_efctv = assoc.usage_usage_energy_norm;\n\t\tdebug(\"Effective energy usage for %s %s off %s %Lf %Lf\\n\",\n\t\t\t child, child_str,\n\t\t\t assoc.parent_assoc_ptr.acct,\n\t\t\t assoc.usage_usage_energy_efctv,\n\t\t\t assoc.usage_usage_energy_norm);\n\telse\n\t\tif assoc.shares_raw == SLURMDB_FS_USE_PARENT\n\t\t\ttemp = 0\n\t\telse\n# \t\t\ttemp = (assoc.shares_raw / (long double)assoc.usage_level_shares)\n\t\t\ttemp = (assoc.shares_raw / assoc.usage_level_shares)\n\t\tend\n\t\tassoc.usage_usage_energy_efctv = assoc.usage_usage_energy_norm +\n\t\t\t((assoc.parent_assoc_ptr.usage_usage_energy_efctv -\n\t\t\t assoc.usage_usage_energy_norm) *\n\t\t\t (temp));\n\t\tdebug(\"Effective energy usage for %s %s off %s %Lf + ((%Lf - %Lf) * %d / %d) = %Lf\\n\",\n\t\t\t child, child_str,\n\t\t\t assoc.parent_assoc_ptr.acct,\n\t\t\t assoc.usage_usage_energy_norm,\n\t\t\t assoc.parent_assoc_ptr.usage_usage_energy_efctv,\n\t\t\t assoc.usage_usage_energy_norm,\n\t\t\t ( (assoc.shares_raw == SLURMDB_FS_USE_PARENT) ? 0 : assoc.shares_raw),\n\t\t\t assoc.usage_level_shares,\n\t\t\t assoc.usage_usage_energy_efctv);\n\tend\nend", "title": "" }, { "docid": "e049a564223eeb073d1506c15a2dd597", "score": "0.4742833", "text": "def setup\n @long_edge = Edge.new('', 5000)\n @short_edge = Edge.new('', 300)\n end", "title": "" }, { "docid": "fa51a24e55731163b83035300dcf53a4", "score": "0.47421002", "text": "def demand_value(group_name)\n group_producers(group_name).sum do |producer|\n # We use demand * conversion because output_of_electricity requires a\n # calculated graph, which is not always the case when computing\n # time-resolved loads.\n producer.demand * producer.node_api.electricity_input_conversion\n end\n end", "title": "" }, { "docid": "0397d6055b9f77b27438f7e9ad11c747", "score": "0.4722684", "text": "def redistribute!\n @ideal = registry.size < 1 ? 0 : max_in_flight / registry.size\n debug \"Distribution calculated ideal: #{ideal}\"\n if(less_than_ideal?)\n registry.each do |connection, reg_info|\n reg_info[:ready] = 0\n end\n max_in_flight.times do\n less_than_ideal_ready!\n end\n connections.each do |connection|\n set_ready_for(connection, :force)\n end\n watch_dog.cancel if watch_dog\n @watch_dog = every(watch_dog_interval) do\n force_unready\n end\n else\n if(watch_dog)\n watch_dog.cancel\n @watch_dog = nil\n end\n connections.each do |connection|\n current_ready = ready_for(connection)\n calculate_ready!(connection)\n unless(current_ready == ready_for(connection))\n debug \"Redistribution ready setting update for connection #{connection}\"\n set_ready_for(connection)\n end\n end\n end\n end", "title": "" }, { "docid": "b9fe4706800d8ec4c674427df874ba2f", "score": "0.47187033", "text": "def distribution=(value)\n @distribution = value\n end", "title": "" }, { "docid": "7d02aaa37912f62f1b8480d5ded16562", "score": "0.47099057", "text": "def energy_cost=(energy)\n @energy_cost= [0, energy].max\n end", "title": "" }, { "docid": "9c070c394a931ee8645b41b0061f9578", "score": "0.470295", "text": "def sustainability_share\n fetch(:sustainability_share, false) do\n recursive_factor_without_losses(:sustainability_share_factor, value_type: :value)\n end\n end", "title": "" }, { "docid": "9ce74f72ef4c71f3f176cf6746d8f95a", "score": "0.4688473", "text": "def weight\n @weight + @edges.weight\n end", "title": "" }, { "docid": "7edf639e29bd8742bad24aba9ef92ae5", "score": "0.4683233", "text": "def multi_edge_entry_publish_test(theme_name, new_theme)\n spacings = ['margin', 'padding', 'border']\n edges = ['top', 'bottom', 'left', 'right']\n elements = ['div#header-region']\n elements.each do |element|\n css_spacings = Hash.new\n ThemeBuilder.ensure_open_and_close_tb(@browser) do |themer|\n themer.open_theme('Gardens', new_theme)\n themer.switch_tab('Styles')\n themer.click_in_tab('Spacing')\n themer.select_element(element, :css)\n spacings.each do |spacing|\n edges.each do |edge|\n edge_sel = edge_prop = \"#{spacing}-#{edge}#{'-width' if spacing == 'border'}\".gsub(\"NIL\",\"\")\n type_width = (self.rand_width*100).to_i\n themer.type_text(edge_sel, type_width.to_s)\n set_spacing_size = themer.read_input(edge_sel)\n css_spacings[edge_prop] = set_spacing_size\n end\n end\n themer.publish_theme(theme_name)\n end\n css_spacings.each_pair{|prop, set_size|\n res = ThemeBuilder.read_css_property(@browser, element, prop)\n effective_spacing_size = /(.*)[a-z][a-z]/.match(res)[1]\n #, \"The effective spacing size on the HTML #{effective_spacing_size} and the size from the entry #{set_size} do not match for element #{element}\")\n set_size.should == effective_spacing_size\n }\n end\n end", "title": "" }, { "docid": "1ab196a477357cf1825ef7beb2df7879", "score": "0.46779406", "text": "def delivery_calculation\n self.calculation = 500 + (self.distance * (self.length + self.width + self.height + self.common_weight))\n end", "title": "" }, { "docid": "ec5f395a1938958cc3bc932f6aba33ba", "score": "0.465919", "text": "def demand_value(group_name)\n group = fever_group(group_name)\n\n return 0.0 unless group\n\n group.adapters_by_type[:producer].sum do |adapt|\n adapt.node.input_of_electricity\n end\n end", "title": "" }, { "docid": "3a796e491c92cd1b6b56bea9c779028b", "score": "0.4655068", "text": "def deliver(start_address, end_address)\n #get the quota for the delivery\n goal = quota\n #haven't attempted stretch assignment yet\n deliveries = end_address - start_address\n #log deliveries as experience\n @experience += deliveries\n #if deliveries reached quota then calculate earnings\n if deliveries >= goal\n @earnings += (deliveries-goal)*0.50\n @earnings += goal*0.25\n #if deliveries didn't reach quote calculate earnings and deduct $2\n else\n @earnings += deliveries*0.25\n @earnings -= 2\n end\n end", "title": "" }, { "docid": "9a68235de4deb07f0f9d2eafc1a24541", "score": "0.4654088", "text": "def redistribute!\n @ideal = registry.size < 1 ? 0 : max_in_flight / registry.size\n debug \"Distribution calculated ideal: #{ideal}\"\n if(less_than_ideal?)\n registry.each do |connection_id, reg_info|\n reg_info[:ready] = 0\n end\n max_in_flight.times do\n less_than_ideal_ready!\n end\n connections.each do |connection|\n set_ready_for(connection, :force)\n end\n watch_dog.cancel if watch_dog\n @watch_dog = every(watch_dog_interval) do\n force_unready\n end\n else\n if(watch_dog)\n watch_dog.cancel\n @watch_dog = nil\n end\n connections.each do |connection|\n current_ready = ready_for(connection.identifier)\n calculate_ready!(connection.identifier)\n unless(current_ready == ready_for(connection.identifier))\n debug \"Redistribution ready setting update for connection #{connection}\"\n set_ready_for(connection)\n end\n end\n end\n end", "title": "" }, { "docid": "792bad776656982ca3df8d8b7c8173c1", "score": "0.46514085", "text": "def distribution=(value)\n @distribution = value\n end", "title": "" }, { "docid": "f0a61329d05040a536a1eb72139a30c4", "score": "0.46431118", "text": "def edge=(value); end", "title": "" }, { "docid": "e4a3e7fa2d2974837dbecc1c9d9260a5", "score": "0.46293703", "text": "def consume=(new_consume)\n @consume = new_consume\n end", "title": "" }, { "docid": "be3a52e0561ec3421846631b65db0ada", "score": "0.46168792", "text": "def production_cost\n transformation.value_of_yielded_item(reagent.item) * quantity\n end", "title": "" }, { "docid": "afd8c8e9fa42c35efff4436c8913f550", "score": "0.4601541", "text": "def maximize_energy\n @@energy_level = 1000\n end", "title": "" }, { "docid": "b8986e02f023b17fba926cf1410275e2", "score": "0.45990127", "text": "def grow\n\t\tif @energy<@@maxSize\n\t\t\tstepGrowth=@@logisticRate*@energy*( (@@maxSize-@energy) / @@maxSize )\n\t\t\tif @energy+stepGrowth <= @@maxSize\n\t\t\t\t@energy=@energy+stepGrowth\n\t\t\telse\n\t\t\t\t@energy=@@maxSize\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "3a1bda975abea1355aa1a27649541bef", "score": "0.45893165", "text": "def e(other)\n @e[other] ||= 1 / (1 + Math.exp(-other.g * (mean - other.mean)))\n end", "title": "" }, { "docid": "d89ba7528d36a0e8fc51f95eb44acb38", "score": "0.45777294", "text": "def have_child_share\n have_calculated_value(:child_share)\n end", "title": "" }, { "docid": "706527994679c9d09121526e0c431563", "score": "0.4565523", "text": "def edge_type(r_edge)\n r_edge.get(:type) == :overflow ? :inversed_flexible : r_edge.get(:type) || :share\n end", "title": "" }, { "docid": "fbd4498e15193417ff70ada9ab58ecca", "score": "0.4556741", "text": "def stored_energy=(amt)\n return if (@officer.cop or @officer.scop)\n @stored_energy = amt\n @stored_energy = @officer.scop_rate if @stored_energy >= @officer.scop_rate\n @stored_energy = 0 if @stored_energy < 0\n end", "title": "" }, { "docid": "ee0840aaaafb69708f4ef9b05f7364d9", "score": "0.45505825", "text": "def how_high\n energy * energy # attempting to multiply two undefined variables\nend", "title": "" }, { "docid": "d199930660b1461cc8aceca23affb724", "score": "0.45422357", "text": "def outbound_average_linkshare=(value)\n @outbound_average_linkshare = value\n end", "title": "" }, { "docid": "abdb56dc4e53c35044792f9a3513b78e", "score": "0.45275936", "text": "def edgeuses\n end", "title": "" }, { "docid": "c7e98ec3e95f92a8c03c2381c031e314", "score": "0.45136455", "text": "def distribution\n @queues\n end", "title": "" }, { "docid": "136fb8e439c087fbc77508a851c8d80e", "score": "0.45105422", "text": "def do_production(world)\n cs = self.consumes\n cs.each do |commodity, quantity|\n item = owner.consume(commodity, quantity, world)\n @production = (item[:fulfilled].to_f / quantity.to_f).floor.to_i\n @running_cost += item[:price]\n end\n end", "title": "" }, { "docid": "9badbde2614e58604bde0f12e6f3b4b1", "score": "0.44990534", "text": "def how_high\n energy * energy\nend", "title": "" }, { "docid": "9badbde2614e58604bde0f12e6f3b4b1", "score": "0.44990534", "text": "def how_high\n energy * energy\nend", "title": "" }, { "docid": "5445829eacf3c413c91f8678f5eb3828", "score": "0.4498074", "text": "def set_mining_message(destination, fees)\n fees = BigDecimal(0) if fees.nil?\n\n @message = {\n \"type\" => \"mining_reward\",\n \"destination\" => destination,\n \"amount\" => (fees + 1).to_s(\"F\"),\n }\n end", "title": "" }, { "docid": "31b6924c388d2d646c00fefc00cca6a1", "score": "0.44955102", "text": "def maximize_energy\n energy_level = 1000\n end", "title": "" }, { "docid": "370479bbbecdd32b7d58f662facd39a5", "score": "0.44896072", "text": "def sellers_share\n price * (1 - seller.commission_rate)\n end", "title": "" }, { "docid": "7d7ae0c60c5012375cd7561f0181a317", "score": "0.448344", "text": "def weight=(value); end", "title": "" }, { "docid": "ab39aaa7dc9c5fff643a487ee592465b", "score": "0.44787833", "text": "def weight; end", "title": "" }, { "docid": "ab39aaa7dc9c5fff643a487ee592465b", "score": "0.44787833", "text": "def weight; end", "title": "" }, { "docid": "4be378ac7dc332f6a36cafcd5e98921c", "score": "0.44635695", "text": "def compute_aggregation_bis(dimension_or_usage, all_products)\n dimension_or_usage.compute_aggregation(all_products).each do |product_id, rating_01|\n product = get_product_by_id(product_id)\n product.set_value(dimension_or_usage.idurl, rating_01)\n product.save\n end\n puts \"aggregation computed for dimension #{dimension_or_usage.idurl}\"\n end", "title": "" }, { "docid": "f99752d4187541366bedff80f4d7fac1", "score": "0.4459653", "text": "def grade_using key\n\t\t\t# Put a list of \"concept - proposition - concept\" triplets on the side\n\t\t\tgenerate_listing\n\n\t\t\t# Count the number of distinct connections in the key for later.\n\t\t\tdistinct_connections = key.number_of_distinct_connections\n\n\t\t\t# Mark the special edges and keep track of the number of missing edges for grading later.\n\t\t\tmark_misplaced_and_extra_edges key\n\t\t\tmissing_edges = mark_missing_edges key\n\n\t\t\t# Put the legend on the map that will be output.\n\t\t\tgenerate_legend\n\n\t\t\t# Calculate the number of correct edges in the student map.\n\t\t\tcorrect = distinct_connections - missing_edges\n\n\t\t\t# In case someone foolishly turned in a map with no edges, handle the grade accordingly.\n\t\t\tif !(distinct_connections == 0)\n\t\t\t\tgrade = (correct.to_f/distinct_connections.to_f) * 100\n\t\t\telse\n\t\t\t\tif correct < 0\n\t\t\t\t\tgrade = 0\n\t\t\t\telse\n\t\t\t\t\tgrade = 100\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tgrade = grade.round\n\n\t\t\t# Put the grade in a node on the map.\n\t\t\tadd_grade_node grade.to_s\n\n\t\t\t# Put the grade to the console.\n\t\t\treturn grade.to_i\n\t\tend", "title": "" }, { "docid": "10b1bb8cef9b34d91e6c61ccdecf315f", "score": "0.4456003", "text": "def merge!(other)\n @reduction = ChaosDetector::GraphTheory::Reduction.combine(@reduction, other.reduction)\n self\n end", "title": "" }, { "docid": "5d21e7589981bd6f06b5a36f7532ef20", "score": "0.44556153", "text": "def simulate_upgrade_production_gains\n #returns potential new total production duration\n new_production_duration = compute_new_production_duration(@manager.current_upgrade_step)\n #computes the time we gained (diff between the current production time and potential new production time)\n duration_gains = Foobar.average_current_production_duration - new_production_duration\n # this gives us the value gained in terms of foobar ie : how much foobar does this duration gain represents\n individual_production_gains = duration_gains/Foobar.average_current_production_duration\n # if we multiply by the total bot count we have the gain in foobars\n global_production_gains = @manager.bot_count*individual_production_gains\n return global_production_gains\n end", "title": "" }, { "docid": "b59778c5e476817535af3c03201ffa62", "score": "0.44536373", "text": "def demand_curve\n @demand_curve ||= total_of([\n positive_only_curve(base_curve),\n @consumers,\n @flexibles.map { |flex| negative_only_curve(flex) }\n ].flatten)\n end", "title": "" }, { "docid": "8de52782c33612465225e5d094cfbbb0", "score": "0.44493228", "text": "def push_associated_modification!(edge)\n raise ActiveRecord::ActiveRecordError, 'ERROR: cannot modify our self in this way' if edge == self\n edge.do_not_perpetuate = true\n if edge.count == 0\n edge.destroy\n else\n edge.save!\n end\n end", "title": "" }, { "docid": "522b77cf4b6a48b9afcdacdd8aab0485", "score": "0.4448497", "text": "def push_aggregation(aggregation, data, output_queue)\n #puts \"> push_aggregation #{aggregation}\"\n\n if aggregation != nil && aggregation.length == 2\n aggname = aggregation[0]\n aggentry = aggregation[1]\n\n #puts\"inside aggregation #{aggentry}\"\n #test if have children\n if aggentry[\"buckets\"] != nil?\n puts \"has buckets\"\n aggentry[\"buckets\"].each do |bucket| \n puts \"treat bucket #{bucket}\"\n push_bucket(bucket, data, aggname, output_queue)\n end \n else\n puts \"no buckets\"\n end \n\n end\n end", "title": "" }, { "docid": "839f28c2e56cb71d75ab38163b26c904", "score": "0.4448164", "text": "def demand_of_bio_resources_including_abroad_of_carrier_factor(\n edge,\n carrier_key\n )\n return nil unless right_dead_end? || bio_resources_demand?\n\n edge ||= output_edges.first\n\n if edge && edge.carrier.key == carrier_key\n factor_for_primary_demand(:bio_resources_demand?)\n else\n 0.0\n end\n end", "title": "" }, { "docid": "0f6e9a6fe95df65447412bd513447bfb", "score": "0.4443364", "text": "def push_associated_modification!(edge)\n raise ActiveRecord::ActiveRecordError, 'Cannot modify ourself in this way' if edge == self\n edge.do_not_perpetuate = true\n if edge.count == 0\n edge.destroy\n else\n edge.save! unless edge.duplicate?\n end\n end", "title": "" }, { "docid": "fbea154ee3746122822e20c86dcb24d0", "score": "0.44386974", "text": "def weighted_fan_in\n @inverse.each_with_object({}) do |data, fan_in_hash|\n node = data.first\n other = data.last\n next if other.count.zero?\n weight = 0\n other.each do |neighbor|\n node_name = neighbor[:node]\n weight += @parallelism[node_name]\n end\n fan_in_hash[node] = weight / @parallelism[node].to_f\n end\n end", "title": "" }, { "docid": "fbea154ee3746122822e20c86dcb24d0", "score": "0.44386974", "text": "def weighted_fan_in\n @inverse.each_with_object({}) do |data, fan_in_hash|\n node = data.first\n other = data.last\n next if other.count.zero?\n weight = 0\n other.each do |neighbor|\n node_name = neighbor[:node]\n weight += @parallelism[node_name]\n end\n fan_in_hash[node] = weight / @parallelism[node].to_f\n end\n end", "title": "" }, { "docid": "d5c04aa9e9889f02a47b047cb9860af4", "score": "0.44360954", "text": "def external_passive_edge_value\n edges.reject(&:flexible?).map(&:value).compact.sum\n end", "title": "" }, { "docid": "18f20f5dfc2c90c0f97fabe3316dc856", "score": "0.44330862", "text": "def share_value\n return 0 if total_shares == 0\n loot_value / total_shares\n end", "title": "" }, { "docid": "a7b5e9e86be35ca50ae131d615414958", "score": "0.4432595", "text": "def produce()\n # produce = @map.return_production()\n # produce.each_key do |value|\n # # Previously this was cummulative which was ending up with\n # # one structure counting its value multiple times\n # # @values[value] = (produce[value] + @values[value])\n # @values[value] = produce[value]\n # end\n @values['money'] += (@values['income'] - @values['upkeep'])\n end", "title": "" }, { "docid": "eb1364b42501a5f5aa9ed6794a379814", "score": "0.44241032", "text": "def weight\n @graph.weight(source, target)\n end", "title": "" }, { "docid": "3ca10fc69cd202d34bbe777f6b191ef5", "score": "0.4418956", "text": "def eat amount\n\t\t@energy=@energy+amount\n\tend", "title": "" }, { "docid": "91d8988a877f8de43d0d2a28fc8cfe47", "score": "0.44174227", "text": "def mile_driven(mile_driven, gas_used)\n if gas_used == 0\n return 0.0\n end\n mile_driven/gas_used\nend", "title": "" }, { "docid": "04cc22233ba9723f19f49dd1f2f57e21", "score": "0.44160166", "text": "def deliver(start_address, end_address)\n q = quota\n\n paper_deliver = end_address - start_address + 1\n # puts \"experience: #{@experience}\"\n # puts \"paper deliver: \" + paper_deliver.to_s\n @experience += paper_deliver\n\n if paper_deliver >= q\n @earnings = q * 0.25 + ( paper_deliver - q ) * 0.5 + @earnings\n return q * 0.25 + ( paper_deliver - q ) * 0.5\n else\n @earnings = paper_deliver * 0.25 - 2 + @earnings\n return paper_deliver * 0.25 - 2\n end\n end", "title": "" }, { "docid": "fc4eaecfcc43cb0a34626f4b44bce7ff", "score": "0.4414237", "text": "def propagate\n curr_step = @network.get_curr_step\n @out_conns.each_key do |receiver|\n term = @out_conns[receiver] * (get_x(curr_step)-receiver.get_x(curr_step))\n receiver.input_sum_terms << term\n end\n end", "title": "" }, { "docid": "80f4064010a600299fa070a61ae1ed86", "score": "0.4407235", "text": "def share\n in? ? node.input[carrier] : node.output[carrier]\n end", "title": "" }, { "docid": "48137a1cc31cadc321696ae3ca551f2c", "score": "0.44032586", "text": "def even_share\n shared, unshared = participations.to_a.partition(&:shared?)\n\n # No even share if nobody shares\n return 0 if shared.empty?\n\n total = self.total\n # deduce fixed amounts if any\n total -= unshared.map(&:owed_total).sum\n total / shared.size\n end", "title": "" }, { "docid": "1907d6d48b61cc507b7c25ba61a43fc6", "score": "0.4402321", "text": "def set_protease_volumes(op, stock_conc)\n this_conc = protease_conc(op) * @plan_params[:protease_dilution_factor]\n prot_vol = @plan_params[:protease_working_qty][:qty] * this_conc / stock_conc\n buf_vol = @plan_params[:protease_working_qty][:qty] - prot_vol\n buf_vol = 0.0 if buf_vol.infinite?\n op.temporary[:treatment_qty] = prot_vol\n op.temporary[:buffer_qty] = buf_vol\n end", "title": "" }, { "docid": "7d57536d83e67c1e8ce977cf6a47a2ad", "score": "0.43962294", "text": "def book_value_per_share\n book_value / latest_eps.shares.to_f\n end", "title": "" }, { "docid": "5be34d9565fad66e1279d163a05869bc", "score": "0.43931475", "text": "def publisher_transfer_value attr_symbol\n self.real_value(attr_symbol)*Bid.publisher_participation\n end", "title": "" }, { "docid": "91a9878e75542724347f9bb5a015098e", "score": "0.43926057", "text": "def blue_dist_plus(award)\n #No specific logic at this time...\n # could add code to hardcode quality for BDP awards \n # award.quality = 80\n return award\nend", "title": "" }, { "docid": "dbe71ccdb32f5094e3487d575485bfce", "score": "0.4386246", "text": "def _apply_decay( decay_factor)\n\n# \t/* continue if decay_factor is 0 or 1 since that doesn't help\n# \t us at all. 1 means no decay and 0 will just zero\n# \t everything out so don't waste time doing it */\n\tif (decay_factor == 0)\n\t\treturn $SLURM_ERROR;\n\telsif (decay_factor == 1)\n\t\treturn $SLURM_SUCCESS;\n\tend\n\n# \t/* We want to do this to all associations including\n# \t root. All usage_raws are calculated from the bottom up.\n# \t*/\n\t\n\titr = list_iterator_create_assoc_mgr_association_list();\n\titr.each { |assoc|\n# puts \"decay\"+ assoc.usage_usage_raw.to_s + \" XX \"+ decay_factor.to_s;\n\t\tassoc.usage_usage_raw *= decay_factor;\n\t\tassoc.usage_usage_energy_raw *= decay_factor;\n# \t\tassoc.usage_grp_used_wall *= decay_factor;\n\t}\n\n# \tslurmdb_qos_rec_t *qos = NULL;\n# \titr = list_iterator_create(assoc_mgr_qos_list);\n# \twhile ((qos = list_next(itr))) {\n# \t\tqos.usage_usage_raw *= decay_factor;\n# \t\tqos.usage.grp_used_wall *= decay_factor;\n# \tend\n# \tlist_iterator_destroy(itr);\n\n\treturn $SLURM_SUCCESS;\nend", "title": "" } ]
3cc1b21d47742c260f85968202a6cca7
Input: + Create user without ldap setting id + password or password confirmation is not length enough Output: Failed to create
[ { "docid": "e8000827b48f128535a191862fcc68c3", "score": "0.6114847", "text": "def test_ut_t1_la_user_003\n User.delete_all()\n new_user = User.new(:account_name => ACCOUNT,\n :ldap_setting_id => nil,\n :password => \"abc\",\n :password_confirmation => \"abc\")\n assert !new_user.save\n end", "title": "" } ]
[ { "docid": "b2848a3525c35f57fb1564ab30c2e6d4", "score": "0.74856216", "text": "def create\n ldapPassword=File.open('config/password','r').first.split(\"\\n\")[0]\n auth = {:method=>:simple, :username=>\"cn=admin,dc=cws,dc=net\", :password=>ldapPassword}\n ldap=Net::LDAP.new(:host=>'ldap.cws.net', :port=>636, :auth=>auth, :encryption=>:simple_tls)\n \n #can we connect to the ldap server\n if ldap.bind\n treebase=\"ou=People,dc=cws,dc=net\"\n attrs=[\"uidNumber\"]\n filter = Net::LDAP::Filter.eq( \"uid\", \"*\" )\n \n #find next available uidNumber\n uidNumber='1'\n ldap.search(:base=>treebase, :attributes=>attrs,:filter=>filter) do |entry|\n if entry[:uidnumber][0].to_i > uidNumber.to_i\n uidNumber=entry[:uidnumber][0]\n end\n end\n\n #prepare our data for entry to ldap\n dn=\"uid=#{username},ou=People,dc=cws,dc=net\"\n attrs={ :uid=>username,\n :cn=>username,\n :objectClass=> ['account','posixAccount','top','shadowAccount'],\n :shadowMax => '99999',\n :shadowWarning => '7',\n :loginShell => '/bin/bash',\n :userPassword => password,\n :uidNumber => uidNumber,\n :gidNumber=> uidNumber,\n :homeDirectory=>homedir }\n\n #try to add new entry\n if ldap.add(:dn=>dn,:attributes=>attrs)\n true\n else\n ldaperror=ldap.get_operation_result\n errors.add \"ldap could not add user #{ldaperror}\",'ldap.add errors'\n errors.add attrs.to_s,'user_attributes'\n false\n end\n else\n ldaperror=ldap.get_operation_result\n errors.add \"ldap could not add user #{ldaperror}','ldap.add errors\"\n false\n end\n end", "title": "" }, { "docid": "4e6a8de261e60d4cbf4a1e64dd88352d", "score": "0.7060258", "text": "def create\n username = \"Endura\\\\#{params[:user][:email]}\"\n ldap = Net::LDAP.new \n ldap.host = \"192.168.1.37\"\n ldap.port = 389\n ldap.base = \"CN=Administrator,CN=Users,DC=endura,DC=enduraproducts,DC=com\"\n ldap.auth username, params[:user][:password]\n\n if ldap.bind\n @user = User.find_by_email(\"#{params[:user][:email]}@enduraproducts.com\")\n if @user.nil?\n flash[:error] = \"Username or Password is incorrect.\"\n redirect_to new_user_session_path\n elsif @user.terminated == true\n flash[:error] = \"This user has been terminated and cannot log into the system.\"\n redirect_to new_user_session_path\n else\n flash[:notice] = \"Welcome #{params[:user][:email]}!\"\n sign_in(:user, @user)\n redirect_to user_portal_index_path\n end\n else\n flash[:error] = \"#{ldap.get_operation_result.message}\"\n redirect_to new_user_session_path\n end\n #super\n end", "title": "" }, { "docid": "28c638bd8e7a8c0b781721ea4f739817", "score": "0.6967095", "text": "def test_ut_t1_la_ldap_020\n ldap_setting = create_ldap\n assert !ldap_setting.check_user_id(\"\")\n end", "title": "" }, { "docid": "6455860423d48290eb2dcfd266c6ad12", "score": "0.68610597", "text": "def test_ut_t1_la_user_018\n User.delete_all()\n LdapSetting.delete_all()\n ldap_setting = create_ldap_with_mail\n create_ldap_user(ACCOUNT,MAIL,ldap_setting.id)\n assert !User.authenticate(ACCOUNT,\"wrong pass\")\n end", "title": "" }, { "docid": "cb8b12132614a5655938a608237fca6d", "score": "0.6803763", "text": "def test_ut_t1_la_user_004\n User.delete_all()\n new_user = User.new(:account_name => ACCOUNT,\n :ldap_setting_id => nil,\n :password => \"longer than 10 char\",\n :password_confirmation => \"longer than 10 char\")\n assert !new_user.save\n end", "title": "" }, { "docid": "79961e8e6ec7066398fa3f6dbae48f2a", "score": "0.67817414", "text": "def create_user(ldap_setting_id = 0)\n User.create( :account_name => LOGIN,\n :email => \"angq@tsdv.com.vn\",\n :ldap_setting_id => ldap_setting_id)\n end", "title": "" }, { "docid": "9293aac6e4d11806661611b893fd5ec8", "score": "0.6779871", "text": "def test_ut_t1_la_user_017\n User.delete_all()\n LdapSetting.delete_all()\n ldap_setting = create_ldap_with_mail\n create_ldap_user(ACCOUNT,MAIL,ldap_setting.id)\n assert User.authenticate(ACCOUNT,PASS)\n end", "title": "" }, { "docid": "55802111f6ad50bc1df5053faa09ef91", "score": "0.67685", "text": "def test_ut_t1_la_ldap_029\n ldap_setting = create_ldap\n create_user(ldap_setting.id)\n assert_not_nil ldap_setting.users_in_use\n end", "title": "" }, { "docid": "23da2597825962c33a3fa9e07ac34c86", "score": "0.6768265", "text": "def test_ut_t1_la_user_022\n User.delete_all()\n LdapSetting.delete_all()\n ldap_setting = create_ldap_with_mail\n ldap_setting.in_use = false\n ldap_setting.save\n assert !User.authenticate(ACCOUNT,PASS)\n end", "title": "" }, { "docid": "0db982ae0af3057ca3aa2ebfd5392924", "score": "0.6745968", "text": "def test_ut_t1_la_ldap_021\n ldap_setting = create_ldap\n assert !ldap_setting.check_user_id(\"wrong_user\")\n end", "title": "" }, { "docid": "d43adf60c115098952a283ddd6211499", "score": "0.6734028", "text": "def test_ut_t1_la_ldap_022\n ldap_setting = create_ldap\n assert ldap_setting.check_user_id(LOGIN)\n end", "title": "" }, { "docid": "a08a10c84ff92dd0109d2e6c698557e3", "score": "0.6676653", "text": "def test_ut_t1_la_user_016\n User.delete_all()\n LdapSetting.delete_all()\n create_normal_user(ACCOUNT,MAIL,PASS)\n assert !User.authenticate(ACCOUNT,\"wrong pass\")\n end", "title": "" }, { "docid": "924c5d81cd6f486f889846b1ebb2b0c1", "score": "0.66751504", "text": "def create_user(name, email, password, admin = false)\n return if ldap?\n portus_exec(\"rake portus:create_user[#{name},#{email},#{password},#{admin}]\")\nend", "title": "" }, { "docid": "a776d4920ba5b56be64d9d8b794a23ac", "score": "0.66379356", "text": "def test_ut_t1_la_user_006\n ldap_setting = create_ldap_without_mail\n new_user = User.new(:account_name => ACCOUNT,\n :ldap_setting_id => ldap_setting.id)\n assert !new_user.save\n end", "title": "" }, { "docid": "ac9e2e797a763bb6aab26940cb4f3dd4", "score": "0.65989935", "text": "def test_ut_t1_la_user_015\n User.delete_all()\n LdapSetting.delete_all()\n create_normal_user(ACCOUNT,MAIL,PASS)\n assert User.authenticate(ACCOUNT,PASS)\n end", "title": "" }, { "docid": "4d4b7f555c118ef2f797fe8c5601bbdb", "score": "0.65758055", "text": "def test_ut_t1_la_ldap_023\n ldap_setting = create_ldap\n ldap_setting.host = \"wrong host\"\n ldap_setting.save\n assert !ldap_setting.check_user_id(LOGIN)\n end", "title": "" }, { "docid": "00e84523b0963db1a452a1595438440f", "score": "0.65717316", "text": "def test_ut_t1_la_ldap_024 \n ldap_setting = create_ldap\n ldap_setting.on_the_fly_user_creation = false\n ldap_setting.save\n assert ldap_setting.check_user_id(LOGIN)\n end", "title": "" }, { "docid": "edad9a3edc522b8e8b0e9376f0ce9dd2", "score": "0.6567113", "text": "def test_should_not_create_user_with_short_password\n user = build_user(\"golias\", \"o grande\", \"1111\", \"1111\",\"validemail@domain.com\",1)\n assert !user.save, \"Saved user with password too short\"\n end", "title": "" }, { "docid": "db9fcc6718f6c6f34d8f17cfab459718", "score": "0.6556361", "text": "def create_user(ldap_info)\n user = User.find_or_create_by(email: ldap_info.mail.first) do |user|\n user.first_name = ldap_info.givenName.first if ldap_info.respond_to? :givenName\n user.last_name = ldap_info.sn.first if ldap_info.respond_to? :sn\n user.uid = ldap_info.uidNumber.first if ldap_info.respond_to? :uidNumber\n user.skip_password_validation = true\n end\n\n user.roles << Role.find_by_name(\"employee\") if user.roles.empty?\n user.ensure_authentication_token\n user.reg_status = \"confirmed\"\n user[:encrypted_password] = encrypt(params[:password]) if user[:encrypted_password].empty?\n error!('Incorrect Password', 401) unless decrypt(user[:encrypted_password]) == params[:password]\n user.save\n data = {:user_id => user.id, :role_id => user.roles.first.id , :token => user.auth_token}\n custom_token = JWT.encode(data, Rails.application.secrets.secret_key_base)\n\n success(user: user, custom_token: custom_token)\n end", "title": "" }, { "docid": "c1b50058545ae163b2e33e5c741f39af", "score": "0.65116924", "text": "def dscl_create_user\n run_dscl(\"create\", \"/Users/#{new_resource.username}\")\n end", "title": "" }, { "docid": "1b5eb73218cd6e729b3ad42a1e7f4d9f", "score": "0.6505713", "text": "def test_should_not_create_user_with_long_passwords\n user = build_user(\"golias\", \"o maluco\", \"1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\", \"1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\",\"validemail@domain.com\",1)\n assert !user.save, \"Saved user with password too long\"\n end", "title": "" }, { "docid": "f3718d4db5ba48e17e826ec9a6a0df9e", "score": "0.64932656", "text": "def create_user \n \n if ARGV\n ARGV.each do |arg|\n @firstname = ARGV[0]\n @lastname=ARGV[1]\n @password = ARGV[2]\n end\n end \n\n dn = \"cn=#{@firstname}, #{@users_suffix}\"\n attr = {\n :objectClass => 'inetOrgPerson',\n :cn=> @firstname,\n :sn => @lastname,\n :userPassword => @password\n }\n @lda.add(:dn => dn, :attributes => attr) \n puts \"********** create user result **********\"\n puts @lda.get_operation_result \n end", "title": "" }, { "docid": "c78101a262d5699dc5e6a99d9dc31283", "score": "0.64736843", "text": "def test_ut_t1_la_ldap_013\n ldap_setting = create_ldap\n assert !ldap_setting.authenticate(\"\",\"\")\n end", "title": "" }, { "docid": "c9564ba3f2ee38b0df21907d31e77d60", "score": "0.64711607", "text": "def test_should_not_create_user_with_long_passwords\r\n user = build_user(\"travis\", \"1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\", \"1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\",\"validemail@domain.com\")\r\n assert !user.save, \"Saved user with password too long\"\r\n end", "title": "" }, { "docid": "e7725b7b8b1adff48dbcf4e7ffd503ab", "score": "0.64413255", "text": "def test_ut_t1_la_user_013\n User.delete_all()\n user = create_normal_user(ACCOUNT,MAIL,PASS)\n ldap_setting = create_ldap_without_mail\n assert !user.update_attributes(:ldap_setting_id => ldap_setting.id,\n :email => \"\")\n end", "title": "" }, { "docid": "b43065f8fc2a51947523edd6bc2221b7", "score": "0.64395607", "text": "def test_ut_t1_la_ldap_034\n ldap_setting = create_ldap\n assert !ldap_setting.get_ldap_user_email(\"\")\n end", "title": "" }, { "docid": "a393c4a7cda486363487d53f20b7b46e", "score": "0.6436138", "text": "def test_ut_t1_la_ldap_035\n ldap_setting = create_ldap\n assert !ldap_setting.get_ldap_user_email(\"wrong_user\")\n end", "title": "" }, { "docid": "77d30f0cf61a76a0e23e21131884873d", "score": "0.6407602", "text": "def create_ldap_user(name,mail,ldap_id)\n user = User.create( :account_name => name,\n :email => mail,\n :ldap_setting_id => ldap_id)\n return user\n end", "title": "" }, { "docid": "ea28d327aaf0d756821a91f2c6bf19bf", "score": "0.6404485", "text": "def test_ut_t1_la_user_020\n User.delete_all()\n LdapSetting.delete_all()\n create_ldap_with_mail\n assert !User.authenticate(ACCOUNT,\"PASS\")\n end", "title": "" }, { "docid": "5711becf0a0b75e5ba02e66835b20997", "score": "0.63887763", "text": "def test_should_not_create_user_with_short_password\r\n user = build_user(\"travis\", \"1111\", \"1111\",\"validemail@domain.com\")\r\n assert !user.save, \"Saved user with password too short\"\r\n end", "title": "" }, { "docid": "000eac7b3a692d03517be29970f96040", "score": "0.6361603", "text": "def test_ut_t1_la_user_019\n User.delete_all()\n LdapSetting.delete_all()\n create_ldap_with_mail\n assert User.authenticate(ACCOUNT,PASS)\n end", "title": "" }, { "docid": "6059093355b962525454bf85a1e1cfa8", "score": "0.6322531", "text": "def save_register_user_from_ldap(entry, _arr_attr_from_ldap, params)\n flag = false\n user_name = entry.cn.join().gsub(\" \",\"\")\n self.email = (entry.mail.join() if _arr_attr_from_ldap.include?(:mail))\n self.username = (user_name if _arr_attr_from_ldap.include?(:cn))\n self.login = (user_name if _arr_attr_from_ldap.include?(:cn))\n self.first_name = (entry.givenname.join() if _arr_attr_from_ldap.include?(:givenname))\n self.last_name = (entry.sn.join() if _arr_attr_from_ldap.include?(:sn))\n self.is_activated = true\n self.password = params[:user][:password]\n self.password_confirmation = params[:user][:password]\n self.user_type = \"ldap\"\n self.type_of_user_id = TypeOfUser.where(\"parent_id = (SELECT id FROM type_of_users WHERE description = 'Customer')\").first.try(:id)\n self.warehouse_id = Warehouse.find_by_warehouse_name(\"Gudang Default\").id\n if self.valid? && self.save\n group = self.warehouse.group.set_feature(\"warehouse\")\n self.add_role(:customer_admin_group)\n flag = self\n end\n return flag\n end", "title": "" }, { "docid": "8b9402b36536797cf74ed69e57a764d0", "score": "0.63087416", "text": "def destroy\n ldapPassword=File.open('config/password','r').first.split(\"\\n\")[0]\n auth = {:method=>:simple, :username=>\"cn=admin,dc=cws,dc=net\", :password=>ldapPassword}\n ldap=Net::LDAP.new(:host=>'ldap.cws.net', :port=>636, :auth=>auth, :encryption=>:simple_tls)\n if (not username.empty?) and ldap.bind\n dn=\"uid=#{username},ou=People,dc=cws,dc=net\"\n if ldap.delete :dn=>dn\n return true\n end\n end\n \n ldaperror=ldap.get_operation_result\n puts ldaperror\n errors.add \"ldap could not add user #{ldaperror}\",'ldap_errors'\n false\n end", "title": "" }, { "docid": "9dd1d9897fcebb3b7868416c13c228cb", "score": "0.63054615", "text": "def create_user\n u = get_console_string(\"Username:\")\n p = get_console_string(\"Password:\")\n n = get_console_string(\"Name:\")\n l = get_console_string(\"Lastname:\")\n \n usr = @um.add_user(u,p,n,l)\n\n if usr == nil\n puts \"Error: User already exists\";\n return -1;\n end\n print \"Successfuly created User: \"\n puts usr.username\n return 0;\n end", "title": "" }, { "docid": "ab4965aaace0215794e0f30b9b51cb7d", "score": "0.6305416", "text": "def test_ut_t1_la_ldap_015\n ldap_setting = create_ldap\n assert ldap_setting.authenticate(\"wrong login\",\"wrong pass\").blank?\n end", "title": "" }, { "docid": "91a04bff3348562d9b142a65066443a2", "score": "0.6294945", "text": "def create_password!(reason)\n \n end", "title": "" }, { "docid": "9bab39e44f06cac99819ae60f11f3975", "score": "0.62911546", "text": "def test_ut_t1_la_user_021\n User.delete_all()\n LdapSetting.delete_all()\n create_ldap_with_mail\n assert !User.authenticate(\"ACCOUNT\",\"PASS\")\n end", "title": "" }, { "docid": "e372310f1f08e647244f7741cdded325", "score": "0.6280608", "text": "def test_ut_t1_la_user_014\n User.delete_all()\n user = create_normal_user(ACCOUNT,MAIL,PASS)\n ldap_setting = create_ldap_with_mail\n assert user.update_attributes(:ldap_setting_id => ldap_setting.id)\n end", "title": "" }, { "docid": "b7a7b3ab434f437ac2835cf64938a046", "score": "0.6278559", "text": "def test_ut_t1_la_user_005\n User.delete_all()\n new_user = User.new(:account_name => ACCOUNT,\n :ldap_setting_id => nil,\n :password => \"password\",\n :password_confirmation => \"not matched\")\n assert !new_user.save\n end", "title": "" }, { "docid": "302df64209ff473a35f1ca93312e7ea9", "score": "0.62608075", "text": "def create_user(options)\n # command_string = (options[:uid] % 256).chr\n # command_string += (options[:uid] >> 8).chr\n command_string = options[:uid].chr.ljust(2, 0.chr)\n command_string += options[:role].chr\n command_string += options[:password].ljust(8, 0.chr)\n command_string += options[:name].ljust(28, 0.chr)\n command_string += 1.chr\n command_string += 0.chr * 8\n command_string += options[:user_id].ljust(8, 0.chr)\n command_string += 0.chr * 16\n\n execute_cmd(\n command: CMD_SET_USER,\n command_string: command_string\n ) do |opts|\n return puts \"ERROR: #{options[:error]}\" unless opts[:valid]\n\n data = opts[:data]\n if data.length > 7\n data.split(\"\\u0000\").pop\n else\n puts 'ERROR: Invalid set user response'\n end\n end\n end", "title": "" }, { "docid": "756f913b2b90b70dc7f63160cd22fcb5", "score": "0.6242791", "text": "def create_user\n @user_password = generate_password\n run \"useradd #{project_name} -p #{@user_password.crypt(project_name)} -s /bin/bash\"\n end", "title": "" }, { "docid": "a3a58e1832de7027205c0069046de3e5", "score": "0.6231381", "text": "def test_ut_t1_la_ldap_037\n ldap_setting = create_ldap\n ldap_setting.host = \"wrong host\"\n ldap_setting.save\n assert !ldap_setting.get_ldap_user_email(LOGIN)\n end", "title": "" }, { "docid": "32f619c2e8fa8f6c761e3344451e5ce2", "score": "0.6209007", "text": "def add_user(user_name, mail = nil, host=nil, user=nil, password=nil, treebase=nil, email_postfix=nil)\n user_name = check_for_random(user_name)\n @ldap_user_mail = check_for_random_mail(mail, user_name, email_postfix)\n dn = \"CN=#{user_name}, #{treebase || TREEBASE}\"\n attr = {\n :cn => \"#{user_name}\",\n :objectclass => ['top', 'person', 'user', 'organizationalPerson'],\n :sn => \"#{user_name}\",\n :name => \"#{user_name}\",\n :givenname => \"#{user_name}\",\n :displayname => \"#{user_name}\",\n :mail => @ldap_user_mail || \"#{user_name}#{email_postfix || EMAIL_POSTFIX}\",\n # :uid => '335',\n :userprincipalname =>@ldap_user_mail || \"#{user_name}#{email_postfix || EMAIL_POSTFIX}\",\n :useraccountcontrol => '66080',\n :samaccountname => \"#{user_name}\",\n }\n attr[:uid] = \"123_#{Time.now.strftime(\"%Y%m%d%H%M\")}\"\n ldap = Net::LDAP.new :host => host || HOST,\n :port => PORT,\n :auth => {\n :method => :simple,\n :username => user || USER,\n :password => password || PASSWORD\n }\n\n ldap.open do |ldap|\n ldapLog(\"Begin to create AD user\")\n ldapLog(\"dn is:\" + dn.to_s)\n ldapLog(\"attributes are:\" + attr.to_s)\n ldap.add(:dn => dn, :attributes => attr)\n ldapLog(\"LDAP User creation result is:\" + ldap.get_operation_result.to_s)\n #Log.debug ldap.get_operation_result)\n end\n #Log.debug(\"add a user #{user_name} to AD\")\n ldapLog(\"add a user #{user_name} to AD\")\n end", "title": "" }, { "docid": "dd57faaba25bd8af71bf3ec0c8f62e34", "score": "0.618935", "text": "def test_ut_t1_la_ldap_005\n ldap_setting = LdapSetting.new( :name => NAME,\n :host => HOST,\n :port => PORT,\n :base_dn => BASE_DN,\n :attr_login => ATTR_LOGIN,\n :on_the_fly_user_creation => true,\n :attr_mail => \"\"\n )\n assert !ldap_setting.save\n end", "title": "" }, { "docid": "f5895a4180d38edc6673cedcb60829a7", "score": "0.61868775", "text": "def create_user_account\n user = User.new do |u|\n u.first_name = first_name\n u.last_name = last_name\n u.username = email\n u.student_id = student.id\n u.password = 'P' + student.admission_no\n u.role = 'Parent'\n u.email = email\n u.general_setting_id = User.current.general_setting.id\n end\n user.save\n p user.errors\n end", "title": "" }, { "docid": "698b49dc42acddea3eb79bd87237a762", "score": "0.6173911", "text": "def test_ut_t1_la_ldap_041\n LdapSetting.delete_all()\n ldap_setting = create_ldap\n user = create_user(ldap_setting.id)\n assert LdapSetting.switch_active_ldap(0)\n assert_nil User.find_by_id(user.id).ldap_setting_id\n end", "title": "" }, { "docid": "0ec07dfd4677ca172faedf7794e6fd9a", "score": "0.6159692", "text": "def test_ut_t1_la_ldap_011\n ldap_setting = create_ldap_ssl\n assert !ldap_setting.update_attributes(:on_the_fly_user_creation => true,\n :attr_mail => \"\")\n end", "title": "" }, { "docid": "2da4d6d58e3175f1b03555feff8b2ac0", "score": "0.6158517", "text": "def grantAllToRootUser\n passwd3File=\"#{ENV['HOME']}/passwd3.tmp\"\n puts passwd3File\n pwFile = File.open(passwd3File, 'w+')\n pwFile.puts ROOT_PW\n pwFile.puts ROOT_PW\n pwFile.puts ROOT_PW\n pwFile.close\n cmd = \"yus_add_user #{ROOT_USER} login org.oddb.RootUser <#{passwd3File}\"\n puts cmd\n exit 1 unless system(cmd) \n\n passwdFile=\"#{ENV['HOME']}/passwd2.tmp\"\n pwFile = File.open(passwdFile, 'w+')\n pwFile.puts ROOT_PW\n pwFile.close\n\n # yus_add_user #{ROOT_USER} login org.oddb.#{ROOT_USER} <#{passwdFile}\n setupUser = %(echo #{ROOT_PW} | yus_grant #{ROOT_USER} grant login \necho #{ROOT_PW} | yus_grant #{ROOT_USER} grant view \necho #{ROOT_PW} | yus_grant #{ROOT_USER} grant create \necho #{ROOT_PW} | yus_grant #{ROOT_USER} grant edit \necho #{ROOT_PW} | yus_grant #{ROOT_USER} grant credit \necho #{ROOT_PW} | yus_grant #{ROOT_USER} edit yus.entities \necho #{ROOT_PW} | yus_grant #{ROOT_USER} edit org.oddb.drugs \necho #{ROOT_PW} | yus_grant #{ROOT_USER} edit 'org.oddb.model.!company.*' \necho #{ROOT_PW} | yus_grant #{ROOT_USER} edit 'org.oddb.model.!sponsor.*' \necho #{ROOT_PW} | yus_grant #{ROOT_USER} edit 'org.oddb.model.!indication.*' \necho #{ROOT_PW} | yus_grant #{ROOT_USER} edit 'org.oddb.model.!galenic_group.*' \necho #{ROOT_PW} | yus_grant #{ROOT_USER} edit 'org.oddb.model.!address.*' \necho #{ROOT_PW} | yus_grant #{ROOT_USER} edit 'org.oddb.model.!atc_class.*' \necho #{ROOT_PW} | yus_grant #{ROOT_USER} create org.oddb.registration \necho #{ROOT_PW} | yus_grant #{ROOT_USER} create org.oddb.task.background \necho #{ROOT_PW} | yus_grant #{ROOT_USER} view org.oddb.patinfo_stats \necho #{ROOT_PW} | yus_grant #{ROOT_USER} credit org.oddb.download \n)\n\ncmdsForOtherUser = %(\necho #{ROOT_PW} | yus_add_user AdminUser login org.oddb.AdminUser \necho #{ROOT_PW} | yus_grant AdminUser edit org.oddb.drugs \necho #{ROOT_PW} | yus_grant AdminUser create org.oddb.registration \necho #{ROOT_PW} | yus_grant AdminUser edit 'org.oddb.model.!galenic_group.*' \necho #{ROOT_PW} | yus_add_user CompanyUser login org.oddb.CompanyUser \necho #{ROOT_PW} | yus_grant CompanyUser edit org.oddb.drugs \necho #{ROOT_PW} | yus_grant CompanyUser create org.oddb.registration \necho #{ROOT_PW} | yus_grant CompanyUser edit 'org.oddb.model.!galenic_group.*' \necho #{ROOT_PW} | yus_grant CompanyUser view org.oddb.patinfo_stats.associated \necho #{ROOT_PW} | yus_add_user PowerLinkUser login org.oddb.PowerLinkUser \necho #{ROOT_PW} | yus_grant PowerLinkUser edit org.oddb.drugs \necho #{ROOT_PW} | yus_grant PowerLinkUser edit org.oddb.powerlinks \necho #{ROOT_PW} | yus_add_user PowerUser login org.oddb.PowerUser \necho #{ROOT_PW} | yus_add_user DownloadUser \n)\n# FileUtils.rm_f(passwdFile, :verbose => true)\n\n setupUser.split(\"\\n\").each{\n |line|\n puts \"Running: \" + line\n res = system(line)\n unless res\n puts \"running '#{line}' failed res #{res.inspect}\"\n exit 1\n end\n }\nend", "title": "" }, { "docid": "499717b1d47116bd96d1b65d5df0045e", "score": "0.6155001", "text": "def test_should_not_create_user_with_long_username\r\n user = build_user(\"TravisIsSoCoolThatHeActuallyFilledThisInWithAnActualMessageInsteadOfJustTypingInRandomStuff,AlthoughThisIsALittleRandom...\", \"111111\", \"111111\",\"validemail@domain.com\")\r\n assert !user.save, \"Saved user with password too long\"\r\n end", "title": "" }, { "docid": "c6f6b8d34186b131c7234bf23e44a5bb", "score": "0.61410856", "text": "def test_ut_t1_la_ldap_014\n ldap_setting = create_ldap\n assert !ldap_setting.authenticate(LOGIN,\"wrong pass\")\n end", "title": "" }, { "docid": "332bae7091a59dd77ef05a3a4cd8ea3f", "score": "0.6132624", "text": "def create\n ldapPassword=File.open('config/password','r').first.split(\"\\n\")[0]\n auth = {:method=>:simple, :username=>\"cn=admin,dc=cws,dc=net\", :password=>ldapPassword}\n ldap=Net::LDAP.new(:host=>'ldap.cws.net', :port=>636, :auth=>auth, :encryption=>:simple_tls)\n \n #can we connect to the ldap server\n if ldap.bind\n treebase=\"ou=Group,dc=cws,dc=net\"\n attrs=[\"gidNumber\"]\n filter = Net::LDAP::Filter.eq( \"cn\", \"*\" )\n \n #find next available gidNumber \n gidNumber='1'\n ldap.search(:base=>treebase, :attributes=>attrs,:filter=>filter) do |entry|\n if entry[:gidnumber][0].to_i > gidNumber.to_i\n gidNumber=entry[:gidnumber][0]\n end\n end\n\n #prepare our data for entry to ldap\n dn=\"cn=#{groupname},ou=Group,dc=cws,dc=net\"\n attrs={ :cn=>groupname,\n :objectClass=> ['posixGroup','top'],\n :gidNumber=> gidNumber }\n\n #try to add new entry\n if ldap.add(:dn=>dn,:attributes=>attrs)\n true\n else\n ldaperror=ldap.get_operation_result\n errors.add \"ldap could not add group #{ldaperror}\",'ldap.add errors'\n errors.add attrs.to_s,'group_attributes'\n false\n end\n else\n ldaperror=ldap.get_operation_result\n errors.add \"ldap could not add group #{ldaperror}','ldap.add errors\"\n false\n end\n end", "title": "" }, { "docid": "26f6c0e83a1f231a110789e2f6088146", "score": "0.6131249", "text": "def test_should_not_create_user_with_short_username\r\n user = build_user(\"tr\", \"111111\", \"111111\",\"validemail@domain.com\")\r\n assert !user.save, \"Saved user with username too short\"\r\n end", "title": "" }, { "docid": "e07ec0f82060322bf97b9883a4a1d6a4", "score": "0.61311215", "text": "def create_user(login, email, options = T.unsafe(nil)); end", "title": "" }, { "docid": "390a2be87952b19a320bc6ffd5a3049d", "score": "0.6122726", "text": "def create\n login = user_params[:login]\n first = user_params[:first_name]\n last = user_params[:last_name]\n key = user_params[:key]\n\n if login.blank? || first.blank? || last.blank? || key.blank?\n render json: {error: \"all fields are required\"}, status: :unprocessable_entity\n elsif LDAP::User.create(login, first, last, key)\n render json: {success: true, message: \"user #{login} created.\"}, status: :ok\n else\n render json: {error: \"failed to create user\"}, status: :unprocessable_entity\n end\n rescue => e\n render json: {error: e.message}, status: :unprocessable_entity\n end", "title": "" }, { "docid": "789e506cb45cda5c32c853569029df11", "score": "0.61096454", "text": "def user_create(params = {})\n data = { 'createUser' => 1 }\n authorizable_id = search_hash!(params, :authorizable_id, :authorizableId, :authoriziableid, :id, :username)\n password = search_hash!(params, :password)\n\n data['authorizableId'] = authorizable_id\n data['rep:password'] = data['rep:re-password'] = password\n\n ### OPTIONAL PARAMETERS ##\n title = search_hash!(params, :title)\n given_name = search_hash!(params, :given_name, :givenName, :givenname, :first_name, :firstName, :firstname) || 'undefined'\n family_name = search_hash!(params, :family_name, :familyName, :familyname, :last_name, :lastName, :lastname) || 'undefined'\n job_title = search_hash!(params, :job_title, :jobTitle, :jobtitle)\n gender = search_hash!(params, :gender)\n about_me = search_hash!(params, :about_me, :aboutMe, :aboutme, :about)\n\n email = search_hash!(params, :email, :email_address) || 'undefined'\n phone_number = search_hash!(params, :phone_number, :phoneNumber, :phonenumber)\n mobile = search_hash!(params, :mobile, :mobile_phone_number)\n\n street = search_hash!(params, :street, :street_address, :streetAddress, :streetaddress)\n city = search_hash!(params, :city)\n state = search_hash!(params, :state)\n country = search_hash!(params, :country)\n postal_code = search_hash!(params, :postal_code, :postalCode, :postalcode, :zip_code, :zipCode, :zipcode)\n\n data['./profile/givenName'] = given_name #if given_name\n data['./profile/email'] = email #if email\n data['./profile/phoneNumber'] = phone_number #if phone_number\n data['./profile/street'] = street #if street\n data['./profile/city'] = city #if city\n data['./profile/country'] = country #if country\n data['./jcr:title'] = title #if title\n data['./profile/familyName'] = family_name #if family_name\n data['./profile/jobTitle'] = job_title #if job_title\n data['./profile/mobile'] = mobile #if mobile\n data['./profile/postalCode'] = postal_code #if postal_code\n data['./profile/state'] = state #if state\n data['./profile/gender'] = gender #if gender\n data['./profile/aboutMe'] = about_me #if about_me\n\n http_post_form('libs/granite/security/post/authorizables.html', data)\n return true if response.code == '201'\n false\n end", "title": "" }, { "docid": "aa839393cbeb9ce85efd2c2139195904", "score": "0.60890007", "text": "def create\n Puppet.info \"cobbler_digest_user: updating user: #{@resource[:name]}\"\n rm_user\n create_user\n end", "title": "" }, { "docid": "8eab6d61ce89b7f1f58a8021c7a193c0", "score": "0.6063622", "text": "def add_user!\n if c.password.nil?\n GitPusshuTen::Log.message \"What password would you like to give #{c.user.to_s.color(:yellow)}?\"\n while @new_password.nil?\n new_password = ask('Fill in a password.') { |q| q.echo = false }\n new_password_verification = ask('Verify password.') { |q| q.echo = false }\n if not new_password.empty? and (new_password == new_password_verification)\n @new_password = new_password\n else\n if new_password.empty?\n GitPusshuTen::Log.error \"Please provide a password.\"\n else\n GitPusshuTen::Log.error \"Verification failed, please try again.\"\n end\n end\n end\n else\n @new_password = c.password\n end\n\n response = execute_as_root(\"useradd -m --home='#{home_dir}' -s '/bin/bash' --password='\" + %x[openssl passwd #{@new_password}].chomp + \"' '#{c.user}'\")\n return true if response.nil? or response =~ /useradd\\: warning\\: the home directory already exists\\./\n false\n end", "title": "" }, { "docid": "c76a99db81c782bdc7d35d3277c26dcb", "score": "0.6062013", "text": "def fix_ldap\n @user = User.find_by(username: user_params[:username])\n \n if @user.blank?\n flash[:danger] = \"Couldn't find that user.\"\n redirect_to help_users_path\n return\n elsif not @user.legacy_profile\n flash[:danger] = \"Something's missing for that user, please send us an email!\"\n redirect_to help_users_path\n return\n end\n\n password = user_params[:current_password]\n\n passwords_match = @user.legacy_profile.password == Legacy::Staff.legacy_password_hash(password)\n\n if passwords_match and @user.sync_to_legacy_profile!(password) and @user.sync_to_ldap(password)\n @user.password = password\n @user.save!\n\n flash[:notice] = \"Things should hopefully be working now. Try it out!\"\n redirect_to new_user_session_path\n else\n flash[:danger] = \"Sorry, we couldn't match that password!\"\n redirect_to help_users_path\n end\n end", "title": "" }, { "docid": "77383d737ad4c9cff4a794f26269efdf", "score": "0.605327", "text": "def test_ut_t1_la_ldap_006\n ldap_setting = LdapSetting.new( :name => NAME,\n :host => HOST,\n :port => PORT,\n :base_dn => BASE_DN,\n :attr_login => ATTR_LOGIN,\n :on_the_fly_user_creation => true,\n :attr_mail => \"mail\"\n )\n assert ldap_setting.save\n end", "title": "" }, { "docid": "f7d7f4d419b3d25a75c12bc08f257e7a", "score": "0.60529894", "text": "def test_ut_t1_la_user_002\n User.delete_all()\n new_user = User.new(:account_name => ACCOUNT,\n :ldap_setting_id => nil,\n :password => nil,\n :password_confirmation => nil)\n assert !new_user.save\n end", "title": "" }, { "docid": "ca0ab47a2de22f68b3cd232a3f4188d2", "score": "0.6046937", "text": "def test_ut_t1_la_ldap_018\n ldap_setting = create_ldap\n ldap_setting.host = \"wrong host\"\n ldap_setting.save\n assert !ldap_setting.authenticate(LOGIN,PASS)\n end", "title": "" }, { "docid": "cf6a7bea66e0be10cc97e6198fb5f877", "score": "0.6022973", "text": "def create_account(user)\n if self.bind\n @connection.add(:dn => user.ldap_distinguished_name(user), :attributes => ldap_attributes(user))\n return @connection.get_operation_result.message\n else\n return false\n end\n end", "title": "" }, { "docid": "afe127accd4644a782805e2bf2a435ab", "score": "0.6020672", "text": "def create_user(username, given_name, family_name, password, passwd_hash_function=nil, quota=nil)\n msg = ProvisioningMessage.new\n msg.about_login(username,password,passwd_hash_function,\"false\",\"false\", \"true\")\n msg.about_name(family_name, given_name)\n msg.about_quota(quota.to_s) if quota\n response = @apps.request(:user_create,nil, msg.to_s)\n #user_entry = UserEntry.new(response.elements[\"entry\"])\n end", "title": "" }, { "docid": "16144e22e49b5aed5e16475a0756a2ed", "score": "0.6019443", "text": "def test_ut_t1_la_ldap_017\n ldap_setting = LdapSetting.create(:name => NAME,\n :host => HOST,\n :port => PORT,\n :base_dn => BASE_DN,\n :attr_login => ATTR_LOGIN,\n :on_the_fly_user_creation => false,\n :attr_mail => \"mail\")\n assert ldap_setting.authenticate(LOGIN,PASS)\n end", "title": "" }, { "docid": "671bcf436a44b101354f96db1d25e7b7", "score": "0.599229", "text": "def create_user(uname,upass)\n template \"/usr/local/bin/creatusr\" do\n source \"creatusr.erb\"\n cookbook \"cfserver\"\n action :create\n user \"root\"\n group \"root\"\n mode \"0700\"\n end\n execute \"creatuser-#{uname}\" do\n command \"/usr/local/bin/creatusr #{uname} #{upass}\"\n sensitive true\n action :run\n not_if \"getent passwd #{uname}\"\n end\n end", "title": "" }, { "docid": "3b711243d66b8c504d72f2f8229cc9d6", "score": "0.5986505", "text": "def create_user\n value = user_params\n create_user = HTTParty.post(ms_ip(\"rg\")+\"/users\", body: value.to_json, :headers => { 'Content-Type' => 'application/json' })\n if create_user.code == 201\n create_ldap = HTTParty.post(ms_ip(\"ldap\")+\"/user/resources/ldapcruds\", body: {\n email: value[:username],\n password: value[:password],\n name: value[:username]\n }.to_json, :headers => { 'Content-Type' => 'application/json' })\n render status: 201, json: create_user.body\n else\n render status: create_user.code, json: create_user.body\n end\n end", "title": "" }, { "docid": "dbf7f45ec7534f4f121894457cedf19a", "score": "0.5983682", "text": "def create_user\n Chef::Log.debug \"Adding user '#{ new_resource.name }'\"\n\n user \"add_user\" do\n username new_resource.name\n comment new_resource.comment\n #gid new_resource.primary_group || new_resource.name\n home new_resource.home || \"/home/#{ new_resource.name }\"\n shell new_resource.shell\n system new_resource.system\n supports :manage_home => true\n action :create\n end\nend", "title": "" }, { "docid": "2bb2b44ecff2a060a181b37bcdd88f67", "score": "0.5982371", "text": "def create_user(resource)\n\t\t session = Puppet::NetDev::CE::Device.session\n\t\t\n\t\t set_user_xml = '<rpc><edit-config><target><running/></target><default-operation>merge</default-operation><error-option>rollback-on-error</error-option><config><aaa xmlns=\"http://www.huawei.com/netconf/vrp\" content-version=\"1.0\" format-version=\"1.0\"><lam><users><user operation=\"merge\"><userName>' + \"#{resource[:name]}\" + '</userName>'\n\t\t \n\t\t if resource[:password]\n\t\t\tset_user_xml += '<password>' + \"#{resource[:password]}\" + '</password>'\n\t\t end\n\t\t \n\t\t set_user_xml += '</user></users></lam></aaa></config></edit-config></rpc>'\n\t\t \n\t\t session.rpc.do_config(set_user_xml)\n\t\tend", "title": "" }, { "docid": "567ebb41eb230608215d63cdd31a5b06", "score": "0.59557396", "text": "def find_or_create_user!\n user = User.find_by(ldap_name: username)\n\n # The user does not exist in Portus yet, let's create it. If it does\n # not match a valid username, it will be transformed into a proper one.\n unless user\n ldap_name = username.dup\n if User::USERNAME_FORMAT.match(ldap_name)\n name = ldap_name\n else\n name = ldap_name.gsub(/[^#{User::USERNAME_CHARS}]/, \"\")\n end\n\n # This is to check that no clashes occur. This is quite improbable to\n # happen, since it would mean that the name contains characters like\n # \"$\", \"!\", etc. We also check that the name is longer than 4\n # (requirement from Docker).\n if name.length < 4 || User.exists?(username: name)\n name = generate_random_name(name)\n end\n\n user = User.create(\n username: name,\n email: guess_email,\n password: password,\n admin: !User.not_portus.any?,\n ldap_name: ldap_name\n )\n end\n user\n end", "title": "" }, { "docid": "e2701f29f85c39c0538d892a1b070d37", "score": "0.5954911", "text": "def new_user\n emailId = params[:id]\n password = params[:password]\n cpassword = params[:cpassword]\n fname = params[:fname]\n lname = params[:lname]\n\n flash.delete(\"error\");\n\n if password != cpassword\n flash[:error] = \"Password and Confirm Password do not match\"\n redirect_to action: \"create_user\"\n return\n end\n\n if UserService.find_user(emailId) != nil\n flash[:error] = \"User with #{emailId} already exists!\"\n redirect_to action: \"create_user\"\n return\n end\n UserService.create_library_user(emailId,fname,lname,password,cpassword)\n redirect_to action: \"manage_users\"\n return\n end", "title": "" }, { "docid": "cf66a111ea4089e1e24c37e3bbd3a3bc", "score": "0.5953779", "text": "def create\n @user = User.new(create_user_params)\n @user.sync_ldap!\n\n if @user.save\n redirect_to admin_users_path, notice: t_success_action(@user, :register)\n else\n redirect_to admin_users_path, alert: t_failure_action(@user, :register)\n end\n end", "title": "" }, { "docid": "7d607543d64e6b71b170b70b5719c37c", "score": "0.5947473", "text": "def validate_user_pass(_username, _password)\n end", "title": "" }, { "docid": "2694154a38312d272a8402ff0c47d873", "score": "0.59396636", "text": "def validate\n unless valid_state_uid\n unless errors.on(:firstname) or errors.on(:lastname) or errors.on(:uid)\n unless ldap_exists?(self.firstname, self.lastname, self.uid)\n errors.add(:autherror, \"your first and last name do not match the user id entered. If your think your details are correct you may have entered your user id wrong. Press previous to correct\")\n end\n end\n end\n end", "title": "" }, { "docid": "4b3ccbf1ae88cc31cab04c75eccb90a2", "score": "0.59383076", "text": "def create\n connection = { host: 'MSD-INF-SDC-001.msd.govt.state.ma.us',\n port: 636, encryption: :simple_tls, auth: {\n method: :simple, username: params[:session][:username],\n password: params[:session][:password] } }\n ldap = Net::LDAP.new connection\n if ldap.bind\n # log the user in and redirect to the user's show page\n session[:username] = params[:session][:username]\n redirect_to root_path\n else\n render 'new'\n end\n end", "title": "" }, { "docid": "9ec461611eed2f30e6a22a2c5c613591", "score": "0.5932059", "text": "def test_ldap_user_authenticate_fail\n ldap = AuthenticateLdap.new('someuser','somepw','people', 'denver', 'mycompany', 'com')\n assert(!ldap.valid_user?, \"User was able to authenticate successfully (shouldn't be the case).\")\n end", "title": "" }, { "docid": "73141965dc2e5fbac0a6f412dcdf37ae", "score": "0.5927985", "text": "def create\n raise RequestError.new(:wrong_login, \"Invalid login\") unless params[:email].match(/^(?=.*[a-zA-Z0-9.-_]).{3,}$/)\n raise RequestError.new(:wrong_email, \"Invalid email\") unless params[:email].match(/\\A[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]+\\z/)\n raise RequestError.new(:login_taken, \"Login already taken\") if User.first login: params[:login]\n raise RequestError.new(:email_taken, \"Email already taken\") if User.first email: params[:email]\n raise RequestError.new(:wrong_password, \"Invalid password: must contains at least 6 letters\") unless params[:password].match(/^(?=.*[a-zA-Z0-9&é(§è!çà^$€%ù£):.,=+-_]).{6,}$/)\n\n user = set_properties User.new\n user.set_password params[:password]\n # create_root save the user\n WFolder.create_root user\n session[:user] = user\n @result = { user: user.private_description, success: true }\n end", "title": "" }, { "docid": "ba6200b99ce62c3d25690dbbb59cfa0f", "score": "0.5920579", "text": "def test_ut_t1_la_ldap_036\n ldap_setting = create_ldap\n assert ldap_setting.get_ldap_user_email(LOGIN)\n end", "title": "" }, { "docid": "57329ba1497a802f97c664c62d7cb9a8", "score": "0.591531", "text": "def create_user\n redirect_to(root_url) && return unless current_user.can_access_admin_panel?\n\n permitted_params = params[:admin].permit(:email, :jurisdiction, :role_title, :is_api_enabled, :notes)\n email = permitted_params[:email]\n return head :bad_request if email.nil? || email.blank?\n\n email = email.strip\n address = ValidEmail2::Address.new(email)\n return head :bad_request unless address.valid? && !address.disposable?\n\n notes = permitted_params[:notes].strip\n\n role = permitted_params[:role_title]\n return head :bad_request if role.nil? || role.blank?\n\n # Parse back to format in records\n role = role.split.map(&:downcase).join('_')\n return head :bad_request unless Roles.all_role_values.include?(role)\n\n jurisdiction = permitted_params[:jurisdiction]\n\n # New jurisdiction should only be from the subset of jurisdictions available to the current user\n allowed_jurisdictions = current_user.jurisdiction.subtree.pluck(:id)\n return head :bad_request unless allowed_jurisdictions.include?(jurisdiction)\n\n is_api_enabled = permitted_params[:is_api_enabled]\n return head :bad_request unless [true, false].include? is_api_enabled\n\n # Generate initial password for user\n password = User.rand_gen\n\n # Create user\n # - require user to change password on first login\n user = User.create!(\n email: email,\n password: password,\n jurisdiction: Jurisdiction.find_by(id: jurisdiction),\n force_password_change: true,\n api_enabled: is_api_enabled,\n role: role,\n notes: notes\n )\n user.save!\n UserMailer.welcome_email(user, password).deliver_later\n end", "title": "" }, { "docid": "d87d36ae6265a7cce4aa228adaed813d", "score": "0.5908068", "text": "def create_user(struct)\n struct.remapkeys!\n if struct.has_key? :user and struct.has_key? :pass\n rt = RT_Client.new(:user => struct[:user], :pass => struct[:pass])\n struct.delete(:user)\n struct.delete(:pass)\n else\n rt = RT_Client.new\n end\n val = rt.create_user(struct)\n rt = nil\n val\n end", "title": "" }, { "docid": "b5a2d0bc664bae95cc1ef54b2fcdcdf3", "score": "0.590392", "text": "def authenticate_user_in_ldap (user_name, pwd)\r\n\r\n log \"\\n\\n Entering task :authenticate_user_in_ldap.\\n\\n\"\r\n\r\n initialize_variables\r\n\r\n #username = \"xldapProxy\"\r\n #password = \"\"\r\n username = user_name\r\n password = pwd\r\n\r\n ldap = Net::LDAP.new\r\n ldap.host = \"10.1.1.2\"\r\n ldap.port = \"389\"\r\n\r\n ldap.authenticate \"uid=#{username},ou=Users,o=MTC\", password\r\n\r\n is_authenticated = ldap.bind\r\n\r\n unless is_authenticated == true\r\n log \"Error: Authentication fails with username '#{username}'.\"\r\n exit\r\n end\r\n\r\n log \"\\n\\n Exiting task :authenticate_user_in_ldap.\\n\\n\"\r\n\r\n return ldap\r\nend", "title": "" }, { "docid": "7f3953d929f7f43980a272b9dd2527eb", "score": "0.5889036", "text": "def create_user\n run('groupadd', nil_user)\n run('useradd', '-g', nil_user, '-m', '-s /bin/bash', nil_user)\n end", "title": "" }, { "docid": "c8b047a771b982e9a0e1089adad2f1b7", "score": "0.58740264", "text": "def ldap_create\n new_employee = Employee.ldap_create(params[:uid])\n if new_employee && new_employee.save\n flash[:notice] = t(:employee) + t(:added)\n else\n flash[:error] = t(:already_in_application)\n end\n render :search_ldap_view\n end", "title": "" }, { "docid": "346b1fbd095b58ada3c04a387c7f3c29", "score": "0.58736604", "text": "def create\n @user = User.new email: \"#{params[:user][:uniqname]}@umich.edu\"\n \n @user.user_type = UserType.find_by_type_name \"student\"\n @user.set_fullname_from_ldap\n \n if @user.save\n render \"create\"\n else\n render \"new\"\n end \n end", "title": "" }, { "docid": "c0975b7c01e52a0b93456cb2c2a3748d", "score": "0.5871136", "text": "def create_admin\n @password = params[:new_admin][:password]\n password2 = params[:new_admin][:password2]\n\n if(@password != password2)\n @password_bad = true\n redirect_to add_admin_url()\n return\n end\n\n @first_name = params[:new_admin][:first_name]\n @last_name = params[:new_admin][:last_name]\n @dot_number = params[:new_admin][:dot_number]\n @email = @last_name + \".\" + @dot_number + \"osu.edu\"\n\n User.create(role: :admin, fname: @first_name, lname: @last_name, dot_number: @dot_number, email: @email, password: @password)\n\n redirect_to home_url\n end", "title": "" }, { "docid": "9e53ca8a0ce6def8c30dd9c48d5fdba3", "score": "0.58625764", "text": "def test_ut_t1_la_user_007\n User.delete_all([\"account_name = ?\", ACCOUNT])\n ldap_setting = create_ldap_with_mail\n new_user = User.new(:account_name => ACCOUNT,\n :ldap_setting_id => ldap_setting.id)\n assert new_user.save\n end", "title": "" }, { "docid": "fa3a163bd9129de66fde2994c43c805d", "score": "0.5856148", "text": "def test_ut_t1_la_ldap_027\n ldap_setting = create_ldap\n assert_equal ldap_setting.auth_method_name, \"LDAP\"\n end", "title": "" }, { "docid": "1d5d1fbb40ec247cb354442ee485d89f", "score": "0.58490545", "text": "def create\n use\n login('root', '')\n Cmd.new(\"devpi user -c '#{new_resource.name}' \\\n password='#{new_resource.password}'\").run_command\n logoff\n end", "title": "" }, { "docid": "98b8b05c987c606f91b85cdbf00e0735", "score": "0.5836277", "text": "def create\n @password = run(\"create -n #{@name} --to-console\").result.split(\"\\n\").last.strip.gsub '\"', ''\n save_password\n self\n end", "title": "" }, { "docid": "1d7766fe041f82e1f2aaa333ac82dee2", "score": "0.5829735", "text": "def valid_signup(name, pwd)\n bad_username = \"The user name should be non-empty and at most 128 characters long. Please try again.\"\n bad_password = \"The password should be at most 128 characters long. Please try again.\"\n user_exists = \"This user name already exists. Please try again.\"\n msg = nil\n if name.nil? or name.length == 0 or name.length > 128\n msg = bad_username\n elsif User.find_by_username(name)\n msg = user_exists\n elsif pwd.length > 128\n msg = bad_password\n end\n end", "title": "" }, { "docid": "20ad36a8212d4fc2ec44bd449410b4ac", "score": "0.58247435", "text": "def create_user(email, pw)\n # user = User.find_or_create_by(email: email) do |user|\n user = User.find_or_create_by(Hydra.config.user_key_field => email) do |u|\n u.email = email\n u.password = pw\n u.password_confirmation = pw\n end\n user\nend", "title": "" }, { "docid": "c8ccc0580093edd3ab2e3b74d2232cfe", "score": "0.5813448", "text": "def create!\n cmd = \"groupadd -f -g #{self.gid} g#{self.app_guid[0..7]}\"\n out,err,ret = shellCmd(cmd)\n unless ret == 0\n raise UserCreationException.new(\"Unable to create group for user. Error: #{err}\")\n end\n \n uid_str = \"\"\n FileUtils.mkdir_p self.basedir\n cmd = \"useradd --base-dir #{self.basedir} -u #{self.uid} -g #{self.gid} -m #{self.name} --comment \\\"#{@app_guid}\\\"\"\n out,err,ret = shellCmd(cmd)\n if ret == 0\n self.homedir = \"#{self.basedir}/#{self.name}\"\n else\n raise UserCreationException.new(\"Unable to create user. Error: #{err}\")\n end\n end", "title": "" }, { "docid": "bf8be6a455b8bd3d399199297a997c92", "score": "0.581325", "text": "def create_result(attribs_in)\n user = CryptIdent.config.repository.create(attribs_in)\n success_for(user)\n rescue Hanami::Model::UniqueConstraintViolationError\n failure_for(:user_already_created)\n rescue Hanami::Model::Error\n failure_for(:user_creation_failed)\n end", "title": "" }, { "docid": "2d5fa1d47b34ee7bf5aa1b4a7e3077eb", "score": "0.5812819", "text": "def create_account name, password\n\n\t\tend", "title": "" }, { "docid": "c92b24239b749b177eb1c3fb98da425a", "score": "0.5812174", "text": "def htpasswd_create(htpasswd_path, pwd_db, owner, user, password)\n # Remove file if it exists\n ::File.delete(pwd_db) if ::File.exist?(pwd_db)\n @cmd = \"#{htpasswd_path}/htpasswd -cmb #{pwd_db} #{user} \\'#{password}\\'\"\n @cmd_out = run_shell_cmd(@cmd, owner) # rely on shell_out! to fail on errors\n Chef::Log.info \"#{pwd_db} updated.\"\n @cmd_out.stdout\nend", "title": "" }, { "docid": "8b9cbaffccad76d28aa54c0d427bf4b2", "score": "0.5811916", "text": "def test_should_not_create_user_with_different_passwords\n user = build_user(\"golias\",\"o grande\",\"11111111\", \"11111112\",\"validemail@domain.com\",1)\n assert !user.save, \"Saved user with different passwords\"\n end", "title": "" }, { "docid": "c4fd084c60d2671fa09b6b778ae463f0", "score": "0.58083075", "text": "def validate_create\n if read_attribute(:password).blank? || read_attribute(:password).length < 5 || read_attribute(:password).length > 40\n errors.add(:password, \"password length must be between 5 and 40 characters\")\n end\n end", "title": "" }, { "docid": "946db713c71ce960127754907a4ef269", "score": "0.5805656", "text": "def passwd_small\n end", "title": "" }, { "docid": "ab0fe06422d4e9bcc64c2c3f6f146abe", "score": "0.5790957", "text": "def test_ut_t1_la_ldap_019\n ldap_setting = LdapSetting.create(:name => NAME,\n :host => HOST,\n :port => 0,\n :base_dn => BASE_DN,\n :attr_login => ATTR_LOGIN,\n :on_the_fly_user_creation => true,\n :attr_mail => \"mail\")\n assert_equal ldap_setting.port, 389\n end", "title": "" }, { "docid": "50710d62da29b1cbe08e2bad4b03f585", "score": "0.5789427", "text": "def create_user(username)\n return if user_exists?(username)\n raise Thor::MalformattedArgumentError unless username.match?(/^(?!-)[\\w.-]+$/)\n\n cmd = %(adduser --disabled-password --gecos '' %<user>s && echo %<user>s:%<password>s | chpasswd)\n system format(cmd, user: username, password: ask_password)\n end", "title": "" }, { "docid": "f092a72b1f7c98991d7cae1d357cb5c8", "score": "0.5788313", "text": "def new_user(line)\n params = Hash.new\n params[:user] = Hash.new\n params[:user][\"email\"] = line[1]\n params[:user][\"firstname\"] = line[14]\n params[:user][\"lastname\"] = line[15]\n params[:user][\"email_parent\"] = line[16]\n params[:user][\"gender\"] = line[17]\n params[:user][\"pe_class_id\"] = line[18]\n user = User.new(params[:user])\n # default password = firstname + lastname + lovetag\n user.password = \"#{params[:user][\"firstname\"]}\" + \"#{params[:user][\"lastname\"]}\" + \"lovetag\"\n user.username = \"#{params[:user][\"firstname\"]}\" + \"#{params[:user][\"lastname\"]}\"\n\n if user.save!\n else\n return user\n end\n end", "title": "" } ]
08a1995fe57bbc9a81770f94d159bf32
Returns the complete list of addresses for this account.
[ { "docid": "94e0e31ae5f3e4a92a9fb3e980681ff1", "score": "0.8435397", "text": "def addresses\n @client.request('getaddressesbyaccount', name)\n end", "title": "" } ]
[ { "docid": "07c26ef25b23726f857e76158428a851", "score": "0.8415047", "text": "def addresses\n collect { |a| a.address }\n end", "title": "" }, { "docid": "8c26bed6c95e61fd7303804d72a52592", "score": "0.78163344", "text": "def addresses\n @addresses ||= init_addresses\n end", "title": "" }, { "docid": "8b57ab416d89597e46ee995845db12a7", "score": "0.77886444", "text": "def addresses\n @addresses\n end", "title": "" }, { "docid": "937494a14ac670834386ca88c5bd2832", "score": "0.77839595", "text": "def addresses\n Array(@addresses)\n end", "title": "" }, { "docid": "de6597930877649da3a7d1b562d9f1a3", "score": "0.7641829", "text": "def addresses\n query(:address)\n end", "title": "" }, { "docid": "730d9e7379a8d332f0d4462e0afebe55", "score": "0.7610325", "text": "def addresses\n IbmCloudRest.get \"#{@uri}/addresses\"\n end", "title": "" }, { "docid": "be68fe3e154f9a8ca4aa3e9f39fcd2d7", "score": "0.76071185", "text": "def list_addresses\n Address.list(@id)\n end", "title": "" }, { "docid": "86feec6fc5bb5cedf019b5c424821952", "score": "0.74958986", "text": "def addresses\n @addresses ||= get_addresses.map do |address_tree|\n Mail::Address.new(address_tree)\n end\n end", "title": "" }, { "docid": "33ab67acc7afaf3e7cdf8e3abea6aaa5", "score": "0.74002594", "text": "def addresses\n # prevent original array from being changed\n @addresses.dup\n end", "title": "" }, { "docid": "41ce5215923103e6c8b103d751522b05", "score": "0.73172617", "text": "def addresses\n options = (token && secret) ? {:access_token => token, :access_secret => secret} : {}\n @addresses ||= Address.find(username, options)\n end", "title": "" }, { "docid": "41ce5215923103e6c8b103d751522b05", "score": "0.73172617", "text": "def addresses\n options = (token && secret) ? {:access_token => token, :access_secret => secret} : {}\n @addresses ||= Address.find(username, options)\n end", "title": "" }, { "docid": "280fb74ff6be7136772dffff9447843d", "score": "0.7316133", "text": "def get_addresses apts\n return apts.map { |apt| apt.address }\n end", "title": "" }, { "docid": "96026c2e822d398144edd69798861987", "score": "0.7311105", "text": "def all(options={})\n response = MLS.get('/addresses', options)\n MLS::Address::Parser.parse_collection(response.body)\n end", "title": "" }, { "docid": "48c82f5ee0707f98c83eaab28e86692f", "score": "0.7204369", "text": "def index\n @account_addresses = AccountAddress.all\n end", "title": "" }, { "docid": "bdc1705c32f6a34463a887782b826e33", "score": "0.7045328", "text": "def getaddressesbyaccount(account)\n coind.getaddressesbyaccount account\n end", "title": "" }, { "docid": "23112fd51c3c1e9b954f84914c7d5cd0", "score": "0.7045159", "text": "def addresses\n warn \"DEPRECATED: use postalAddress from a Person entry\"\n []\n end", "title": "" }, { "docid": "c74993797f6362343bb445e415a95caa", "score": "0.7006349", "text": "def addresses\n message = { nodes: { item: resource[:name]}}\n transport[wsdl].get(:get_address, message)\n end", "title": "" }, { "docid": "cc76e94412aa2de177a388d1c0cb26f5", "score": "0.6996874", "text": "def address_listing\n @addresses = current_user.addresses\n end", "title": "" }, { "docid": "d30a8bb09a92a458466d5110edd4b29b", "score": "0.6944017", "text": "def index\n\t\t@addresses = current_user.addresses\n\tend", "title": "" }, { "docid": "7fd9b511d70b7b159b03f97ad54eafdf", "score": "0.6903164", "text": "def list_wallet_addresses(wallet_id: default_wallet_id)\n call :get, '/wallet/' + wallet_id + '/addresses'\n end", "title": "" }, { "docid": "40869e5b8aa0e0641f52568a63499f15", "score": "0.68351424", "text": "def addresses\n format_entities('gd$structuredPostalAddress', :format_address)\n end", "title": "" }, { "docid": "d8dabe6d2f27510231eced00dcb52013", "score": "0.6807882", "text": "def address\n @client.request('getaccountaddress', name)\n end", "title": "" }, { "docid": "ab03ab0f7c90bdfbf435690cd9457da5", "score": "0.6803946", "text": "def getaddressesbyaccount(account)\n @api.request 'getaddressesbyaccount', account\n end", "title": "" }, { "docid": "646e39dd956938356d6c9be26264667c", "score": "0.67725164", "text": "def from_addresses\n return @from_addresses\n end", "title": "" }, { "docid": "b3ba201d0266bac81c1214c976769d88", "score": "0.6766196", "text": "def get_addresses\n return [get_pubkey_address] if is_pubkey?\n return [get_hash160_address] if is_hash160? || is_namecoin?\n return get_multisig_addresses if is_multisig?\n []\n end", "title": "" }, { "docid": "eb65ace6d46ab6fad07c76581bd0306c", "score": "0.6762983", "text": "def get_addresses\n parsed_script.get_addresses\n end", "title": "" }, { "docid": "6ab11380349e5020f51b9ee8ec887493", "score": "0.67287123", "text": "def index\n @ag_addresses = Ag::Address.all\n end", "title": "" }, { "docid": "4b52bfdb19fc33d3722967633c138d9e", "score": "0.66318923", "text": "def email_addresses\n emails.map(&:address)\n end", "title": "" }, { "docid": "715d12fdc94b5f421ff9197a8e72b1fb", "score": "0.66298753", "text": "def describe_addresses( options = {} )\n options = { :public_ip => [] }.merge(options)\n params = pathlist(\"PublicIp\", options[:public_ip])\n return response_generator(:action => \"DescribeAddresses\", :params => params)\n end", "title": "" }, { "docid": "490d36be8fead6258e8d8fc1ba9eab2b", "score": "0.66250306", "text": "def index\n @user_addresses = current_user.user_addresses\n end", "title": "" }, { "docid": "afe995625a6a3c4dc921e60e871491b9", "score": "0.6609155", "text": "def email_addresses\n\t\treturn [self]\n\tend", "title": "" }, { "docid": "95cd47d4b65bab13d6f27097bc234c3d", "score": "0.6581938", "text": "def to_addresses\n emails = interest_addresses.concat(focus_addresses)\n if emails.empty?\n emails << 'info@unglobalcompact.org'\n end\n emails.uniq\n end", "title": "" }, { "docid": "f30df1a6621d4a69590687d7bfcea373", "score": "0.6537326", "text": "def email_addresses\n begin\n @email_addresses ||= xmlrpc_client.call(\"list_emails\", session_id)\n rescue Timeout::Error => e\n raise \"Error during connection. Please try again later.\" \n end\n end", "title": "" }, { "docid": "e4e14b9a0518e9f7a3026e61101af6d0", "score": "0.6530721", "text": "def index\n @user_addresses = UserAddress.all\n end", "title": "" }, { "docid": "dbf895d81d5e0eb99ebd7fa4731facef", "score": "0.6523601", "text": "def index\n @client_addresses = ClientAddress.all\n end", "title": "" }, { "docid": "f5068db39ef2ae040b977426ecba2ead", "score": "0.65193725", "text": "def address\n\t\t\taddress = [self.address_1, self.try(:address_2), \"#{self.city} #{self.try(:state)}\", \"#{self.try(:zip)}\"].compact\n\t\t\taddress.delete(\"\")\n\t\t\taddress.join(\"<br/>\")\n\t\tend", "title": "" }, { "docid": "95294fd3ec27593f880ebc224856176f", "score": "0.6515311", "text": "def show_addresses(**params)\n get('addresses', params)\n end", "title": "" }, { "docid": "895b79bddbd4ca21b3c3c391f3477dd9", "score": "0.649927", "text": "def init_addresses\n @@client.describe_addresses.addresses\n end", "title": "" }, { "docid": "b2b7a3c69227d024cd5bf3f0130966cd", "score": "0.6498834", "text": "def call_address_service\n addresses = []\n success = call_ok?(:address_search, make_request) do |body|\n ServiceClient.iterate_element(body[:address_list]) do |address|\n add_address(addresses, address) unless address.nil?\n end\n end\n [success, addresses]\n end", "title": "" }, { "docid": "05333b2f87c7a5ead4304619ba32d415", "score": "0.64626783", "text": "def index\n\t\t@addresses = Address.all\t\n\tend", "title": "" }, { "docid": "6c6469b6fedbef26692842c24a6ef3ad", "score": "0.64390457", "text": "def get_to_addresses\n\n return [] if self.to_addresses.nil?\n return self.to_addresses.split(Email::ADDRESS_SEPARATOR)\n end", "title": "" }, { "docid": "6b956bf4d5b04e486974c0cf71e71390", "score": "0.643872", "text": "def addresses; end", "title": "" }, { "docid": "20a3359ff2c03a61aed64f85cc88aae2", "score": "0.6403656", "text": "def public_addresses\n details['addresses']['public'].map { |i| i[\"addr\"] }\n end", "title": "" }, { "docid": "d97a58dfff7ef1a566ce37c58971d497", "score": "0.6394167", "text": "def addresses\n return @addresses if @addresses\n @addresses = []\n @report.lines.each do |l|\n a = Crashreport.address_from_report_line(l)\n @addresses << a if a\n end\n @addresses\n end", "title": "" }, { "docid": "4e68c82389dcce3d57c1b4259e7707ce", "score": "0.6332254", "text": "def to_address\n out = []; @envelope.to_addrs.each{|a| out.push(a.address)}\n return out\n end", "title": "" }, { "docid": "b41fbdda32bc1b6bc02fd7840b77ba4b", "score": "0.6323102", "text": "def index\n @ripple_addresses = RippleAddress.all\n end", "title": "" }, { "docid": "9fc786eaec199c17739c2fb38748eafb", "score": "0.63222754", "text": "def show\n\t @addresses = @user.addresses\n end", "title": "" }, { "docid": "e27394d84f265906a831b485b325ef0f", "score": "0.6320096", "text": "def address\n [address1, address2, city, state, zip].compact.join(', ')\n end", "title": "" }, { "docid": "9455dbefbd7a9210f37d69796fe85ca0", "score": "0.6319302", "text": "def order_billing_address_lines\n order.bill_address.try(:full_address_array)\n end", "title": "" }, { "docid": "1ec80f41052bcbaa8ee51cd69fb932c7", "score": "0.63114184", "text": "def index\n @vendor_addresses = VendorAddress.all\n end", "title": "" }, { "docid": "e8c10f348fdf1fbac4daccdffe841b38", "score": "0.6286105", "text": "def getaddressesbyaccount(account)\n request :getaddressesbyaccount, account\n end", "title": "" }, { "docid": "681370d30b7fd3700af982e1296a8f08", "score": "0.6278692", "text": "def addresses\n private_ip_addresses + public_ip_addresses\n end", "title": "" }, { "docid": "0483e6cb56c0f9d0d9a0c40b9be56f59", "score": "0.62784725", "text": "def index\n @sales_addresses = Sales::Address.all\n end", "title": "" }, { "docid": "dd35975f0fb65bca095c3796595d82dd", "score": "0.62769896", "text": "def address\n [address_line_1, address_line_2, town_city, county, postcode].join(\", \")\n end", "title": "" }, { "docid": "6ff3851a02cf730c8a54fbef16195006", "score": "0.62647456", "text": "def address_details\n @address_details ||= user.addresses.map { |address| AddressDetails.new user, address }\n end", "title": "" }, { "docid": "6f10369624afedac62882e16a1ddd670", "score": "0.626261", "text": "def index\n @addresses = Address.all\n end", "title": "" }, { "docid": "6f10369624afedac62882e16a1ddd670", "score": "0.626261", "text": "def index\n @addresses = Address.all\n end", "title": "" }, { "docid": "32ccf4dcaa99c6e823cf0120d6514b51", "score": "0.6261557", "text": "def list\n @ses.request('ListVerifiedEmailAddresses')\n end", "title": "" }, { "docid": "2d32c2003e56d153034057efef7f014f", "score": "0.6257726", "text": "def address\n [address1, city, state, country, zip].compact.join(', ')\n end", "title": "" }, { "docid": "218ab5b1d610edeb95fe4b05c6cc012d", "score": "0.62202203", "text": "def get_bcc_addresses\n\n return [] if self.bcc_addresses.nil?\n return self.bcc_addresses.split(Email::ADDRESS_SEPARATOR)\n end", "title": "" }, { "docid": "9731068363dcee53744921adbe174e6b", "score": "0.62129164", "text": "def get_cc_addresses\n\n return [] if self.cc_addresses.nil?\n return self.cc_addresses.split(Email::ADDRESS_SEPARATOR)\n end", "title": "" }, { "docid": "29c95395835b5b6c5c1949aed05455f8", "score": "0.61841834", "text": "def address_list\n $tracer.trace(format_method(__method__))\n return ProfileAddressList.new(@tag.find.span.className(create_ats_regex_string(\"ats-addrpanel\")), format_method(__method__))\n end", "title": "" }, { "docid": "6d921cdea57eabe6494eccc8e4ba9054", "score": "0.6167422", "text": "def getaccountaddress(account)\n coind.getaccountaddress account\n end", "title": "" }, { "docid": "63f10b44457e3f4091b714ba340064e6", "score": "0.6151184", "text": "def address\n [street, city, zip, state].compact.join(\", \")\n end", "title": "" }, { "docid": "e518eb8eaf60fa0c1e91f271407c5c12", "score": "0.61510855", "text": "def accounts\n account_data = request('listaccounts')\n account_data.map do |account_name, account_value|\n Account.new(self, account_name, account_value, false)\n end\n end", "title": "" }, { "docid": "6598d4d6d74e0a65c8f15fa441c78b3a", "score": "0.61457485", "text": "def address\n [city, state, country].compact.join(', ')\n end", "title": "" }, { "docid": "7217df4b427df0bca21a67fa2bc8ffc8", "score": "0.61344814", "text": "def index\n @customer_addresses = CustomerAddress.all\n end", "title": "" }, { "docid": "97d00082f074c3a0168dd3e272c26940", "score": "0.6131584", "text": "def address\n [street, city, state, country].compact.join(', ')\n end", "title": "" }, { "docid": "4b7249514683415b5e07ec2397bb528d", "score": "0.61141235", "text": "def address_list_for(emails, retried = false)\n emails = emails * \", \"\n list = Mail::AddressList.new(self.class.unescape(emails))\n addrs = list.addresses.each { |a| a.decoded }\n addrs.uniq!\n addrs\n rescue Mail::Field::ParseError\n if retried\n raise\n else\n address_list_for(emails.scan(EMAIL_REGEX), true)\n end\n end", "title": "" }, { "docid": "95da90bf0e314c1746676054ac5adfce", "score": "0.61140686", "text": "def address\n [address1, address2, city, state, zip].compact.join(', ')\n end", "title": "" }, { "docid": "8b0ece5e71e082716ff4f04619b6f624", "score": "0.6111111", "text": "def index\n @addresses = current_user.addresses\n @address = Address.new\n end", "title": "" }, { "docid": "aa603a4c101809bd6ee5aa7943d8efb0", "score": "0.61055976", "text": "def full_address\n [address, city, state, zipcode, country].compact.join(\", \")\n end", "title": "" }, { "docid": "3799ebe6c1f608e7be5e10fe60a48523", "score": "0.61041564", "text": "def index\n @electronic_addresses = ElectronicAddress.all\n end", "title": "" }, { "docid": "3302617dc86160b1b2b3f2c30dd0f853", "score": "0.6089604", "text": "def order_ship_address_lines\n order.ship_address.try(:full_address_array)\n end", "title": "" }, { "docid": "fb7ee0cfc2634044640982a8cf286a83", "score": "0.60844165", "text": "def ip_addresses\n @entries.collect do |entry|\n entry.ip_address\n end.compact || []\n end", "title": "" }, { "docid": "3d09c8d514d8115190f4e81bad266e8d", "score": "0.60837823", "text": "def getEmailList\n\t\tdata = index()\n\t\temailList = []\n\t\tdata.each do |person|\n\t\t\temailList.push(\"#{person[\"email_address\"]}\")\n\t\tend\n\t\treturn emailList\n\tend", "title": "" }, { "docid": "0737bb5808c09b688e0277247cf39108", "score": "0.6072187", "text": "def index\n @post_addresses = PostAddress.all\n end", "title": "" }, { "docid": "db40e3ce2be8dc12939de36dc8a1365b", "score": "0.6066963", "text": "def available_addresses\n @subnet.hosts(range: allocation_range, exclude: reserved_addresses)\n end", "title": "" }, { "docid": "d2c310c49921b8845fb895251b6ea338", "score": "0.60582995", "text": "def full_address\n addr = []\n addr << country.try(:name) if show_country\n addr << (state.try(:name).presence || state_name) if show_state\n addr << address1\n addr.compact.join(', ')\n end", "title": "" }, { "docid": "68efb79b927e3ebc57f2ee3ec1a15e39", "score": "0.605379", "text": "def index\n @adresses = Adress.all\n end", "title": "" }, { "docid": "f8a2e6d590c58a9b6ccf460a20ac8f65", "score": "0.6049779", "text": "def full_address\n [self.address, \"Madrid\", \"Spain\"].compact.join(\", \") if self.address\n end", "title": "" }, { "docid": "5b3c6d4d294085ef41275d0d79f7819b", "score": "0.6041982", "text": "def mailing_address\n return unless @user.loa3?\n\n dig_out('addresses', 'address_pou', VAProfile::Models::Address::CORRESPONDENCE)\n end", "title": "" }, { "docid": "c9c08fdb70871c61b8036a4436de2125", "score": "0.6039792", "text": "def index\n\t@addresses=current_user.addresses\nend", "title": "" }, { "docid": "423455dac08a64f519bb338f11ca0aae", "score": "0.60382", "text": "def getaddresses(name)\n return [name] if ADDRESS_REGEX.match(name)\n @resolvers.each do |resolver|\n addresses = []\n resolver.each_address(name) { |address| addresses << address }\n return addresses unless addresses.empty?\n end\n []\n end", "title": "" }, { "docid": "ed4d7881bda594e769b3685baaeaecf4", "score": "0.60327554", "text": "def fs_contact_addresses\n fs_contact_addresses_array.join(',')\n end", "title": "" }, { "docid": "9191c75f0c2020818b7fd6f19f9f8a61", "score": "0.6030587", "text": "def listIPs\n MU::Cloud::AWS::Server.getAddresses(cloud_desc).first\n end", "title": "" }, { "docid": "12db2f45d472f9b4d093e1008c2fc143", "score": "0.6027862", "text": "def addresses=(addresses)\n set_collection(CapsuleCRM::Address, addresses)\n end", "title": "" }, { "docid": "9b2c7732fa29fa35cc6bfd289cf92622", "score": "0.6021088", "text": "def address_list_fetch(field_name)\n if values = fetch_all(field_name, nil)\n list = nil\n values.each { |value|\n if list\n list.concat(Address.parse(value))\n else\n list = Address.parse(value)\n end\n }\n if list and !list.empty?\n list\n end\n end or RMail::Address::List.new\n end", "title": "" }, { "docid": "3f6f3f281c72d30f7e0451e4e28e6f8d", "score": "0.60188246", "text": "def from_addresses=(value)\n @from_addresses = value\n end", "title": "" }, { "docid": "08c4fa213e5d4943e57ffe54282fa4a2", "score": "0.6010258", "text": "def accounts\n return [] if self.id.nil?\n @accounts ||= \n OrgSync::Base.request(\"#{self.class.endpoint}/#{self.id}/accounts\", {}, @api_key).map { |json| \n OrgSync::Account.new(json, @api_key) \n }\n end", "title": "" }, { "docid": "a9181dfbdf3b589f79caa540bee198b9", "score": "0.6004893", "text": "def full_address\n [ address, city, state, zipcode, country ].compact.join(', ')\n end", "title": "" }, { "docid": "8ed8ebb3cfea8b4612140c876f7d53ed", "score": "0.5990371", "text": "def get_whitelist_contract_addresses\n r = success_with_data({contract_addresses: ClientWhitelistDetail.get_active_contract_addressess})\n render_api_response(r)\n end", "title": "" }, { "docid": "7036b719c2246eeedb610577d07e7a51", "score": "0.59896517", "text": "def index\n @reserved_addresses = ReservedAddress.all\n end", "title": "" }, { "docid": "0b2e30c1f9944ab02aa6590638b64f99", "score": "0.59867954", "text": "def index\n @person_addresses = PersonAddress.all\n end", "title": "" }, { "docid": "c71546a990130fe119186f29df106d61", "score": "0.5972986", "text": "def address\n\t [inst_add1, inst_add2, inst_city, inst_state, inst_zip].compact.join(\", \")\n\tend", "title": "" }, { "docid": "ff6778896e99c77a2ae320a9d61027ae", "score": "0.5966567", "text": "def index\n @host_addresses = HostAddress.all\n end", "title": "" }, { "docid": "c31ee1127fd947a30dc0b81a49e242ef", "score": "0.59657145", "text": "def full_address\n\t\t[address1, address2, city, state, zipcode].join(', ')\n\tend", "title": "" }, { "docid": "c93d6aec0b32a030674f8ce1667392dc", "score": "0.5953957", "text": "def accounts\n db.accounts.map do |raw|\n a = Account.parse_from_payload(raw)\n a.wallet = self\n a\n end\n end", "title": "" }, { "docid": "ec2af888cccbf19bbc77fcabdb6d7692", "score": "0.59476453", "text": "def index\n @address_records = AddressRecord.all\n end", "title": "" }, { "docid": "accec814878385b28588716e1fb165c1", "score": "0.5944178", "text": "def address_array(visibility_limit = visibility)\n return [] if visibility_limit == self.class.no_visibility\n\n start_index = self.class.visibility_items.index { |viz_item| viz_item == visibility_limit }\n return [] unless start_index\n\n viz_items_length = self.class.visibility_items.length\n\n # Create the array with the actual values of the address.\n # Add in the kommun name if there is one for the address.\n if kommun\n ary = [street_address, post_code, city, kommun.name,\n sverige_if_nil][start_index..viz_items_length]\n else\n ary = [street_address, post_code, city,\n sverige_if_nil][start_index..(viz_items_length - 1)]\n end\n ary.delete_if { |f| f.blank? }\n end", "title": "" } ]
bcdefa3832aec3944d22cda53e6612bb
Clear all paths and start fresh. There is no mechanism for reordering paths, so its best to completely wipe the paths list and reappend them in the order you want.
[ { "docid": "e4b55b75470ed5ea2cfd1b498b9fa2e7", "score": "0.7382582", "text": "def clear_paths\n @trail.paths.dup.each { |path| @trail.remove_path(path) }\n end", "title": "" } ]
[ { "docid": "3f6f28d46b6b6535449a2b572f96c8d4", "score": "0.789757", "text": "def clear!\n @paths = []\n end", "title": "" }, { "docid": "02f2a5d45ae4a3724d2a95d8fe7c3ee2", "score": "0.76791525", "text": "def clear_paths\n @paths.clear\n end", "title": "" }, { "docid": "0a8530b1ad74e199bb49ebb2775fd178", "score": "0.75972164", "text": "def clear_path\n self.path = []\n end", "title": "" }, { "docid": "8833ab6f806aa8a7e89f2c7da93f1508", "score": "0.7226594", "text": "def clear_paths\n expire_index!\n @trail.paths.each { |path| @trail.remove_path(path) }\n end", "title": "" }, { "docid": "a1cebb499a075d033621336764371ea3", "score": "0.7029542", "text": "def clear_paths\n mutate_config(:paths) do |paths|\n paths.clear\n end\n end", "title": "" }, { "docid": "5b42e77a7d9c24ca19cbceab876590ff", "score": "0.6969098", "text": "def clean\n @paths = {}\n @paths[''] = Path.new(self, '')\n @prepares = []\n self\n end", "title": "" }, { "docid": "fc20d2f0e86997dc0cec7695470c3bf9", "score": "0.6588253", "text": "def reset!\n @base_dir = @path = nil\n end", "title": "" }, { "docid": "ad0c70924154a6a9aa71fe15226e9a5b", "score": "0.65682226", "text": "def clear_atomic_path_cache\n self.path = nil\n _base.instance_variable_set(\"@atomic_paths\", nil)\n end", "title": "" }, { "docid": "ad7eda00b67e374b91e7f66ecd1ea8e5", "score": "0.6481658", "text": "def reset!\n @path_stack = []\n @stack = []\n @stacks = Hash.new { |hsh, k| hsh[k] = Stack.new }\n @text = nil\n end", "title": "" }, { "docid": "1a7ff8b4699b01ec18cb25db87a83f19", "score": "0.64369583", "text": "def clear\n @directory.clear\n @directory[ROOT] = Set.new\n @file.clear\n @mtime.clear\n end", "title": "" }, { "docid": "8686c8c5f04644d0734ef798ab63ca75", "score": "0.6319037", "text": "def reset_paths\n @public_path = nil\n @view_path = nil\n end", "title": "" }, { "docid": "0e49a2847c1939968de8ee2dca870c91", "score": "0.6313546", "text": "def reset\n FileUtils.remove_file(@path)\n end", "title": "" }, { "docid": "67a6e13e8b5f74d73c4f18edcd026cf6", "score": "0.6195694", "text": "def reset!\n @routes = []\n @current_order = 0\n @prepared = nil\n end", "title": "" }, { "docid": "37f45212eb90066169e0e7cf99366b42", "score": "0.6158236", "text": "def cleanup(paths)\n item = path_tree.descend(paths)\n item.cleanup \n save_path_tree\n # print what happened here\n print_depth item\n end", "title": "" }, { "docid": "d2f6eaaba14bf56a86af20f53eb1875f", "score": "0.61077416", "text": "def populate_clearings\n make_all_clearings\n create_paths_for_clearings\n end", "title": "" }, { "docid": "28c9648f55b91fc2eab32d452f361d62", "score": "0.607191", "text": "def clear!\n\t\t\tself.tree = []\n\t\t\tself.current = tree\n\t\tend", "title": "" }, { "docid": "60a5974e600b28bc5f184f3bfdcac9ca", "score": "0.59932745", "text": "def clear\n FileUtils.rm_rf(path)\n end", "title": "" }, { "docid": "023918563e8b58e47d29b253709dc447", "score": "0.5956879", "text": "def refresh!\n @roots.keys.each { |key| @roots[key].delete(:up_to_date) }\n end", "title": "" }, { "docid": "2d3782476b470d003a5abc6f73a6651a", "score": "0.5953715", "text": "def back_paths!\n path_ids = session[:path_ids]\n new_path_ids = path_ids.split( \"|\" )\n new_path_ids.pop\n \n path_names = session[:path_names] \n new_path_names = path_names.split( \"|\" )\n new_path_names.pop\n \n update_paths!( new_path_ids.join( \"|\" ), new_path_names.join( \"|\" ) )\n end", "title": "" }, { "docid": "3d34993606ce26478f13f2365272af3b", "score": "0.59361374", "text": "def reset\n @folder_ids = []\n @base_shape = :default\n @email_address = nil\n end", "title": "" }, { "docid": "477f309e469a7fdfd11092f722fe6945", "score": "0.59330195", "text": "def clean(paths)\n paths.uniq!\n paths.compact!\n populate_test_files\n paths = paths.select { |p| test_file?(p) }\n clear_tests_files_list\n paths\n end", "title": "" }, { "docid": "5b3231082371689f4d384b1b9d9bd7e9", "score": "0.5920173", "text": "def stage_clear\n stage_safe!\n Dir['*'].each do |path|\n #p path\n FileUtils.rm_r(path)\n end\n end", "title": "" }, { "docid": "3c42e5f67321f4a88f5a42c7ead44db3", "score": "0.5911547", "text": "def reset!\n @routes = []\n @current = 0\n @prepared = nil\n end", "title": "" }, { "docid": "bb81f9cabb87beda01dd3f7cd2627fb5", "score": "0.59057295", "text": "def clear\n @files.clear\n end", "title": "" }, { "docid": "e3da9d6baf14a64ee52231f7cf5adc5d", "score": "0.58607316", "text": "def delete_blank_paths\n self.each { |v| v.delete_blank_paths if v.respond_to?(:delete_blank_paths) }\n self.delete_blanks\n end", "title": "" }, { "docid": "3e8c139c8ae232fefaac11137bf02da5", "score": "0.5823362", "text": "def reset\n @file_extensions = []\n @file_patterns = []\n @check_patterns = []\n end", "title": "" }, { "docid": "bfcd32f5cb9912182523ea1b5012a079", "score": "0.5812969", "text": "def reset\n @parent_folder_id = nil\n @traversal = :shallow\n @base_shape = :all_properties\n @email_address = nil\n end", "title": "" }, { "docid": "6a1cda2e6c9113a61a01add14c18aacc", "score": "0.5807457", "text": "def unfinish(paths)\n if paths.empty?\n raise Plan::Advice.new('please drill down to a level to unfinish')\n end\n # go to the right depth and unfinish\n item = path_tree.descend(paths)\n item.unfinish!\n save_path_tree\n # print what happened here\n print_depth item\n end", "title": "" }, { "docid": "bf69d3080977fef7b3d4f2778afac3ad", "score": "0.5805702", "text": "def clean_up\n FileUtils.rm_rf \"#{@path}\" unless create_in_current_directory?\n FileUtils.rm_rf \"#{@cache}\"\n end", "title": "" }, { "docid": "5b947d2fb63d795e28f9a872c0204a52", "score": "0.5802297", "text": "def clean_paths\n FileUtils.rm_rf(tmp_path)\n FileUtils.mkdir_p(tmp_path)\n end", "title": "" }, { "docid": "d23681fa15cc87e33d02259ed3152f48", "score": "0.5797543", "text": "def clear_path_results(path)\n [path_assets_key(path), path_links_to_key(path), path_linked_to_from_key(path)].each do |key|\n redis.del key\n end\n end", "title": "" }, { "docid": "49f20f8072a961eaf682d63fb1a80276", "score": "0.5781232", "text": "def update_paths!\n paths = Hash[*roots.map { |r| \n r.self_and_descendants.map { |n| [n.id, { 'path' => n.send(:build_path) }] } }.flatten]\n update paths.keys, paths.values\n end", "title": "" }, { "docid": "9cdf3eca86841381c85ad3b486b046e7", "score": "0.5779275", "text": "def clear(path)\n set_internal(path, nil)\n end", "title": "" }, { "docid": "13d88b757a24af71de56fbcbaccabb81", "score": "0.577309", "text": "def initPaths( path )\n\t\t@path = Array::new(path) # ruby does assignments by reference\n\t\tif @type != 'text'\n\t\t\t@content.each_index { |i|\n\t\t\t\tif i-1 >= 0\n\t\t\t\t\t@content[i-1].next = @content[i]\n\t\t\t\tend\n\t\t\t\tif i+1 < @content.length\n\t\t\t\t\t@content[i+1].prev = @content[i]\n\t\t\t\tend\n\t\t\t\t@content[i].parent = self\n\t\t\t\t@content[i].initPaths( path.push(i) )\n\t\t\t\tpath.pop\n\t\t\t}\n\t\tend\n\tend", "title": "" }, { "docid": "d233f8bb979207ab6c6c2369a55c2608", "score": "0.5723206", "text": "def reset\n clear\n load_from(REGISTRY_PATH)\n end", "title": "" }, { "docid": "7be4a045315b9d15607284442aee59c9", "score": "0.57076037", "text": "def clear\n Dir[File.join(@output_dir, '*')].each do |path|\n File.delete(path)\n end\n end", "title": "" }, { "docid": "83766774a0e37522a0b09c8a994e58ce", "score": "0.5688402", "text": "def clear_start\n each(&:clear_start)\n self\n end", "title": "" }, { "docid": "4058755ec247f01d03dd89433bd33556", "score": "0.56874156", "text": "def assign_paths\n self.path = generate_path(self)\n end", "title": "" }, { "docid": "48481a53473b076e8e01c9f10f780a34", "score": "0.56786567", "text": "def clear\n Dir[File.join(@output_dir, '*.json')].each do |path|\n File.delete(path)\n end\n end", "title": "" }, { "docid": "f4bc03631e96fd1cffaa87c87281dabe", "score": "0.5658854", "text": "def clear\n @root = nil\n end", "title": "" }, { "docid": "70705d3fdc455a26ef3c4ff14b5b2628", "score": "0.56329507", "text": "def reload!\n @paths = {}\n\n files.each do |file|\n @paths[file.path] = file\n @paths[file.path_without_extension] ||= file\n end\n\n @paths.freeze\n end", "title": "" }, { "docid": "46dc0a0e53b53ca01eb4ee65ec79606f", "score": "0.55992943", "text": "def reset\n @perms = []\n @depends = []\n @next_blocks = []\n @clobbers = []\n @offset = nil\n @state = nil\n @once = false\n @references = 0\n @used_references = 0\n @generated = false\n end", "title": "" }, { "docid": "b93b9af20690602e96fa2bbf7650b139", "score": "0.55988216", "text": "def reset\n @lookup_paths = {} # (Hash.new)\n @tree = Rack::App::Router::Tree.new\n compile_registered_endpoints!\n end", "title": "" }, { "docid": "a62e644a527516459d81a64e5de9166f", "score": "0.55885285", "text": "def undo \n if(@hasExecuted==true and (File::exist?(@newPath)))\n FileUtils.cp_r(@newPath, @ogPath)\n FileUtils::rm_r(@newPath)\n @hasExecuted=false\n end\n end", "title": "" }, { "docid": "2e182c790890842f37a56c8d86cf3575", "score": "0.55873966", "text": "def clear\n raise \"unsafe test stage directory -- #{Dir.pwd}\" unless /#{Dir.tmpdir}/ =~ Dir.pwd\n Dir['*'].each do |path|\n FileUtils.rm_r(path)\n end\n end", "title": "" }, { "docid": "cc2f2ec79b6e77d13b67acca1f98ec64", "score": "0.5585311", "text": "def redo_path\n self.path = @temp_path\n end", "title": "" }, { "docid": "cc3a5f661a11c4cee7c8fe295c976ed7", "score": "0.5576157", "text": "def invalidate_path\n @path_calculated = false\n @path = nil\n @path_index = 0\n end", "title": "" }, { "docid": "e08eb65c0d496a29625ff2b7c356ca2e", "score": "0.5574887", "text": "def reset\n @collection = []\n end", "title": "" }, { "docid": "c1bd1d9d7c8fbe833a587df13c599529", "score": "0.5567852", "text": "def reset\n @routes.clear\n end", "title": "" }, { "docid": "694791fc53313e0ac643f2875ba749f1", "score": "0.5548715", "text": "def clear_nodes\n\t\t\t@tree = []\n\t\t\t@node_stack = [ @tree ]\n\t\tend", "title": "" }, { "docid": "9e27f2b677ae44816bc7cb7005d3da73", "score": "0.55447316", "text": "def reset\n\t\t@lineno = 0\n\t\t@filelineno = 0\n\t\t@filename = @files.first\n\t\t@index = 0\n\t\t@lines = nil\n\tend", "title": "" }, { "docid": "783417821cc5848be72e42bb91a58961", "score": "0.55407053", "text": "def reset!\n @file_path = nil\n load force: true\n end", "title": "" }, { "docid": "0084cb741c5c3b2f19e441b88902910d", "score": "0.55141324", "text": "def reset\n @lists = {}\n @references = {}\n @serialized = {}\n @graphs = {}\n @subjects = {}\n end", "title": "" }, { "docid": "955fa6184bf98a2c8ab5e740cb339b32", "score": "0.55100834", "text": "def reset\n @sets = {}\n self\n end", "title": "" }, { "docid": "3b62c21c06477cc03f4fa5748ecbbc88", "score": "0.550657", "text": "def reset!\n self.words_for_last = []\n self.corpus_dfs = {}\n self.block_list = []\n self.single_block = []\n end", "title": "" }, { "docid": "5cba8482775a0c0f6028ff7a15124040", "score": "0.5493233", "text": "def undo()\r\n Dir.delete(@DirectoryPath)\r\n end", "title": "" }, { "docid": "ffc588f6a444c927074d181e1022e6ae", "score": "0.54870594", "text": "def flush\n @lists = nil\n end", "title": "" }, { "docid": "125da432f881014ed2b4d4d42802d163", "score": "0.54764354", "text": "def clear\n\t\t@predecessor = nil\n\t\t@visited = false\n\t\t@node_string = \" \"\n\tend", "title": "" }, { "docid": "a9be05dfd5227a5a27a22f19630024d5", "score": "0.5474128", "text": "def refresh_watchers()\r\n paths = []\r\n\r\n # A list of all file paths the user passed in.\r\n unresolved_paths = @path.split(',')\r\n unresolved_paths = unresolved_paths.size == 0 ? @path : unresolved_paths\r\n\r\n # Glob all file paths and keep all readable files.\r\n for unresolved_path in unresolved_paths\r\n paths += Dir.glob(unresolved_path.strip).select do |resource|\r\n File.file?(resource) && File.readable?(resource)\r\n end\r\n end\r\n\r\n watched = @watched_files.keys\r\n\r\n # Files we are not yet watching.\r\n new_files = paths - watched\r\n\r\n # Files we are watching that no longer exist.\r\n dead_files = watched - paths\r\n\r\n start_watches(new_files)\r\n stop_watches(dead_files, true)\r\n end", "title": "" }, { "docid": "488561862f1e87f053e4ef915b153c1f", "score": "0.54725426", "text": "def refresh\n list.clear\n\n Ginatra.load_config[\"git_dirs\"].map do |git_dir|\n if Dir.exist?(git_dir.chop)\n dirs = Dir.glob(git_dir).sort\n else\n dir = File.expand_path(\"../../../#{git_dir}\", __FILE__)\n dirs = Dir.glob(dir).sort\n end\n\n dirs = dirs.select {|f| File.directory? f }\n dirs.each {|d| add(d) }\n end\n\n list\n end", "title": "" }, { "docid": "391cb5b44e332878aa307a921de224fa", "score": "0.5466713", "text": "def reset\n @is_echoed_prefix = true;\n @entries = []\n @curr_entry = nil\n @common_prefixes = []\n @common_prefix_entry = nil\n @curr_text = ''\n end", "title": "" }, { "docid": "9efdacf49fb578104958d8fd72b96c29", "score": "0.54551405", "text": "def reset\n clear\n @position = 0\n @current_index = 0\n end", "title": "" }, { "docid": "a756ecce4ff0f10ec73b6b57b59f6e8a", "score": "0.5451574", "text": "def reset\n each(&:reset)\n self\n end", "title": "" }, { "docid": "ddaac580f717af6583e8e5e3d4282ee3", "score": "0.54434294", "text": "def clear\n @list = []\n end", "title": "" }, { "docid": "0953075c0ee8875a10ef6c794067c1f1", "score": "0.5441271", "text": "def clear\n synchronize do\n erase_history\n end\n end", "title": "" }, { "docid": "1dd608b8728a90514b7bf75e99ef347c", "score": "0.5439171", "text": "def reset\n @entries = []\n @owner = nil\n @curr_bucket = nil\n @curr_text = ''\n end", "title": "" }, { "docid": "e05e2e4d4a86ace0885719bb963b69ad", "score": "0.5438297", "text": "def pop_dir\n # the first time we pop, we need to put the current on stack\n @visited_dirs.push Dir.pwd unless @visited_dirs.index(Dir.pwd)\n ## XXX make sure thre is something to pop\n d = @visited_dirs.delete_at 0\n ## XXX make sure the dir exists, cuold have been deleted. can be an error or crash otherwise\n @visited_dirs.push d\n Dir.chdir d\n @current_dir = Dir.pwd # 2019-04-24 - earlier was in post_cd but too late\n post_cd\n rescan_required\nend", "title": "" }, { "docid": "442428f9f8fa3ac64aeb1a8face326a8", "score": "0.5433918", "text": "def prepend_paths(*paths)\n self.paths.unshift(*paths)\n end", "title": "" }, { "docid": "a898e3df6f24f348a2ef6e5c6be31650", "score": "0.54332197", "text": "def clear\n start\n end", "title": "" }, { "docid": "b365909f47a2db1db56db96b6ed5a55a", "score": "0.54308397", "text": "def clear\n @ProjectFileLoader.LoadedProjectFiles().each do |projectFile|\n projectFile.clear()\n end\n end", "title": "" }, { "docid": "e3d07842d4bb146338ff8e5b9926e213", "score": "0.5425467", "text": "def reset!\n @root = Root.new(self)\n @request_methods_specified = Set.new\n @routes = []\n @named_routes = {}\n @variable_names = Set.new\n end", "title": "" }, { "docid": "e0d49e0899142847e7ce1077d46243a8", "score": "0.5424575", "text": "def reset()\n @current = [1,2,3]\n end", "title": "" }, { "docid": "77e6e06f27eeaf203b225a4e3568278a", "score": "0.5416448", "text": "def reset\n cleanup(true)\n end", "title": "" }, { "docid": "26c3b0662c3c3e219f5378f8723c37ea", "score": "0.54106826", "text": "def clear_stored_results\n paths = get_stored_paths\n redis.pipelined do\n paths.each do |path|\n [stored_paths_key, paths_visited_key, paths_to_visit_key].each do |key|\n redis.del key\n end\n\n clear_path_results(path)\n end\n end\n end", "title": "" }, { "docid": "b780f1b4e0a319cc9a8a1badd5db8f42", "score": "0.5410316", "text": "def clear()\n shutdown()\n @tasks = {}\n _clear()\n end", "title": "" }, { "docid": "0f86cc13b2ce05105b035c3e7a0aba82", "score": "0.5399504", "text": "def clear!\n context_manager.clear!\n breadcrumbs.clear!\n end", "title": "" }, { "docid": "71ab384b713a7103dd4ebfd99c8255c8", "score": "0.53929526", "text": "def clean(path)\n path.dirname.ascend do |pathname|\n if Dir.empty?(pathname) && pathname != directory\n pathname.rmdir\n else\n break\n end\n end\n end", "title": "" }, { "docid": "35f66be963931f8c9800d4fc0a60d66c", "score": "0.5392908", "text": "def setPath(path)\n @currentPath = path.clone\n @root = @currentPath.getRoot unless path.empty?\n end", "title": "" }, { "docid": "0b28064b2fa954469fa550261224c3f4", "score": "0.53897727", "text": "def rewind\n @tree_iterator.rewind\n end", "title": "" }, { "docid": "bcbe2b1339b6cae2baec2f9aca2c914b", "score": "0.53855765", "text": "def rm(*paths)\n paths.each {|path| self[path] = nil }\n self\n end", "title": "" }, { "docid": "d05a47acee0fb515eb00d0496e6b25b4", "score": "0.53800285", "text": "def unmark_all!\n STDERR.puts \"unmark_all!\" if @trace > 0\n return if @paths.empty?\n @paths = @paths.reject {|x| x.instance_of? Proc}\n end", "title": "" }, { "docid": "c803b655d77f110c136925aee0f4454c", "score": "0.53715974", "text": "def clear\n ve 'rm(list=ls())'\n end", "title": "" }, { "docid": "cc11447471b72134269fd9b06845d431", "score": "0.5362675", "text": "def reset!\n @root = Node::Root.new(self, request_methods)\n @named_routes = {}\n @routes = []\n @grapher = Grapher.new(self)\n @priority_lookups = false\n end", "title": "" }, { "docid": "4ef6b608e5711845fdad3de607da5e24", "score": "0.5356014", "text": "def clear\n @include = []\n @exclude = []\n @sources = FileList[]\n @mapper = Mapper.new\n self\n end", "title": "" }, { "docid": "874252a93ab5821365f966a5223de4af", "score": "0.5354543", "text": "def reset\r\n free\r\n @requested = []\r\n end", "title": "" }, { "docid": "c7f9e6ada4082cbe1b6dfb98c4743524", "score": "0.53536665", "text": "def clear\n @nodes = Hash.new\n @ways = Hash.new\n @relations = Hash.new\n end", "title": "" }, { "docid": "b7770009d8c77c0d8b833b1327be0458", "score": "0.53478885", "text": "def reset\n @storage = []\n end", "title": "" }, { "docid": "5ea5c45258bca116093c264b22f0b488", "score": "0.5337875", "text": "def resetLists()\n\t`rm -rf outputList.txt`\n\t`rm -rf outputListFinal.txt`\n\t`touch outputList.txt`\n\t`touch outputListFinal.txt`\nend", "title": "" }, { "docid": "cabc90408aa5c0a2fe979edefaf67c02", "score": "0.53374135", "text": "def flush\n Dir[ File.join( store, '*.cache' ) ].each do |file|\n File.delete(file)\n end\n end", "title": "" }, { "docid": "8426d2a15185c0484b375ee33d68300c", "score": "0.53359044", "text": "def clear!\n @all = Set.new\n end", "title": "" }, { "docid": "1b9e52cca041538b7a6b5a26707e8cc0", "score": "0.53232855", "text": "def clear\n @list = []\n end", "title": "" }, { "docid": "0a3e4ff2654aa650792eda02ba5dd563", "score": "0.531984", "text": "def reset\n super\n @first_iteration = true\n end", "title": "" }, { "docid": "c232425f345b200db91bd72901a914da", "score": "0.5317268", "text": "def reload # :nodoc:\n @ordered_objects = nil\n ordered_objects\n super\n end", "title": "" }, { "docid": "f481da9f3ef1b2a96f2d3cc7d4861e8a", "score": "0.53171754", "text": "def remove_paths(*args)\n args.each {|arg| load_paths.delete(arg)}\n end", "title": "" }, { "docid": "c1ab776065dee705eaa33d66d90eaeef", "score": "0.531558", "text": "def reset\n @item_ids = []\n @base_shape = :all_properties\n end", "title": "" }, { "docid": "1baa01222bb060ff92a33402fc30b730", "score": "0.5312159", "text": "def reset!\n @blocks = []\n @single_block = []\n end", "title": "" }, { "docid": "9a9ac5c0766c224dc8d2b3cce55dcc1e", "score": "0.52918077", "text": "def reset\r\n #backup\r\n @lists.clear\r\n parse_gemo\r\n end", "title": "" }, { "docid": "26e1876354f898ccc37e6e397758f72a", "score": "0.52903944", "text": "def prepend_path(path)\n @paths.unshift(File.expand_path(path, root))\n end", "title": "" }, { "docid": "416b840132cd0b3d6ad06a7b5a026f25", "score": "0.528768", "text": "def reset\n # TODO\n end", "title": "" }, { "docid": "dc9403bc1f1cf608f7bd5d7afa6a161f", "score": "0.5284203", "text": "def reset\n @folder_id = :contacts\n @email_address = nil\n @items = []\n end", "title": "" } ]
cca799c58814fd15310f649b8ceb4a3e
variants without & must avoid bridge methods to call& and instead use the directly generated Bc_CALL_SEND bytecodes
[ { "docid": "c8312fe17b4721baf197641986371a23", "score": "0.0", "text": "def call\n @_st_block.call\n end", "title": "" } ]
[ { "docid": "739495b9a06a319eb9c45d6a388c7995", "score": "0.72147506", "text": "def send(call)\n\n end", "title": "" }, { "docid": "f91ac962e3ba170b1aa09800870052f2", "score": "0.64354736", "text": "def send_call(opts = {})\n nsock = opts[:sock] || sock\n call = opts[:call] || build_call(opts)\n nsock.put(call.encode)\n end", "title": "" }, { "docid": "a2ac6a4fd5fdda36029ce1b6bbd1d23a", "score": "0.6411754", "text": "def send(*a, &b)\n bind_call(:send, *a, &b)\n end", "title": "" }, { "docid": "37f59aaf4835cb1218be3625b0399335", "score": "0.62438023", "text": "def send(symbol, *args, &block)\n ### *** TODO *** ###\n end", "title": "" }, { "docid": "992728353b87d5852195bcbb31c97a09", "score": "0.61951435", "text": "def sendcmd(cmd); end", "title": "" }, { "docid": "cde2e9d76218c4dde42de378e73f688a", "score": "0.5998892", "text": "def send_code=(_arg0); end", "title": "" }, { "docid": "ea4ca43dbb764d3116631bb2bd8e93cb", "score": "0.59811115", "text": "def CommandCall(receiver, operator, message, arguments, block); end", "title": "" }, { "docid": "3d25b027f8ddc33886c90c56d5a9340b", "score": "0.58457345", "text": "def call!(**call_options); end", "title": "" }, { "docid": "232fe1d863a1ff64290d00ec2ea7413c", "score": "0.58361155", "text": "def send(mesg, flags)\n Polyphony.backend_send(self, mesg, flags)\n end", "title": "" }, { "docid": "f47dd20614b1854dce3fa60a5033647a", "score": "0.5828052", "text": "def call(*command); end", "title": "" }, { "docid": "cc911794534f292e7072929c477acf93", "score": "0.5774159", "text": "def send_vcall(meth)\n idx = find_literal(meth)\n send_method idx\n end", "title": "" }, { "docid": "701be167a40a6470330ebd522c485de4", "score": "0.5766137", "text": "def send(my_proc)\n my_proc.call\n end", "title": "" }, { "docid": "545d36de3a19f5ee6dd77ca0c815e6da", "score": "0.5751206", "text": "def on_call(receiver, oper, sending)\n ending = sending\n\n if sending == :call\n ending = oper\n\n # Special handling here for Ruby <= 2.5 because the oper argument to this\n # method wasn't a parser event here it was just a plain symbol.\n ending = receiver if RUBY_MAJOR <= 2 && RUBY_MINOR <= 5\n end\n\n {\n type: :call,\n body: [receiver, oper, sending],\n sl: receiver[:sl],\n sc: receiver[:sc],\n el: ending[:el],\n ec: ending[:ec]\n }\n end", "title": "" }, { "docid": "afa72994a2b32973fd98ca3cee861a03", "score": "0.57497287", "text": "def send(*several_variants)\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "69573eb0c77f60a8d37e52f99c6f8400", "score": "0.57487285", "text": "def send my_proc\n my_proc.call\n end", "title": "" }, { "docid": "a2414c8cdf3afde3470d9e359d6a64ad", "score": "0.57485896", "text": "def call(a,b)\n\t\t\n\tend", "title": "" }, { "docid": "1b68cae0b8ecbd73fc62d9d4ff6a4c9f", "score": "0.5748192", "text": "def send(*args)\n invoke(:send, *args)\n end", "title": "" }, { "docid": "6b5958a2bb9b546e53de82cd318acb94", "score": "0.5713377", "text": "def sendmsg(call, options = {})\n command \"SendMsg #{call}\", options\n end", "title": "" }, { "docid": "b7e136d963be5037c182496ad7e66450", "score": "0.57066303", "text": "def compile_using_refined_send\n helper :refined_send\n\n push '$refined_send('\n compile_refinements\n compile_receiver\n compile_method_name\n compile_arguments\n compile_block_pass\n push ')'\n end", "title": "" }, { "docid": "b3f6bcf9d54b4bcb66185d3012f582a9", "score": "0.57042694", "text": "def call(*) end", "title": "" }, { "docid": "bbd8ce47b079818aa3402203b7395f1a", "score": "0.5698908", "text": "def smb_cmd_dispatch(cmd, c, buff)\r\n smb = @state[c]\r\n vprint_status(\"Received command #{cmd} from #{smb[:name]}\")\r\n\r\n pkt = CONST::SMB_BASE_PKT.make_struct\r\n pkt.from_s(buff)\r\n #Record the IDs\r\n smb[:process_id] = pkt['Payload']['SMB'].v['ProcessID']\r\n smb[:user_id] = pkt['Payload']['SMB'].v['UserID']\r\n smb[:tree_id] = pkt['Payload']['SMB'].v['TreeID']\r\n smb[:multiplex_id] = pkt['Payload']['SMB'].v['MultiplexID']\r\n\r\n case cmd\r\n when CONST::SMB_COM_NEGOTIATE\r\n smb_cmd_negotiate(c, buff)\r\n when CONST::SMB_COM_SESSION_SETUP_ANDX\r\n wordcount = pkt['Payload']['SMB'].v['WordCount']\r\n if wordcount == 0x0D # It's the case for Share Security Mode sessions\r\n smb_cmd_session_setup(c, buff)\r\n else\r\n vprint_status(\"SMB Capture - #{smb[:ip]} Unknown SMB_COM_SESSION_SETUP_ANDX request type , ignoring... \")\r\n smb_error(cmd, c, CONST::SMB_STATUS_SUCCESS)\r\n end\r\n when CONST::SMB_COM_TRANSACTION2\r\n smb_cmd_trans(c, buff)\r\n when CONST::SMB_COM_NT_CREATE_ANDX\r\n smb_cmd_create(c, buff)\r\n when CONST::SMB_COM_READ_ANDX\r\n smb_cmd_read(c, buff)\r\n else\r\n vprint_status(\"SMB Capture - Ignoring request from #{smb[:name]} - #{smb[:ip]} (#{cmd})\")\r\n smb_error(cmd, c, CONST::SMB_STATUS_SUCCESS)\r\n end\r\n end", "title": "" }, { "docid": "b34df415c8d0369dc40ce07c59e27852", "score": "0.5695652", "text": "def compile_using_send\n helper :send\n\n push '$send('\n compile_receiver\n compile_method_name\n compile_arguments\n compile_block_pass\n push ')'\n end", "title": "" }, { "docid": "d3cb12d4391815040068c2a436b42dbb", "score": "0.56869185", "text": "def byte_stream_from_call_message message\n\t\t\"#{message.type}#{DELIMTER}#{message.value}\"\n\tend", "title": "" }, { "docid": "5665e5eca270759a5c78550a0cdf3074", "score": "0.56823426", "text": "def b(x0)\n @b.call(x0)\n end", "title": "" }, { "docid": "a64557a3a249d71a0ef9cc817161e421", "score": "0.5679059", "text": "def do_send obj0, method, args0\n return false if not interpreting? rescue\n return false if not method\n\n # try direct first!\n # y=y[0] if y.is_a? Array and y.count==1 # SURE??????? [\"noo\"].length\n if @methods.contains method # 'internal'\n method, arguments=match_arguments(method, args0)\n return @result=do_execute_block(method.body, arguments)\n end\n\n obj =method.owner if method.is_a? Method\n obj ||=resolve(obj0)\n # obj.map{|x| x.value}\n # obj=obj0 if obj0.is_a?Variable and self_modifying(method) #todo better!!\n args=args0\n args=args.name_or_value if args.is_a? Argument\n args=args.map { |x| x.name_or_value } if args.is_a? Array and args[0].is_a? Argument\n args=eval_string(args) rescue NoMethodError\n args.replace_numerals! if args and args.is_a? String\n # args.strip! if args and args.is_a?String NO! a + \" \" etc!\n\n if method.is_a? Method and method.owner\n return @result=method.call(*args)\n end\n\n method_name=(method.is_a? Method) ? method.name.to_s : method.to_s #todo bettter\n if obj.respond_to? method_name\n # OK\n elsif obj.respond_to? method_name+'s'\n method=method_name+'s'\n elsif obj.respond_to? method_name.gsub(/s$/, '')\n method=method_name.gsub(/s$/, '') rescue nil\n end\n\n @result=NoMethodError\n if not obj\n obj=args0\n @result=Object.send(method, args) rescue NoMethodError\n @result=args.send(method) rescue NoMethodError #.new(\"#{obj}.#{op}\")\n @result=args[1].send(method) if has_args method, obj if (args[0]=='of') rescue NoMethodError #rest of x\n else\n if (obj==Object)\n m =method(method_name)\n @result=m.call || :nill unless has_args method, obj, false rescue NoMethodError\n @result=m.call(args) || :nill if has_args method, obj, true rescue NoMethodError\n else\n @result=obj.send(method) unless has_args method, obj, false rescue NoMethodError\n @result=obj.send(method, args) if has_args(method, obj, true) and @result==NoMethodError rescue NoMethodError\n #SyntaxError,\n end\n end\n #todo: call FUNCTIONS!\n # puts object_method.parameters #todo MATCH!\n\n # => selfModify todo\n selfModify=self_modifying method\n selfModify=selfModify and (obj0||args) #and not obj0.is_a?Variable\n if selfModify\n name =(obj0||args).to_sym.to_s\n if @variables.has name\n @variables[name].value=@result #rescue nil\n @variableValues[name] =@result\n end\n end #rescue nil\n\n # todo : nil OK, error not!\n msg=\"ERROR CALLING #{obj}.#{method}(#{args})\" if @result==NoMethodError\n raise NoMethodError.new(msg, method, args) if @result==NoMethodError\n # raise SyntaxError.new(\"ERROR CALLING #{obj}.#{op}(#{args}) : NoMethodError\")\n return @result\n end", "title": "" }, { "docid": "cb194421273782f6ff25c0c23c6fa43f", "score": "0.5646072", "text": "def __write_method__\n :backend_send\n end", "title": "" }, { "docid": "1563df2a370c4ae3a7198801d2c7fc06", "score": "0.56406075", "text": "def send(*args)\n\t\t raise Bibmix::NotImplementedError\n\t\tend", "title": "" }, { "docid": "e7099d62fa54e99adff2d4d6fd7549ec", "score": "0.56389254", "text": "def send(*rest) end", "title": "" }, { "docid": "8cf6fbcc5df7809bb23d34100caaa40a", "score": "0.563599", "text": "def collapse_send_call exp, first_arg\n # Handle try(&:id)\n if node_type? first_arg, :block_pass\n first_arg = first_arg[1]\n end\n\n return unless symbol? first_arg or string? first_arg\n exp.method = first_arg.value.to_sym\n args = exp.args\n exp.pop # remove last arg\n if args.length > 1\n exp.arglist = args[1..-1]\n end\n end", "title": "" }, { "docid": "d54cfd6c1395efa826dd5d8f5f97cc0a", "score": "0.56294537", "text": "def call(code, options = T.unsafe(nil)); end", "title": "" }, { "docid": "218c178099df78c81ff746fac013d22e", "score": "0.5626963", "text": "def call(*args)\r\n args.each_with_index do |arg, index|\r\n case @proto[index]\r\n when \"S\"\r\n args[index], = [arg == 0 ? nil : arg].pack(\"p\").unpack(\"l!*\")\r\n when \"I\"\r\n args[index], = [arg].pack(\"I\").unpack(\"i\")\r\n end\r\n end\r\n\r\n @func.call(args).to_i || 0\r\n end", "title": "" }, { "docid": "b91f33088f67c93866f789c7aef38e18", "score": "0.5623549", "text": "def interpretor(proc)\n\n\tdef send!(var,symbol)\n puts \"SEND!! CALLED\"\n\t\t# 1/ write the value in the correspondig symbol\n\t\t$inouts[$cEntity].each do |hash|\n\t\t\tif hash[:symbol] == symbol\n\t\t\t\thash[:value] = var\n\t\t\t\thash[:type] << var.class\n\t\t\t\thash[:type] = hash[:type].uniq\n\t\t\tend\n\t\tend\n\n\t\t# 2/ write it to the symbols that are connected to the previous one\n\t\t$connexions.each do |connexion|\n\t\t\tif ( connexion[0][:ename] == $cEntity ) && ( connexion[0][:port] == symbol )\n\t\t\t\t# then repeat 1/ on the connected symbol (might happen more than once if multiple connexions)\n\t\t\t\t$inouts[ connexion[1][:ename] ].each do |hash|\n\t\t\t\t\tif hash[:symbol] == connexion[1][:port]\n\t\t\t\t\t\thash[:value] = var\n\t\t\t\t\t\thash[:type] << var.class\n\t\t\t\t\t\thash[:type] = hash[:type].uniq\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend\n\n\tdef receive?(symbol)\n puts \"RECEIVE!! CALLED\"\n\t\tret = :nil\n\t\t$inouts[$cEntity].each do |hash|\n\t\t\tif hash[:symbol] == symbol\n\t\t\t\tret = hash[:value]\n\t\t\tend\n\t\tend\n\t\tret\n\tend\n\n def wait\n\n end\n\n\tproc.call()\n\nend", "title": "" }, { "docid": "f8c92349f2e6cc07f3d3270dce777064", "score": "0.56219923", "text": "def call_proc(&prc) #must have a ampersand (to_proc) method\n prc.call\nend", "title": "" }, { "docid": "1b035ae772d86356db8e9ee4fc62e8d2", "score": "0.56107897", "text": "def call(a)\n \n # puts a.inspect\n \n target = ''\n function = ''\n value = ''\n \n # convert to array\n a = [ a.to_s ] if ( a.is_a?(Symbol) || a.is_a?(String) )\n \n a[0] = a[0].to_s\n \n if a[1].is_a?(String) then\n value = '\"' + a[1] + '\"'\n elsif a[1].kind_of?(Array) then\n\t value = a[1][0]\n else\n value = a[1]\n end\n \n if a[0].to_s =~ /^e_(.*)/ then\n target = 'client'\n function = $1\n elsif a[0].to_s == 'get_balance' then\n target = 'client'\n function = 'get_balance'\n else\n target = 'contract.call'\n function = a[0]\n end\n \n x = nil\n call_type = 0\n \n begin\n \n if a[1] then\n if (target == 'client') then\n call_type = 1\n x = @client.__send__ function, *a[1]\n else\n call_type = 2\n x = @contract.call.__send__ function, *a[1]\n end\n else\n if (target == 'client') then\n call_type = 3\n x = @client.__send__ function\n else\n call_type = 4\n x = @contract.call.__send__ function\n end\n end\n \n # return without formatting (default)\n return x unless a[2]\n \n # return with formatting\n type = type_of(function)\n \n x = Time.at(x.to_i).utc if type == :date\n x = comma_numbers(x.to_f / @E18) if type == :ether\n x = comma_numbers(x.to_f / @EXX) if type == :token\n x += '0x' if type == :address\n \n return x\n\n rescue StandardError => e\n \n puts \"===ERROR===call\"\n puts e.inspect\n puts \"call_type: #{call_type}\"\n puts \"function: #{function}\"\n puts \"a[1]: #{a[1].inspect}\"\n puts \"===ERROR===\"\n end\n \n end", "title": "" }, { "docid": "07b7ecb7f05badb14700b65a293f27dc", "score": "0.5610479", "text": "def request_call; end", "title": "" }, { "docid": "512a0a7f27061e8658ad3021502a1307", "score": "0.5606936", "text": "def __send__(symbol, *args, &block)\n ### *** TODO *** ###\n end", "title": "" }, { "docid": "c369b42ecb593b2009345ed727f40ed4", "score": "0.5604303", "text": "def some_other_method(&b)\n\tb.call \"Hello world\"\nend", "title": "" }, { "docid": "1d885c2ba430a935b3b5d15a11008b5f", "score": "0.5601782", "text": "def smb_cmd_dispatch(cmd, c, buff)\n smb = @state[c]\n\n pkt = CONST::SMB_BASE_PKT.make_struct\n pkt.from_s(buff)\n #Record the IDs\n smb[:process_id] = pkt['Payload']['SMB'].v['ProcessID']\n smb[:user_id] = pkt['Payload']['SMB'].v['UserID']\n smb[:tree_id] = pkt['Payload']['SMB'].v['TreeID']\n smb[:multiplex_id] = pkt['Payload']['SMB'].v['MultiplexID']\n\n case cmd\n when CONST::SMB_COM_NEGOTIATE\n return smb_cmd_negotiate(c, buff)\n when CONST::SMB_COM_SESSION_SETUP_ANDX\n word_count = pkt['Payload']['SMB'].v['WordCount']\n if word_count == 0x0d # Share Security Mode sessions\n return smb_cmd_session_setup_andx(c, buff)\n else\n print_status(\"SMB Share - #{smb[:ip]} Unknown SMB_COM_SESSION_SETUP_ANDX request type, ignoring... \")\n return smb_error(cmd, c, CONST::SMB_STATUS_SUCCESS)\n end\n when CONST::SMB_COM_TRANSACTION2\n return smb_cmd_trans2(c, buff)\n when CONST::SMB_COM_NT_CREATE_ANDX\n return smb_cmd_nt_create_andx(c, buff)\n when CONST::SMB_COM_READ_ANDX\n return smb_cmd_read_andx(c, buff)\n when CONST::SMB_COM_CLOSE\n return smb_cmd_close(c, buff)\n else\n vprint_status(\"SMB Share - #{smb[:ip]} Unknown SMB command #{cmd.to_s(16)}, ignoring... \")\n return smb_error(cmd, c, CONST::SMB_STATUS_SUCCESS)\n end\n end", "title": "" }, { "docid": "b67d86c118097a2eea0068c3d5f90ea4", "score": "0.5576702", "text": "def call_subroutine( addr, frame_size )\n if frame_size <= 4\n r = []\n frame_size.times { r << \"inx\" }\n r << \"jsr #{addr}\"\n frame_size.times { r << \"dex\" }\n r\n else\n \"call #{addr}, ##{frame_size}\"\n end\n end", "title": "" }, { "docid": "9c228978912b897c6f0e8ee928d3989f", "score": "0.55500346", "text": "def call *_args; end", "title": "" }, { "docid": "407f9496c19d27f42166f1565c35938d", "score": "0.55408823", "text": "def process_call(exp)\n exp.shift # remove the :call\n\n _recv = process(exp.shift) # recv\n _name = exp.shift\n _args = process(exp.shift) # args\n\n exp\n rescue StandardError => e\n sdebug('MethodSignature#process_call', e)\n exp\n end", "title": "" }, { "docid": "4f528f160768f60783184ea2a1f2d0c8", "score": "0.553578", "text": "def rcon_send(command); end", "title": "" }, { "docid": "9135aa0bd8e45f4bc1261df276898963", "score": "0.55260336", "text": "def protocol=(_arg0); end", "title": "" }, { "docid": "9135aa0bd8e45f4bc1261df276898963", "score": "0.55260336", "text": "def protocol=(_arg0); end", "title": "" }, { "docid": "b21aabad85453a0b450466e9e26e2fab", "score": "0.5525998", "text": "def send(destination, body, parms = T.unsafe(nil)); end", "title": "" }, { "docid": "5b4694f38a55acc496efad88be75df01", "score": "0.5514795", "text": "def do_send(meth, argc, blockiseq, op_flag, ic, receiver = nil)\n # [:send, meth, argc, blockiseq, op_flag, inline_cache]\n args = popn(argc)\n receiver ||= pop\n receiver = :implicit if receiver.nil?\n # Special operator cases. Weird, but keep in mind the oddity of\n # using an operator with a block!\n #\n # receiver.[]=(key, val) {|blockarg| ...} is possible!!!\n if !blockiseq\n if meth == :[]=\n remove_useless_dup\n push r(:aset, receiver, args[0], args[1])\n return\n elsif Reverser::ALL_INFIX.include?(meth.to_s)\n push r(:infix, meth, [receiver, args.first])\n return\n end\n end\n ## The rest of cases: either a normal method, a `def`, or an operator with a block\n if meth == :\"core#define_method\" || meth == :\"core#define_singleton_method\"\n # args will be [iseq, name, receiver, scope_arg]\n receiver, name, blockiseq = args\n reverser = Reverser.new(blockiseq, self)\n push r(:defmethod, receiver, name, reverser.decompile_body, ISeq.new(blockiseq).argstring)\n # normal method call\n else\n remove_useless_dup if meth == :[]=\n do_simple_send(receiver, meth, args, blockiseq)\n end\n end", "title": "" }, { "docid": "9108bb249a21e3507884d626355b19c4", "score": "0.5505217", "text": "def process_call(exp)\n exp.shift # remove the :call\n\n recv = process(exp.shift) # recv\n name = exp.shift\n args = process(exp.shift) # args\n\n exp\n rescue Exception => e\n if ENV[\"XUMLIDOT_DEBUG\"]\n STDERR.puts \"ERROR (MethodSignature#process_call) #{e.message}\"\n STDERR.puts e.backtrace.reverse\n end\n exp\n end", "title": "" }, { "docid": "f38a66d7b8f67695cea36542a7f46034", "score": "0.54980916", "text": "def send(symbol, *args)\n __send__(symbol, *args)\n end", "title": "" }, { "docid": "f38a66d7b8f67695cea36542a7f46034", "score": "0.54980916", "text": "def send(symbol, *args)\n __send__(symbol, *args)\n end", "title": "" }, { "docid": "f7df0081d8af242902c9b895ebc01f49", "score": "0.54549927", "text": "def _call\n call\n end", "title": "" }, { "docid": "5b8634283acdfd72c452df9b3e4f2705", "score": "0.5452987", "text": "def send(params={}, check)\n raise NotImplementedError\n end", "title": "" }, { "docid": "2062052c8fdb274f90827312b8e41fc4", "score": "0.54516995", "text": "def call_or_send(callable, *args, &block)\n return callable.call(self, *args, &block) if callable.respond_to?(:call)\n __send__(callable, *args, &block)\n end", "title": "" }, { "docid": "068aeb37e565a15bfdea4f4b21f65602", "score": "0.5447162", "text": "def method a, b, c, d, &c\r\n\t1\r\nend", "title": "" }, { "docid": "d96bfd67c9f23b7624ce79d10b385356", "score": "0.54419845", "text": "def send_action(*_arg0); end", "title": "" }, { "docid": "63f8d967f0ddaface446c278ba0e2ce9", "score": "0.54398143", "text": "def __send__(*rest) end", "title": "" }, { "docid": "364004d9436f04b6a60bea0ff71669fd", "score": "0.54348654", "text": "def calldata; end", "title": "" }, { "docid": "364004d9436f04b6a60bea0ff71669fd", "score": "0.54348654", "text": "def calldata; end", "title": "" }, { "docid": "364004d9436f04b6a60bea0ff71669fd", "score": "0.54348654", "text": "def calldata; end", "title": "" }, { "docid": "364004d9436f04b6a60bea0ff71669fd", "score": "0.54348654", "text": "def calldata; end", "title": "" }, { "docid": "364004d9436f04b6a60bea0ff71669fd", "score": "0.54348654", "text": "def calldata; end", "title": "" }, { "docid": "364004d9436f04b6a60bea0ff71669fd", "score": "0.54348654", "text": "def calldata; end", "title": "" }, { "docid": "364004d9436f04b6a60bea0ff71669fd", "score": "0.54348654", "text": "def calldata; end", "title": "" }, { "docid": "364004d9436f04b6a60bea0ff71669fd", "score": "0.54348654", "text": "def calldata; end", "title": "" }, { "docid": "364004d9436f04b6a60bea0ff71669fd", "score": "0.54348654", "text": "def calldata; end", "title": "" }, { "docid": "364004d9436f04b6a60bea0ff71669fd", "score": "0.54348654", "text": "def calldata; end", "title": "" }, { "docid": "364004d9436f04b6a60bea0ff71669fd", "score": "0.54348654", "text": "def calldata; end", "title": "" }, { "docid": "364004d9436f04b6a60bea0ff71669fd", "score": "0.54348654", "text": "def calldata; end", "title": "" }, { "docid": "364004d9436f04b6a60bea0ff71669fd", "score": "0.54348654", "text": "def calldata; end", "title": "" }, { "docid": "364004d9436f04b6a60bea0ff71669fd", "score": "0.54348654", "text": "def calldata; end", "title": "" }, { "docid": "364004d9436f04b6a60bea0ff71669fd", "score": "0.54348654", "text": "def calldata; end", "title": "" }, { "docid": "364004d9436f04b6a60bea0ff71669fd", "score": "0.54348654", "text": "def calldata; end", "title": "" }, { "docid": "364004d9436f04b6a60bea0ff71669fd", "score": "0.54348654", "text": "def calldata; end", "title": "" }, { "docid": "364004d9436f04b6a60bea0ff71669fd", "score": "0.54348654", "text": "def calldata; end", "title": "" }, { "docid": "364004d9436f04b6a60bea0ff71669fd", "score": "0.54348654", "text": "def calldata; end", "title": "" }, { "docid": "364004d9436f04b6a60bea0ff71669fd", "score": "0.54348654", "text": "def calldata; end", "title": "" }, { "docid": "364004d9436f04b6a60bea0ff71669fd", "score": "0.54348654", "text": "def calldata; end", "title": "" }, { "docid": "364004d9436f04b6a60bea0ff71669fd", "score": "0.54348654", "text": "def calldata; end", "title": "" }, { "docid": "364004d9436f04b6a60bea0ff71669fd", "score": "0.54348654", "text": "def calldata; end", "title": "" }, { "docid": "364004d9436f04b6a60bea0ff71669fd", "score": "0.54348654", "text": "def calldata; end", "title": "" }, { "docid": "364004d9436f04b6a60bea0ff71669fd", "score": "0.54348654", "text": "def calldata; end", "title": "" }, { "docid": "364004d9436f04b6a60bea0ff71669fd", "score": "0.54348654", "text": "def calldata; end", "title": "" }, { "docid": "364004d9436f04b6a60bea0ff71669fd", "score": "0.54348654", "text": "def calldata; end", "title": "" }, { "docid": "364004d9436f04b6a60bea0ff71669fd", "score": "0.54348654", "text": "def calldata; end", "title": "" }, { "docid": "364004d9436f04b6a60bea0ff71669fd", "score": "0.54348654", "text": "def calldata; end", "title": "" }, { "docid": "364004d9436f04b6a60bea0ff71669fd", "score": "0.54348654", "text": "def calldata; end", "title": "" }, { "docid": "364004d9436f04b6a60bea0ff71669fd", "score": "0.54348654", "text": "def calldata; end", "title": "" }, { "docid": "dea6f4f61697aa9e8b683b2e7b4d4324", "score": "0.54227734", "text": "def on_call(receiver, operator, message); end", "title": "" }, { "docid": "5c38f2adf022bd3401d809452460c125", "score": "0.54226404", "text": "def pbRegisterCall(idxBattler)\r\n @choices[idxBattler][0] = :Call\r\n @choices[idxBattler][1] = 0\r\n @choices[idxBattler][2] = nil\r\n return true\r\n end", "title": "" }, { "docid": "3f69497b21fde4d15e06444bdeda5e82", "score": "0.54204273", "text": "def call(*args, &block); end", "title": "" }, { "docid": "763285e554c06e8bf42687215ec74596", "score": "0.5420179", "text": "def call(method, url, data = T.unsafe(nil), options = T.unsafe(nil)); end", "title": "" }, { "docid": "39d43edd1c5e2e75f4385e54f851645d", "score": "0.54036605", "text": "def method_missing(msg_id, *a, &b)\n if DRb.here?(@uri)\n obj = DRb.to_obj(@ref)\n DRb.current_server.check_insecure_method(obj, msg_id)\n return obj.__send__(msg_id, *a, &b)\n end\n\n succ, result = self.class.with_friend(@uri) do\n DRbConn.open(@uri) do |conn|\n conn.send_message(self, msg_id, a, b)\n end\n end\n\n if succ\n return result\n elsif DRbUnknown === result\n raise result\n else\n bt = self.class.prepare_backtrace(@uri, result)\n result.set_backtrace(bt + caller)\n raise result\n end\n end", "title": "" }, { "docid": "aea8df92aeefc39ac333b56a0ee69e2d", "score": "0.5386493", "text": "def pbPhoneCall(call,phonenum)\n Kernel.pbMessage(_INTL(\"......\\\\wt[5] ......\\\\1\"))\n encspecies = pbEncounterSpecies(phonenum)\n trainerspecies = pbTrainerSpecies(phonenum)\n trainermap = pbTrainerMapName(phonenum)\n messages = call.split(\"\\\\m\")\n for i in 0...messages.length\n messages[i].gsub!(/\\\\TN/,phonenum[2])\n messages[i].gsub!(/\\\\TP/,trainerspecies)\n messages[i].gsub!(/\\\\TE/,encspecies)\n messages[i].gsub!(/\\\\TM/,trainermap)\n messages[i] += \"\\\\1\" if i<messages.length-1\n Kernel.pbMessage(messages[i])\n end\n Kernel.pbMessage(_INTL(\"Click!\\\\wt[10]\\n......\\\\wt[5] ......\\\\1\"))\nend", "title": "" }, { "docid": "3e13c45b8c7e3c056397afa3121335f3", "score": "0.5386104", "text": "def send(*args, &block)\n __send__(*args, &block)\n end", "title": "" }, { "docid": "df886bef4e9d690e33a213094b83f0a8", "score": "0.5379209", "text": "def send_chain(array_of_method_names)\n array_of_method_names&.inject(self) {|obj, msg| obj&.send(msg) }\nend", "title": "" }, { "docid": "42c91da52af617679eef86eb7e2fb3bc", "score": "0.53678125", "text": "def send(sym,*args)\n `method=this['m$'+sym.__value__.replace('=','Eql')]`\n `if(!method){m$raise(c$NoMethodError,$q('undefined method \"'+sym.__value__+'\" for '+this));}`\n `method.apply(this,args)`\n end", "title": "" }, { "docid": "b9d6686adb78e999e4579e3eabad7340", "score": "0.53630406", "text": "def do_send(command, data, options = {})\n\t\tcommand = \"\\x0F001\" << command << data << \"0\\r\"\n\t\tsend(command, options)\n\tend", "title": "" }, { "docid": "ef998737f53e31892f27c63d955791aa", "score": "0.53596", "text": "def send(data)\n end", "title": "" }, { "docid": "3fbd670d115bbe1d516e7ffa58aa46ae", "score": "0.5356591", "text": "def visit_vcall(node)\n visit_command_call(\n CommandCall.new(\n receiver: nil,\n operator: nil,\n message: node.value,\n arguments: nil,\n block: nil,\n location: node.location\n )\n )\n end", "title": "" }, { "docid": "a1339f7ebab89c60e8b2d77f81fbc2de", "score": "0.53512335", "text": "def on_vcall(ident); end", "title": "" }, { "docid": "193f2b4e106af22d692f8a7cbc12317c", "score": "0.53503597", "text": "def call(*command)\n send_command(command)\n end", "title": "" }, { "docid": "70ae162006a810cc4d781af780039ae3", "score": "0.5348863", "text": "def send\n parse_objects\n object_properties = @connection.objects.convert_reference_to_properties(@object_reference)\n arguments_properties = @arguments_references.map { |argument_reference| @connection.objects.convert_reference_to_properties(argument_reference) }\n message = Messages::CallRequest.build(id: @id, object: object_properties, method: @method, arguments: arguments_properties)\n @connection.messenger.send(message)\n end", "title": "" } ]
91c46601fd753dc9493cd9292f84f968
strong params post controller must accept :author_id as a param for a post strong params = security practice to help prevent allowing users to update sensitive model attributes author_id allowed for mass assignment in the create action
[ { "docid": "6374f44ed18d8a075db6e7434ac7ddd2", "score": "0.7620737", "text": "def post_params\n params.require(:post).permit(:title, :description, :author_id)\n end", "title": "" } ]
[ { "docid": "2bb72961cbe5f98b30a56927161ea9ef", "score": "0.79174757", "text": "def author_post_params\n params.require(:author_post).permit(:post_id, :author_id)\n end", "title": "" }, { "docid": "857c8de4e365a451ed85d9bf3cf5c81f", "score": "0.7662387", "text": "def post_params\n params.require(:post).permit(:caption, :photo) #author_id not working :author_id\n end", "title": "" }, { "docid": "a6a3c7585fb576a347bf095c22dd0096", "score": "0.7543259", "text": "def author_params\n # Strong params: White list of sanitised input -- stuff we are happy to accept from the user\n params.required(:author).permit(:name, :author, :dob, :image)\n end", "title": "" }, { "docid": "b8bfa563cd803cb4f3ed32644b012fa4", "score": "0.75285715", "text": "def post_params\n params.fetch(:post, {}).permit(:author_id,:body)\n end", "title": "" }, { "docid": "e1b0afc7420739ae6ef91ff5c883a2b3", "score": "0.7338039", "text": "def author_params\n params.require(:author).permit(:name)\n end", "title": "" }, { "docid": "e1b0afc7420739ae6ef91ff5c883a2b3", "score": "0.7338039", "text": "def author_params\n params.require(:author).permit(:name)\n end", "title": "" }, { "docid": "ef2161f969fbf9a12ba2d2132a646e1b", "score": "0.7319136", "text": "def post_params\n params.require(:post).permit(:title, :description, :category_id, author_attributes: [:name])\n end", "title": "" }, { "docid": "19293d2fc3641908979ec9517a5d5886", "score": "0.7316283", "text": "def author_params\n return params.require(:author).permit(:name)\n end", "title": "" }, { "docid": "cf0c68f2b190f656ffa0e7a07b29cbc5", "score": "0.72933155", "text": "def post_params\n params.require(:post).permit(:title, :content, :image_url, :author_id)\n end", "title": "" }, { "docid": "6c42d8ac216024fb2f4ab8a59492d65e", "score": "0.7262656", "text": "def post_params\n params.require(:post).permit(:author, :title, :body)\n end", "title": "" }, { "docid": "1ce5f38a6d0b6c5f2c4a66396ae4c69b", "score": "0.72592777", "text": "def author_params\n params.require(:author).permit(:name, :address,:author_id, authordetail_attributes: [:id, :bio, :email, :mobile_No])\n end", "title": "" }, { "docid": "35e84dbd3de37265a7232796ba53e646", "score": "0.72464204", "text": "def author_params\n # params.require(:author).permit(:name, :phone)\n params.require(:data).require(:attributes).permit(:name, :phone)\n end", "title": "" }, { "docid": "4c44404fcde67882a76a5556ebab3d7a", "score": "0.72443", "text": "def author_params\n params.require(:author).permit(:name, :age)\n end", "title": "" }, { "docid": "498e73077e137b09bd0bada4f4513b5b", "score": "0.7238475", "text": "def author_params\n params.require(:author).permit(:user_id, :project_id)\n end", "title": "" }, { "docid": "5e642a4e8ff1fbe84ffc3b268f7d366b", "score": "0.7214816", "text": "def author_params\n params.require(:author).permit(:id, :author_first_name, :author_last_name, :author_middle_name, :author_email,\n :affiliation_id, :resource_id, :author_orcid)\n end", "title": "" }, { "docid": "ed0e244533765e2fc3e996767ca492d0", "score": "0.72104555", "text": "def author_params\n params.require(:author).permit(:name)\n end", "title": "" }, { "docid": "ed0e244533765e2fc3e996767ca492d0", "score": "0.72104555", "text": "def author_params\n params.require(:author).permit(:name)\n end", "title": "" }, { "docid": "ed0e244533765e2fc3e996767ca492d0", "score": "0.72104555", "text": "def author_params\n params.require(:author).permit(:name)\n end", "title": "" }, { "docid": "1a646d49b08312e9fa781d7671771009", "score": "0.7206989", "text": "def author_params\n\t\tparams.require(:author).permit(:name, :date_of_birth, :bio, :avatar, :user_id, :twitter_username)\n\tend", "title": "" }, { "docid": "e50bc539b19861cb85549f03ab4d8af7", "score": "0.7205705", "text": "def author_params(*args)\n params.require(:author).permit(*args)\n end", "title": "" }, { "docid": "2950d728acf70b07c900c4e1327a14f4", "score": "0.71972257", "text": "def post_params\n params.require(:post).permit(:author, :title, :content)\n end", "title": "" }, { "docid": "2950d728acf70b07c900c4e1327a14f4", "score": "0.71972257", "text": "def post_params\n params.require(:post).permit(:author, :title, :content)\n end", "title": "" }, { "docid": "49a3be1723d0c53f49d3c7550c0be19f", "score": "0.71716315", "text": "def post_params\n params.require(:post).permit(:title, :author, :content, :id, :user_id)\n end", "title": "" }, { "docid": "f452cf904d120ec84f4d64884a9f1471", "score": "0.7164645", "text": "def author_params\n params.permit(:nome_author)\n end", "title": "" }, { "docid": "4cc64f8ac3e00482827ea3787f730821", "score": "0.71599436", "text": "def post_params\n params.permit(:body, :author_id, :receiver_id)\n end", "title": "" }, { "docid": "b62935d13be07e67a3f713c8bb451e2b", "score": "0.71438694", "text": "def author_params\n params.require(:author).permit(:name, :school_id)\n end", "title": "" }, { "docid": "085bd5d4906122dfbf4a99cf42eb9212", "score": "0.71310073", "text": "def author_params\n params.require(:author).permit(:person_id, :document_id, :main_author, :hidden, :order)\n end", "title": "" }, { "docid": "3533cd245c0292304b1fdfc9d151a53d", "score": "0.7128897", "text": "def post_params\n\n # deleted code\n # params.require(:post).permit(:title, :description)\n\n # new code\n params.require(:post).permit(:title, :description, :author_id)\n # Why didn't we have to make a nested resource route for :create in\n # addition to :new? The form_for(@post) helper in posts/_form.html.erb\n # will automatically route to POST posts_controller#create for a new Post.\n # By carrying the author_id as we did and allowing it through strong\n # parameters, the existing create route and action can be used without\n # needing to do anything else.\n end", "title": "" }, { "docid": "78bf70627f0df1ab9dcd6381a9606ab3", "score": "0.7125527", "text": "def post_params\n params.require(:post).permit(:content, :title, :summary, :post_tags).merge(author_id: current_author.id)\n end", "title": "" }, { "docid": "3f755138bd73e0b01fb86c83a023ae99", "score": "0.7100514", "text": "def author_params\n params.require(:author).permit(:name, :description)\n end", "title": "" }, { "docid": "310aa376648bea9ecf236e5e1472098a", "score": "0.7080104", "text": "def author_comment_post_params\n params.require(:author_comment_post).permit(:user_id, :comment_id, :post_id)\n end", "title": "" }, { "docid": "4d1b33ecd939ddbb6865f8b3a0a95383", "score": "0.70650584", "text": "def author_params\n params.require(:author).permit(:first_name, :last_name, :age)\n end", "title": "" }, { "docid": "84cfcf673f8295322ed624030ca7d893", "score": "0.7064875", "text": "def author_params\n params.require(:author).permit(:name, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "ac284a3e45f4f8eb8566e7205fe198e4", "score": "0.70640707", "text": "def post_params\n params.require(:post).permit(:author, :title, :content)\n end", "title": "" }, { "docid": "ac284a3e45f4f8eb8566e7205fe198e4", "score": "0.70640707", "text": "def post_params\n params.require(:post).permit(:author, :title, :content)\n end", "title": "" }, { "docid": "de4179889ebab9f60478e71547680a94", "score": "0.7059339", "text": "def author_params\n params.require(:author).permit(:id, :author_first_name, :author_last_name, :author_middle_name,\n :author_email, :resource_id, :author_orcid, :author_order,\n affiliation: %i[id ror_id long_name])\n end", "title": "" }, { "docid": "110fb2d2c3720e5d27613366ff076f97", "score": "0.7056229", "text": "def post_params\n params.require(:post).permit(:title, :author, :body) \n end", "title": "" }, { "docid": "8ed0b3a86f7d195db5bfe89d926bb7b1", "score": "0.7047886", "text": "def author_params\n params.require(:author).permit(:name, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "91aadcbb2d6bd6b0662824165f3d2554", "score": "0.7032175", "text": "def author_params\n params.require(:author).permit(:id, :author_first_name, :author_last_name, :author_middle_name,\n :author_email, :resource_id, :author_orcid,\n affiliation: %i[id ror_id long_name])\n end", "title": "" }, { "docid": "3fa9a22ec0ddc829c921abe2dc1c532a", "score": "0.7032173", "text": "def permitted_post_params\n params.require(:post).permit(:title, :content, :author_name)\n end", "title": "" }, { "docid": "a35710f3b741362444aea13e51da73ba", "score": "0.7028202", "text": "def author_params\n params.require(:author).permit(:name, :email, :password, :password_confimation)\n end", "title": "" }, { "docid": "c4363ec5ee8a779c481e8e31c2f69c4b", "score": "0.7024093", "text": "def author_params\n params.require(:author).permit(:first_name, :last_name, :age)\n end", "title": "" }, { "docid": "15eada089053b7f7bab6c22494ec3c70", "score": "0.70175976", "text": "def post_params\n params.require(:post).permit(:name, :body, :category_id, :author_id)\n end", "title": "" }, { "docid": "9cd0c06fe01af6cd19450039f1a5bba4", "score": "0.701474", "text": "def post_params\n params.require(:post).permit(:title, :author, :body) #allowing only title author and body to be put into database. this is a strong parameter.PARAMS IS ALWAYS A HASH( KEY VALUE PAIR)\n end", "title": "" }, { "docid": "d29638a3679b3a3bf3cfc2741b7c6ff3", "score": "0.70060164", "text": "def template_author_params\n params.require(:template_author).permit(:id,:name)\n end", "title": "" }, { "docid": "ae95991b1049e8605146cfc244b77e24", "score": "0.6999631", "text": "def post_params\n params.require(:post).permit(:owner_id, :title, :body, :approved_by_id)\n end", "title": "" }, { "docid": "b7472877218b371df5b108b7564d98d8", "score": "0.69991696", "text": "def author_params\n # params is a hashtable. It should have in it a key of :author.\n # The value for the :author key is another hash.\n # If params does not contain the key :author, an exception is raised. \n # Only the \"author\" hash is returned and only with the permitted key(s).\n params.require(:author).permit(:name)\n end", "title": "" }, { "docid": "6a82433d9f3985a6654b6654440d3757", "score": "0.69884306", "text": "def author_params\n params.require(:author).permit(:name, :hometown)\n end", "title": "" }, { "docid": "6a82433d9f3985a6654b6654440d3757", "score": "0.69884306", "text": "def author_params\n params.require(:author).permit(:name, :hometown)\n end", "title": "" }, { "docid": "58a92c74a38d15af8942f31d1d44cfe5", "score": "0.6980985", "text": "def manage_author_params\n params.require(:manage_author).permit(:name, :password, :password_confirmation, :email, :avatar)\n end", "title": "" }, { "docid": "5b9a4cd9cc9764c46576148c42cf7b4a", "score": "0.69786173", "text": "def assign_author_id_to_model\n\n @model.author_id = @controller.current_user.id\n\n end", "title": "" }, { "docid": "c38d50b75808ae0d74768bab302a8bdf", "score": "0.69759136", "text": "def create\n @post.author = current_user\n save @post\n end", "title": "" }, { "docid": "4dfb3f17bca7d2517b53705c05e4d8c4", "score": "0.6950451", "text": "def author_params\n params.require(:author).permit(:name, :email, :phone_number, :country)\n end", "title": "" }, { "docid": "501e7a5132b743bd337b6914c45ac4de", "score": "0.6944055", "text": "def author_params\n params.require(:author).permit(:name, :email, :password, :avatar, :password_confirmation)\n end", "title": "" }, { "docid": "08327b2a463d80f8aff36fb469ceb815", "score": "0.69390184", "text": "def author_detail_params\n params.require(:author_detail).permit(:name, :age, :mobileno)\n end", "title": "" }, { "docid": "e546f9b0f9aa861b4a771fb5c6f03daf", "score": "0.6937965", "text": "def author_params\n params.require(:author).permit(:name, :email, :affiliation, :position)\n end", "title": "" }, { "docid": "0f1936f40f7d9dd3e3fbf0815c298b8b", "score": "0.69367194", "text": "def author_params\n params.require(:author).permit(:name, :email, :phone, :country)\n end", "title": "" }, { "docid": "d2cde9f8f4e1f603b54a263dc7835a40", "score": "0.6927303", "text": "def author_params\n params.require(:author).permit(:credit_id, :name, :url, :twitter, :pixiv, :email, :lock_version, :nico, :disp_name)\n end", "title": "" }, { "docid": "51077fe28ebdc7598c74625ca27681a5", "score": "0.692389", "text": "def create\n post = Post.new(author_id: params[:author_id], title: params[:title], body: params[:body])\n\n post.save\n render json:post, include: [:author]\n end", "title": "" }, { "docid": "da102ebf7e0cc351a5652c56ec2d3bdf", "score": "0.6908842", "text": "def post_params\n params.require(:post).permit(:title, :author, :content)\n end", "title": "" }, { "docid": "38601e893a1ff3b80bd899c411eacdfc", "score": "0.6898427", "text": "def author_params\n params.require(:author).permit(:name, :surname)\n end", "title": "" }, { "docid": "7bc4cd8e35875719200c2e29c16ff02d", "score": "0.6897714", "text": "def book_params\n params.require(:book).permit(:title, :author, :user_id)\n end", "title": "" }, { "docid": "7bc4cd8e35875719200c2e29c16ff02d", "score": "0.6897714", "text": "def book_params\n params.require(:book).permit(:title, :author, :user_id)\n end", "title": "" }, { "docid": "3a09ec919a9c8e69a6d3dd188761cde0", "score": "0.6895892", "text": "def book_params\n params[:book][:author_id] = params[:book][:author]\n params[:book][:topic_id] = params[:book][:topic]\n \n params.require(:book).permit(:title, :cover_url, :author_id, :topic_id)\n end", "title": "" }, { "docid": "69574aad56a664cd9f3a6649561d61f7", "score": "0.68752617", "text": "def post_params \n params.permit(:title, :description, :created_by) \n end", "title": "" }, { "docid": "47beb898c75121b2790888994d77ffd0", "score": "0.68593997", "text": "def author_params\n params.require(:author).permit(:first_name, :last_name)\n end", "title": "" }, { "docid": "66b1d1e48f98df11cf6bb13717cf8c1b", "score": "0.6844327", "text": "def author_params\n params.require(:author).permit(:paper_id, :first, :middle, :last, :suffix, :laboratory, :institution, :addr_line, :post_code, :settlement, :country)\n end", "title": "" }, { "docid": "fb2938e29e25013dce496cdc7965c17b", "score": "0.6844213", "text": "def author_params\n params.require(:author).permit(:given_name, :family_name)\n end", "title": "" }, { "docid": "e4009b0e11a2b1bbd4cf2bcbf4aa8410", "score": "0.68431866", "text": "def article_params\n\t\tparams.require(:article).permit(:title, :body, :author_id)\n\tend", "title": "" }, { "docid": "89fb1a2583f60759db50c09dd096f2ba", "score": "0.6842546", "text": "def post_params\n params.require(:post).permit(:title, :content, :author, :private, :tags, :user_id)\n end", "title": "" }, { "docid": "edac8d9ee5d8c880e848535f33882041", "score": "0.68361795", "text": "def book_params\n params.require(:book).permit(:title, :author_ids => [])\n end", "title": "" }, { "docid": "7d203c6e75c7102aa91b2e83a9a678a7", "score": "0.6835478", "text": "def create\n @author_post = AuthorPost.new(author_post_params)\n\n respond_to do |format|\n if @author_post.save\n format.html { redirect_to @author_post, notice: 'Author post was successfully created.' }\n format.json { render :show, status: :created, location: @author_post }\n else\n format.html { render :new }\n format.json { render json: @author_post.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d4ea52d188b5c6409b8991318799b7c6", "score": "0.6819695", "text": "def author_params\n params.require(:author).permit(:first_name, :last_name, :bio)\n end", "title": "" }, { "docid": "5a8d4b8e01f58a6b260c6cce5d97117d", "score": "0.68090415", "text": "def post_params\n safe_attributes = [\n commentable_attributes: [ \n :id, :commentable_id, :commentable_type, :author, :comment\n ]\n ]\n params.require(:post).permit(:title, :description, :content, :author_id, (:published if current_user.role == 'editor'), *safe_attributes)\n end", "title": "" }, { "docid": "01f4cf32e12291be6223a1b425f20070", "score": "0.67936414", "text": "def post_params\n params.require(:post).permit(:title, :body, :category_id).merge(user_id: @current_user.id)\n end", "title": "" }, { "docid": "9176673fec1f52ff574bff170cc5eb02", "score": "0.6779778", "text": "def book_params\n params.require(:book).permit(:author_id, :title_id)\n end", "title": "" }, { "docid": "a9ee0a1a6148c324ab38635b2ded9506", "score": "0.6750194", "text": "def set_params\n params.require(:book).permit(:title, :snippet, author_ids: [ ])\n end", "title": "" }, { "docid": "b7d410ef979cf199cd4941f820d203c1", "score": "0.67476374", "text": "def post_params\n params.fetch(:post).permit(:title, :content, :likes, :author)\n end", "title": "" }, { "docid": "b01c12262bbb19686e223f0ff4a7647b", "score": "0.67422825", "text": "def post_params\n params.require(:post).permit(:body, :user_id, :original_post_id)\n end", "title": "" }, { "docid": "41d21377456efa92992630c549c41108", "score": "0.67226243", "text": "def create\n @author = Author.new( params[:author] )\n standard_save_on_create_response( @author )\n end", "title": "" }, { "docid": "cd4f062225c9b14d462a1231bc9d07b7", "score": "0.6714902", "text": "def create\n @post = current_author.posts.new(params[:post])\n\n respond_to do |format|\n if @post.save\n format.html { redirect_to @post, notice: 'Post was successfully created.' }\n else\n format.html { render action: \"new\" }\n end\n end\n end", "title": "" }, { "docid": "369cfae0cd4513488f5c5237e7429872", "score": "0.67135984", "text": "def create\n @author = Author.new(params[:author])\n @author.save!\n redirect_to authors_path, notice: \"Author created successfully\"\n end", "title": "" }, { "docid": "40916fbb5de1481ffd2cd4e4216f8f82", "score": "0.6708777", "text": "def create_author(author:)\n # needs to be turned to hash for rails conventions\n Author.create author.to_h\n end", "title": "" }, { "docid": "17826b098c397bc40a6c916bea476cd8", "score": "0.66939133", "text": "def book_params\n params.require(:book).permit(:title, :cover_image_url, :author_id)\n end", "title": "" }, { "docid": "58c316cceb2e4456e016d46f06a52f31", "score": "0.6690391", "text": "def post_params\n params.require(:post).permit(:title, :url, :content, :author_id, sub_ids: [])\n end", "title": "" }, { "docid": "92319555d156212aae7589a6d7d6314f", "score": "0.6679547", "text": "def author_params\n params.require(:author).permit(:name, :country, :birth_year, :dead_year)\n end", "title": "" }, { "docid": "b60ceb0e1ecbc1a15d9f03a0d41d2745", "score": "0.6673316", "text": "def post_params\n params.require(:post).permit(:title, :author, :blog_entry, :created_at, :user_id)\n end", "title": "" }, { "docid": "db33907eb4ef5c8a8d337509a87942dd", "score": "0.6664487", "text": "def commentary_params\n params.require(:commentary).permit(:content, :author_id)\n end", "title": "" }, { "docid": "54b9ad59673e6382dbb53d35d504d006", "score": "0.6662983", "text": "def book_params\n params.permit(:title, :author)\n end", "title": "" }, { "docid": "a4377236bd9c700363a704373d2d4dce", "score": "0.6661375", "text": "def post_params\n params.require(:post).permit(:title, :content, :author, :published_at, :id, :verify)\n end", "title": "" }, { "docid": "d622a463f89e1dc43c1d84bbb8a546e7", "score": "0.6660802", "text": "def set_author_attributes\n # if we don't have author_attributes[:ids], which shouldn't be allowed to happen\n # (this can happen if a user with multiple pseuds decides to unselect *all* of them)\n sorry = ts(\"You haven't selected any pseuds for this work. Please use Remove Me As Author or consider orphaning your work instead if you do not wish to be associated with it anymore.\")\n if params[:work] && params[:work][:author_attributes] && !params[:work][:author_attributes][:ids]\n setflash; flash.now[:notice] = sorry\n params[:work][:author_attributes][:ids] = [current_user.default_pseud]\n end\n if params[:work] && !params[:work][:author_attributes]\n setflash; flash.now[:notice] = sorry\n params[:work][:author_attributes] = {:ids => [current_user.default_pseud]}\n end\n\n # stuff new bylines into author attributes to be parsed by the work model\n if params[:work] && params[:pseud] && params[:pseud][:byline] && params[:pseud][:byline] != \"\"\n params[:work][:author_attributes][:byline] = params[:pseud][:byline]\n params[:pseud][:byline] = \"\"\n end\n\n # stuff co-authors into author attributes too so we won't lose them\n if params[:work] && params[:work][:author_attributes] && params[:work][:author_attributes][:coauthors]\n params[:work][:author_attributes][:ids].concat(params[:work][:author_attributes][:coauthors]).uniq!\n end\n end", "title": "" }, { "docid": "14aad2409b46fa355d95c9d7c8826efd", "score": "0.6657522", "text": "def post_params\n params.require(:post).permit(:title, :body, :user_id)\n end", "title": "" }, { "docid": "c19c8590e8de75ff62aab439ed306a11", "score": "0.66473186", "text": "def book_params\n params.require(:book).permit(:title, :author)\n end", "title": "" }, { "docid": "e6c6d601c689cdeff4dc3bd05216e2a1", "score": "0.66421103", "text": "def create\n @post = Post.new(post_params)\n @post.author = current_user\n if @post.save\n redirect_to @post\n else\n flash[:error] = \"Something went terribly wrong\"\n render :new\n end\n\n end", "title": "" }, { "docid": "bafa271678d5d351c4d9cea0ae47846e", "score": "0.6641831", "text": "def author_params\n params.fetch(:author, {})\n end", "title": "" }, { "docid": "80e4ba9f498b351a56485a2163b2c630", "score": "0.6638029", "text": "def post_params\n params.require(:post).permit(:title, :description, :usermyid)\n end", "title": "" }, { "docid": "b7db58acb2853af38a14a505d75f1bf5", "score": "0.663306", "text": "def create\n \t@author = Author.new(params.require(:author).permit(:first_name, :last_name, :year))\n \tif @author.save\n \t\tredirect_to author_url(@author)\n \telse\n \t\tredirect_to authors_url\n \tend\n end", "title": "" }, { "docid": "6b7545359fe4d7f96ca8a15dd601abff", "score": "0.6631678", "text": "def post2_params\n params.require(:post2).permit(:title, :content, :author_id)\n end", "title": "" }, { "docid": "d5c920b1dfb5ef37c78ab0a3c8c198b9", "score": "0.66261494", "text": "def post_params\n\t\tparams.require(:post).permit(:title, :content)\t\t#User_id should not be accessible\n\tend", "title": "" }, { "docid": "e21a02a2628e599158c621206a5d53f1", "score": "0.6624368", "text": "def novel_params\n params.permit(:title, :description, :author_id)\n end", "title": "" } ]
275bfc94b72815f96aa751f3db99c563
last_page_list => URL that will take us to the last page of our list of packages (subject to our filters)
[ { "docid": "5b65390878bd006ba3702c82eb2dceb3", "score": "0.8240426", "text": "def last_page_list\n\n sql = Utils.setup_basic_filters(SqlAssembler.new, @params.merge('site_id' => @site[:id]))\n\n sql.set_select 'SELECT id FROM islandora_packages'\n sql.set_order 'ORDER BY id DESC'\n sql.set_limit 'OFFSET ? LIMIT 1', offset_to_last_page\n\n ids = sql.execute\n\n return \"/packages\" + query_string('before' => nil, 'after' => nil) if ids.empty?\n return \"/packages\" + query_string('before' => nil, 'after' => ids[0] + 1)\n end", "title": "" } ]
[ { "docid": "5716ef9b339b8f12d0ca66e743044380", "score": "0.6636063", "text": "def last(num = nil, filters = {}, headers = {})\n filters[:ending_before] = 'last'\n if num.nil?\n filters[:limit] = 1\n response = Clever.request :get, url, filters, headers\n Util.convert_to_clever_object response[:data].last\n else\n filters[:limit] = num\n Clever::APIOperations::PageList.new(url, filters, headers).to_results_list\n end\n end", "title": "" }, { "docid": "cbe431c67f5ef5a0086d85b8d2aab244", "score": "0.650327", "text": "def link_last_page; target_uri(last_page); end", "title": "" }, { "docid": "e42d6f55fc3e0eecb61091a1948a78c2", "score": "0.6441242", "text": "def last_page\n page(page_count)\n end", "title": "" }, { "docid": "f65f71ba4eae0652853972f5c272b015", "score": "0.6405095", "text": "def last(num = nil, filters = {})\n filters = @filters.merge filters\n filters[:ending_before] = 'last'\n if num.nil?\n filters[:limit] = 1\n response = Clever.request :get, @uri, filters, headers\n Util.convert_to_clever_object response[:data].last\n else\n filters[:limit] = num\n Clever::APIOperations::PageList.new(@uri, filters, headers).to_results_list\n end\n end", "title": "" }, { "docid": "d112c58e092076a31939586778487b00", "score": "0.6356949", "text": "def page_links_last\n @page_links_last\n end", "title": "" }, { "docid": "607b339225b53b7a7e71cc166796bf3d", "score": "0.6291342", "text": "def find_last_url(page)\r\n raise 'Define me!'\r\n end", "title": "" }, { "docid": "73ce0297b709adc229cd81ea4a2bbe0a", "score": "0.6270921", "text": "def last_page_url\n links_table[\"last\"]\n end", "title": "" }, { "docid": "6bf79170a049dda67f213990f275dd87", "score": "0.620025", "text": "def build_last_set_link\n unless get_set_param == build_sets.count\n concat link_to('Last Set', \"?page=#{build_sets[total_page_sets].min}&set=#{total_page_sets}\")\n end\n end", "title": "" }, { "docid": "74ed9a74fc524a30e51de03440183d64", "score": "0.6122081", "text": "def get_LastPage()\n \t return @outputs[\"LastPage\"]\n \tend", "title": "" }, { "docid": "74ed9a74fc524a30e51de03440183d64", "score": "0.6122081", "text": "def get_LastPage()\n \t return @outputs[\"LastPage\"]\n \tend", "title": "" }, { "docid": "74ed9a74fc524a30e51de03440183d64", "score": "0.6122081", "text": "def get_LastPage()\n \t return @outputs[\"LastPage\"]\n \tend", "title": "" }, { "docid": "74ed9a74fc524a30e51de03440183d64", "score": "0.6122081", "text": "def get_LastPage()\n \t return @outputs[\"LastPage\"]\n \tend", "title": "" }, { "docid": "74ed9a74fc524a30e51de03440183d64", "score": "0.6122081", "text": "def get_LastPage()\n \t return @outputs[\"LastPage\"]\n \tend", "title": "" }, { "docid": "74ed9a74fc524a30e51de03440183d64", "score": "0.6121862", "text": "def get_LastPage()\n \t return @outputs[\"LastPage\"]\n \tend", "title": "" }, { "docid": "74ed9a74fc524a30e51de03440183d64", "score": "0.6121862", "text": "def get_LastPage()\n \t return @outputs[\"LastPage\"]\n \tend", "title": "" }, { "docid": "74ed9a74fc524a30e51de03440183d64", "score": "0.6121862", "text": "def get_LastPage()\n \t return @outputs[\"LastPage\"]\n \tend", "title": "" }, { "docid": "4af5230931da5caf6de2b801c4ce9e89", "score": "0.6089232", "text": "def last_page\n @ary.paginate(per_page: @per_page, page: @pages)\n end", "title": "" }, { "docid": "9b3a7bdb25b102231cfa6276be2baef6", "score": "0.60742366", "text": "def last\n last_page.last\n end", "title": "" }, { "docid": "010b97cb7ee5ab829cde750202bc9568", "score": "0.6063881", "text": "def pagination_link_last(str,options={})\n paginator = options[:paginator]\n actions = []\n unless paginator.current == paginator.last\n options[:url][:page] = paginator.last\n actions << link_to_remote(str, options)\n end\n \"#{actions}\"\n end", "title": "" }, { "docid": "010b97cb7ee5ab829cde750202bc9568", "score": "0.6063881", "text": "def pagination_link_last(str,options={})\n paginator = options[:paginator]\n actions = []\n unless paginator.current == paginator.last\n options[:url][:page] = paginator.last\n actions << link_to_remote(str, options)\n end\n \"#{actions}\"\n end", "title": "" }, { "docid": "fee561d89fd86b6506f8b03719c885fe", "score": "0.6037567", "text": "def find_last_page(inital_count)\n last_page = self.github_client.last_response.headers[\"link\"]\n \n if last_page.present?\n last_page = last_page.split(\";\")[1].split(\",\")[1].split(\"page=\").last.gsub(\">\", \"\")\n\n return last_page if last_page.to_i.to_s.size == last_page.size\n end\n\n return 1 if self.github_client.last_response.headers[\"link\"].blank?\n\n # For example in case of slack commands we can use `page-X` flag\n # If there are in total 5 pages and we use `page-2` flag\n # The above calculation for last page won't work\n # Thus we need to calculate it using the following code\n if (last_page.to_i.to_s.size != last_page.size) && slack_command?\n array_of_links = self.github_client.last_response.headers[\"link\"].split(';')\n array_of_links.each_with_index do |str, index|\n next if str.exclude?('last')\n last_page = array_of_links[index-1].split('page=')[1].to_i\n end\n \n # In case we do last `page-5` the last page\n # Then again the avobe code won't work\n if last_page.to_i.to_s.size != last_page.size\n last_page = self.github_client.last_response.headers[\"link\"].split(';')[0].split('page=')[1].to_i + 1\n end\n \n return last_page\n else\n return inital_count.to_s\n end\n end", "title": "" }, { "docid": "c6f7cb31de472aad00810b739fd3d1be", "score": "0.60322", "text": "def latest\n @playlists = Playlist.where(:playlist_type => \"Listed\").order('created_at DESC').paginate(:page => params[:page])\n\n render 'index'\n end", "title": "" }, { "docid": "5dc56fc304234d92d5796683deb4ee2b", "score": "0.5995989", "text": "def list_latest\n create_list(:latest, {}, latest_results)\n end", "title": "" }, { "docid": "af78cb97cfb15b10bf6f37e963a50628", "score": "0.5963478", "text": "def last_listing\n session.delete(:last_listing) || '/admin'\n end", "title": "" }, { "docid": "25c92cf23f157a4e022c861dd08842ad", "score": "0.5946828", "text": "def last_page\n [0, (collection.size - 1) / items_per_page].max\n end", "title": "" }, { "docid": "72bf32c7ee1494e3f957c744b7b2eae8", "score": "0.59450907", "text": "def list_url; end", "title": "" }, { "docid": "63052d90a565774f57f5282e2299b30c", "score": "0.5937479", "text": "def jump_back_link( count ) @base_url + query_string( @query.merge( @page_name => (page-count).min(1) ) ) end", "title": "" }, { "docid": "4cee311bbed5eae66d4d10e3281d4d27", "score": "0.5933363", "text": "def last_page\n page_count\n end", "title": "" }, { "docid": "23ed3e68926a8c27677da4bb0e2a1c57", "score": "0.5927185", "text": "def get_last_page web\n web.find_elements(:css, 'div.pagination a[href*=\"?page=\"]').map { |elem|\n elem.attribute('href').match(/\\?page=(\\d+)/)[1].to_i\n }.max\nend", "title": "" }, { "docid": "c70464dda260c5eee3849ea15a2b72b3", "score": "0.5925023", "text": "def last_page\n detect { |link| link.rel == Link::Rel::LAST }\n end", "title": "" }, { "docid": "809a48126d828c0337dea4d36b0cc29f", "score": "0.59094965", "text": "def last\n\t\t\tif @pagination['current_page'] == @pagination['total_pages']\n\t\t\t\treturn false\n\t\t\tend\n\n\t\t\t@filters['page'] = @pagination['total_pages']\n\t\t\tgenerateCollectionData\n\t\tend", "title": "" }, { "docid": "af3524f4af21ff6b3e62c516c2a4ed58", "score": "0.590218", "text": "def has_next_page_list?\n return false if @packages.empty? or @min.nil?\n return @packages.last[:id] > @min\n end", "title": "" }, { "docid": "b7d134823bded625d1aadb54a4db6839", "score": "0.5886011", "text": "def last_page\n self[page_count] \n end", "title": "" }, { "docid": "1a1381372eb03409026b6692da5bb9c0", "score": "0.58726877", "text": "def last_page\n resource_class.all(default_options.merge(page: total_page_count))\n end", "title": "" }, { "docid": "cb9fb3a8b352f7470c1376fac21b3adc", "score": "0.5870271", "text": "def last\n get_results_per_page.last\n end", "title": "" }, { "docid": "cb9fb3a8b352f7470c1376fac21b3adc", "score": "0.5870271", "text": "def last\n get_results_per_page.last\n end", "title": "" }, { "docid": "b66bf8f7abd45a72a897445a6f209dad", "score": "0.5837944", "text": "def list_view_page_count\n if go_to_last_page_link?\n wait_for_update_and_click go_to_last_page_link_element\n sleep 1\n wait_until(Utils.medium_wait) { go_to_page_link_elements.any? }\n count = go_to_page_link_elements.last.text.to_i\n go_to_first_page\n count\n elsif go_to_page_link_elements.any?\n go_to_page_link_elements.length\n else\n 1\n end\n end", "title": "" }, { "docid": "0e644ddcb9853458189723736783bd28", "score": "0.58217525", "text": "def last_page?(pagelist)\n return true if pagelist[get_current_position_in_page_list(pagelist)] == pagelist[-1]\n end", "title": "" }, { "docid": "edc373b98f99dc3db4e018e3ec5734e4", "score": "0.5818016", "text": "def last_page!\n self.page = last_page\n all\n end", "title": "" }, { "docid": "8e7c2c30d7b26e650894705179abf6c7", "score": "0.58171535", "text": "def download_list(view='main')\n call 'download_list'\n end", "title": "" }, { "docid": "88b69a0391b1b1585a0a92feea004b0c", "score": "0.5814285", "text": "def last_page\n page = @options[:pages][:last]\n update_collection_to_page page\n end", "title": "" }, { "docid": "8c332fb809000868769cf4456abb075c", "score": "0.58139205", "text": "def last_page\n return @page_count\n end", "title": "" }, { "docid": "8c332fb809000868769cf4456abb075c", "score": "0.5813818", "text": "def last_page\n return @page_count\n end", "title": "" }, { "docid": "f2a20587e01bb634d6ee738e0de0f6d7", "score": "0.57364064", "text": "def next_page\n request = Yt::Request.new(list_params).tap do |request|\n print \"#{request.as_curl}\\n\" if Yt.configuration.developing?\n end\n response = request.run\n @page_token = nil\n\n Array.wrap response.body\n end", "title": "" }, { "docid": "d5cb7021fd9e4f116e85523187f1be3f", "score": "0.57246137", "text": "def last_page\n (@count / @per_page.to_f).ceil\n end", "title": "" }, { "docid": "4ad61989ee05055b5ff8d7e89ba9707d", "score": "0.5713574", "text": "def retrieve_page_of_email_lists(start_listname)\n\t\t\tputs(\"retrieve_page_of_email_lists : deprecated. Please use Group management instead.\")\n\t\tend", "title": "" }, { "docid": "c410de5c5b79f08c65971385b3a74ed8", "score": "0.5692848", "text": "def last_page=(value)\n @last_page = value\n end", "title": "" }, { "docid": "124ff575f5bcd2eecbc2a3e58ab7884b", "score": "0.5685423", "text": "def page_links_last_page_class_name\n return @page_links_last_page_class_name if defined?(@page_links_last_page_class_name)\n @page_links_last_page_class_name = \"last_page\"\n end", "title": "" }, { "docid": "1aba1487de474542e5a62f9bfaeddf9b", "score": "0.56820065", "text": "def get_next_link\n @dexknows.page.search('li:last-child .prevnext').each do |np|\n next_link = np['href']\n @dexknows.get(next_link)\n @page_num += 1\n get_listings\n end\n end", "title": "" }, { "docid": "97f68dca25f611db5232ac64cf34a106", "score": "0.5648436", "text": "def find_last_pr_url\n # This link will always produce the last PR link at the top of the list - regardless of new PRs being opened\n url = \"https://github.com/rails/rails/pulls?q=is%3Apr+sort%3Acreated-desc\"\n pr_index_page_document = Nokogiri::HTML(URI.open(url).read)\n # Must reach from much larger parent element and include 'div > div > div' because at that point\n # the quickest identification is by ID, which has a dynamic value we cannot use this to grab an\n # element in the first position that we know will change\n last_pr_url = pr_index_page_document.search(PR_ELEMENT_PATH).first['href']\nend", "title": "" }, { "docid": "d4e138c2295769a493b7ec6b55757a8a", "score": "0.5643503", "text": "def last_page\n @last_page ||= WillPaginate::ViewHelpers.total_pages_for_collection(@collection)\n end", "title": "" }, { "docid": "b5c8131bed89256f1c99dcbb398f10a2", "score": "0.5640946", "text": "def find_last_pagenum\n $last_pagenum = $current_page.search '//*[contains(concat( \" \", @class, \" \" ), concat( \" \", \"pagnDisabled\", \" \" ))]'\n $last_pagenum = $last_pagenum.text.to_i # need integer for checks\n end", "title": "" }, { "docid": "b72689bcef3e530d0f2c5f7af6d06999", "score": "0.56303996", "text": "def last(response)\n page(:last, response)\n end", "title": "" }, { "docid": "49ec67a4d87c1733819423c5b9bd1d6e", "score": "0.56272537", "text": "def latest(page=0)\n path = \"/view/last/#{page}\"\n retrieve_stories(path)\n end", "title": "" }, { "docid": "93cfbe269e80a3186fe9502448de8aae", "score": "0.56179017", "text": "def last_page\n property[:last_page]\n end", "title": "" }, { "docid": "2a94bd26bf2a6abf882d1f9000909422", "score": "0.5590287", "text": "def get_last_page web\n web.find_elements(:css, 'div.Pages a[href*=\"contacts/\"]').map { |elem|\n elem.attribute('href').match(%r{contacts(?:/rev)?/\\?page=(\\d+)})[1].to_i\n }.max\nend", "title": "" }, { "docid": "9b2faf9c850b4d74f8f7668a7c78544f", "score": "0.55882996", "text": "def last_item_number\n if next?\n @offset + @pager.per_page\n else\n @pager.count\n end\n end", "title": "" }, { "docid": "9b2faf9c850b4d74f8f7668a7c78544f", "score": "0.55882996", "text": "def last_item_number\n if next?\n @offset + @pager.per_page\n else\n @pager.count\n end\n end", "title": "" }, { "docid": "9b2faf9c850b4d74f8f7668a7c78544f", "score": "0.55882996", "text": "def last_item_number\n if next?\n @offset + @pager.per_page\n else\n @pager.count\n end\n end", "title": "" }, { "docid": "99eab319a270c7f33c8a35690db8cf6e", "score": "0.55870557", "text": "def newest\n session[:current_list_page_number] = 0\n respond_to do |format|\n format.html { redirect_to messages_url}\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4a02c64b76fe623bb7ee456f8c4cfed7", "score": "0.5579253", "text": "def last_page\n self.visible_pages.last if self.visible_pages != nil\n end", "title": "" }, { "docid": "b55bf1c6affef842156d05fe1c4f9798", "score": "0.5562583", "text": "def index\n @packages = PackageService.search(nil).order(created_at: :desc).paginate(:page => params[:page]) #all\n #@packages = @packages.paginate(:page=>params[:page])\n end", "title": "" }, { "docid": "f08f9bb29e60c099b64cce6d6d3c9d5b", "score": "0.5550639", "text": "def last_item_index\n [(items_per_page * (page+1)) - 1, total_item_count - 1].min\n end", "title": "" }, { "docid": "f4313b652083314b64e17cc93a5399bd", "score": "0.5547195", "text": "def last_attachments_links\n link_attachments.order('id DESC').limit(product.attachments.count).order('id ASC')\n end", "title": "" }, { "docid": "bc811a4ca134557bffc4f08ff21a2dc0", "score": "0.5524965", "text": "def last_page?(page: self.page)\n page == count\n end", "title": "" }, { "docid": "c56087f2b46afccc17ff379827887ae3", "score": "0.55050516", "text": "def page_number_links( count )\n pnl = []\n return( pnl ) if( page + 1 >= pages )\n start = page + 1\n stop = (page + count).max(pages)\n (start..stop).each { |p| pnl << @base_url + query_string( @query.merge( @page_name => p ) ) }\n return pnl\n end", "title": "" }, { "docid": "1dc29610b46bbddfb9f65c65ec543391", "score": "0.5504967", "text": "def scrape_last_page url\n info_page = Nokogiri::HTML(open(url))\n log_snore(20)\n pg_numbers = info_page.css()\n return lastpg\n end", "title": "" }, { "docid": "35526c9a052674c429bb574af8fd4edc", "score": "0.5497336", "text": "def count_items_on_last_page\n\t\tc = count_items % items_per_page\n\t\tif c.eql?(0)\n\t\t\treturn items_per_page\n\t\telse\n\t\t\treturn c\n\t\tend\n\tend", "title": "" }, { "docid": "b34f2dd8cc08daa5fc1952cbeefe4d6e", "score": "0.5470335", "text": "def last_page?\n page_number == page_count\n end", "title": "" }, { "docid": "09d27767e5755a892b51f19eeff4ae89", "score": "0.5464272", "text": "def last_page\n (posts_count.to_f / 25.0).ceil.to_i #TODO number of pages in Config class\n end", "title": "" }, { "docid": "290c001b053cd2d81c76da3d07928da5", "score": "0.5461896", "text": "def next_page_path(list: nil, **url_params)\n list ||= page_items\n # noinspection RailsParamDefResolve\n if list.try(:next).present?\n\n # General pagination parameters.\n prm = url_parameters(url_params).except!(:start)\n page = positive(prm.delete(:page))\n offset = positive(prm.delete(:offset))\n limit = positive(prm.delete(:limit))\n size = limit || page_size\n if offset && page\n offset = nil if offset == ((page - 1) * size)\n elsif offset\n page = (offset / size) + 1\n offset = nil\n else\n page ||= 1\n end\n prm[:page] = page + 1 if page\n prm[:offset] = offset + size if offset\n prm[:limit] = limit if limit && (limit != default_page_size)\n\n # Parameters specific to the Bookshare API.\n prm[:start] = list.next\n\n make_path(context[:request].path, **prm)\n\n else\n list.try(:get_link, :next)\n end\n end", "title": "" }, { "docid": "6081a94d908b02624f9a2c02512e0ae9", "score": "0.5439571", "text": "def get_last_page\n query = URI.parse(request.referrer).query\n @last_page = query.nil? ? 0 : CGI.parse(query)[\"page\"].first.to_i\n end", "title": "" }, { "docid": "ca126ff0cbf003edc959f0b3c3d21aa1", "score": "0.54382104", "text": "def url_for_list(type)\n url_for_file(\"#{type}_list.html\")\n end", "title": "" }, { "docid": "eb845903c803bac706ccb28aa9b335c6", "score": "0.54299104", "text": "def latest_list_impressions( options = {} )\n $redis.zrevrange latest_list_key,\n 0, (options.try( :[], :limit) || 0) - 1,\n :with_scores => options.try(:[], :with_count)\n end", "title": "" }, { "docid": "ffb68bdea34f5cb1f9e944e0c8a137fc", "score": "0.5424764", "text": "def get_galleries_after(date, url, filter, cookies)\n galleries = []\n page_num = 0 # page num index from zero\n loop do\n puts url\n result = get_galleries_from(\"#{url}?page=#{page_num}\", filter, cookies)\n after, before = result.partition { |g| g.date > date }\n galleries += after\n puts \"Get #{after.size} galleries from page #{page_num + 1} ranging from #{after.first.date} to #{after.last.date}\"\n page_num += 1\n break unless before.empty?\n end\n galleries\nend", "title": "" }, { "docid": "02d3087148f1923740678ab0d3c47231", "score": "0.54053324", "text": "def get_all_page_urls(first_page_url)\n doc = Nokogiri::HTML(open(first_page_url))\n begin\n last_page_url = URI(doc.xpath(\"//a[contains(@title, 'Last Page')]\")[0][\"href\"])\n last_page_index = Integer(last_page_url.path.match(/index(\\d+)\\.html/)[1])\n base_path = last_page_url.path.match(/(.+)index/)[1]\n\n (1..last_page_index).to_a.map do |i|\n \"http://www.homebrewtalk.com\" + base_path + \"index#{i}.html\"\n end\n rescue\n return [first_page_url]\n end\n end", "title": "" }, { "docid": "3142f3aa346558e7073545e82fd0952d", "score": "0.53953326", "text": "def last_index\n property[:last_index] ||= first_index + (page_size - 1)\n end", "title": "" }, { "docid": "7aaeb58c924ddbbe682c4b0e5c2a7187", "score": "0.5393141", "text": "def list_pagination_links(list, url)\n will_paginate(list, :renderer => CrudStar::RemoteLinkRenderer)\n end", "title": "" }, { "docid": "d4f586cd4858fb23cc28b87c87f487ce", "score": "0.53923976", "text": "def next\r\n if last_page?\r\n raise ListError, 'Already on the last page of the list'\r\n end\r\n \r\n @load_args['page'] = @page + 1 \r\n update_list\r\n end", "title": "" }, { "docid": "817e5496eb5380b4111b8607ec9866d8", "score": "0.5389381", "text": "def end_paginate! results\n # set the link headers\n link = \"\"\n link += \"<#{@next_page}>; rel=\\\"next\\\"\" unless results.empty? or results.count < @limit\n headers['X-Next-Page'] = @next_page unless results.empty? or results.count < @limit\n if not results.empty? and @page > 1\n link += \", \"\n end\n link += \"<#{@prev_page}>; rel=\\\"prev\\\"\" unless @page == 1\n headers['X-Prev-Page'] = @prev_page unless @page == 1\n headers['Link'] = link\n headers['X-Total-Count'] = @collection.count.to_s\n end", "title": "" }, { "docid": "49bf9b8ef95dca0c69b680b7efc29842", "score": "0.53868", "text": "def index\n @urls = Url.all.order(\"pageviews DESC\").limit(100)\n end", "title": "" }, { "docid": "a65e6c9672eaffe67375bc3eb93023cd", "score": "0.53841716", "text": "def last_page\n (total / @request_take) + (((total % @request_take) == 0) ? 0 : 1)\n end", "title": "" }, { "docid": "43de7cd75c90c93fe5e238a187978d07", "score": "0.5384084", "text": "def last_page_number\n Hash(last_page_params).fetch('page', {}).fetch('number', nil)\n end", "title": "" }, { "docid": "2d47cdf12d432f8a46430ad45760892c", "score": "0.53813636", "text": "def index\n #@db_packages = DbPackage.all\n @db_packages = DbPackage.order(\"name asc\").paginate :page => params[:page], :per_page => 25\n end", "title": "" }, { "docid": "69da67c0e434e703be0e781e165b3c21", "score": "0.53786165", "text": "def last_page\n !last_page? ? resource_class.where(original_params.merge(last_page_params.merge(from: from))) : self\n end", "title": "" }, { "docid": "253e9ba43c9138f19300500077e4705d", "score": "0.53734857", "text": "def index\n @packages = Package.order(:name).paginate(page: params[:page], per_page: 10)\n end", "title": "" }, { "docid": "0a7e57e9365a2a05b7f6638ab8bad488", "score": "0.53680444", "text": "def get_pr_links#(index_page_number)\n all_pr_links = []\n\n #Instead of loop do, I set the get_pr_links method to only get links for the first 5 pages (125 Pull Requests)\n pr_index_page_numbers = (1..5).to_a\n\n pr_index_page_numbers.each do |page_number|\n # We start form the frist PR and go toward the last - the base url is 'created-asc'\n # I tried to add a 'limit=100' parameter in the url to show 100 records instead of just 25,\n # decreasing the number of pages to loop through, but it wasnt accepted.\n base_url = \"https://github.com/rails/rails/pulls?page=#{page_number}&q=is%3Apr+sort%3Acreated-asc\"\n current_index_doc = Nokogiri::HTML(URI.open(base_url).read)\n urls_on_current_index = current_index_doc.search(PR_ELEMENT_PATH).map { |element| element['href'] }\n all_pr_links += urls_on_current_index\n # break if all_pr_links.last == find_last_pr_url\n #index_page_number += 1\n sleep 1\n end\n all_pr_links.delete_at(2)\n all_pr_links\nend", "title": "" }, { "docid": "989b4d94074733bdf3625827a023ebf1", "score": "0.5364647", "text": "def last\n @curr = pages - 1\n curr\n end", "title": "" }, { "docid": "5d7ae038abdf3d06c7860966342268f1", "score": "0.53598374", "text": "def onliner_main_urls\n urls = []\n (@url_maker.last_page).times do |page_number|\n urls.push(@url_maker.next_url(page_number))\n end\n urls\n end", "title": "" }, { "docid": "0f53a3f3466ffc2c6a2f5d6a096464f0", "score": "0.535915", "text": "def last_news\n limit = @opts[:limit] || 3\n entries = DcNews.only(:created_by_name, :link, :subject, :created_at)\n .where(active: true) \n .order_by(created_at: -1).limit(limit).to_a\n\n entries.inject('') do |result, element|\n result << @parent.link_to(\"/news/#{element.link}\") do \n %Q[<div>\n <span class=\"date\">#{@parent.dc_pretty_date(element.created_at)} : </span>\n <span class=\"title\">#{element.subject}</span>\n </div>].html_safe\n end\n end\nend", "title": "" }, { "docid": "b2ee8c2561fea6785b44614b2b7d4bd9", "score": "0.5352194", "text": "def get_next_page(count, page, take)\r\n\t\t\t\tif count >= take\r\n\t\t\t\t\t\"#{api_v2_resources_url}?page=#{page.to_i + 1}&take=#{take}\"\r\n\t\t\t\telse\r\n\t\t\t\t\tapi_v2_resources_url\r\n\t\t\t\tend\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\tend", "title": "" }, { "docid": "d9297838083f91892d45b6c3e77da687", "score": "0.5346526", "text": "def end_paginate! results\n # set the link headers\n link = \"\"\n link += \"<#{@next_page}>; rel=\\\"next\\\"\" unless results.empty? or results.count < @limit\n headers['X-Next-Page'] = @next_page unless results.empty? or results.count < @limit\n if not results.empty? and @page > 1\n link += \", \"\n end\n link += \"<#{@prev_page}>; rel=\\\"prev\\\"\" unless @page == 1\n headers['X-Prev-Page'] = @prev_page unless @page == 1\n headers['Link'] = link\n headers['X-Total-Count'] = @count.to_s\n end", "title": "" }, { "docid": "d9297838083f91892d45b6c3e77da687", "score": "0.5346526", "text": "def end_paginate! results\n # set the link headers\n link = \"\"\n link += \"<#{@next_page}>; rel=\\\"next\\\"\" unless results.empty? or results.count < @limit\n headers['X-Next-Page'] = @next_page unless results.empty? or results.count < @limit\n if not results.empty? and @page > 1\n link += \", \"\n end\n link += \"<#{@prev_page}>; rel=\\\"prev\\\"\" unless @page == 1\n headers['X-Prev-Page'] = @prev_page unless @page == 1\n headers['Link'] = link\n headers['X-Total-Count'] = @count.to_s\n end", "title": "" }, { "docid": "00865cc23b507be70a1e06c7d7b8f4c8", "score": "0.5341911", "text": "def index\n raw_params = params.with_indifferent_access\n\n @sort, @packages = \\\n PackageSorterJob.perform_now raw_params, cookies\n\n if @packages.length == 1\n redirect_to @packages.first\n return\n end\n end", "title": "" }, { "docid": "41e08e88c5c4a78df6341734ecf51799", "score": "0.534179", "text": "def list\n @downloads = Download.where(project_id: sessions_current_project_id).order(:id).page(params[:page]).per(params[:per])\n end", "title": "" }, { "docid": "0630934329f4bfa3c563213bcd00b7a1", "score": "0.53399944", "text": "def lastPage(resetmargins=false)\n setPage(getNumPages(), resetmargins)\n end", "title": "" }, { "docid": "370b653aa41e622bafb9cd6a399f1358", "score": "0.5337675", "text": "def last_item\n [@paginator.items_per_page * @number, @paginator.item_count].min\n end", "title": "" }, { "docid": "7ae36badd7095dca3e872c8a63610c5d", "score": "0.5323285", "text": "def last\n tested_url = TestedUrl.where(url: params[:url]).order(created_at: :desc).first\n if tested_url.present?\n render json: tested_url.api_response_with_max_json\n else\n render nothing: true, status: 404\n end\n end", "title": "" }, { "docid": "d853d929a4edb7756ed9fa941d5f1e31", "score": "0.53124917", "text": "def last_page(&block)\n new_static_callback(:last_page,&block)\n end", "title": "" }, { "docid": "0b122438a5ed959881cce2234a5c8c5c", "score": "0.53090763", "text": "def get_discipline_pages\n response = RestClient.get(\"http://www.gw2spidy.com/api/v0.9/json/recipes/1\")\n pages = JSON.parse(response)[\"last_page\"]\n return pages\nend", "title": "" } ]
f7275f15627ea49c5ea197b18e0ab7e1
Patch a user's CallForwarding
[ { "docid": "35277a655dc0da67403c0610126a4c10", "score": "0.72009873", "text": "def patch_user_callforwarding(user_id, body, opts = {})\n data, _status_code, _headers = patch_user_callforwarding_with_http_info(user_id, body, opts)\n return data\n end", "title": "" } ]
[ { "docid": "bd1401b5f3cba954d8a22cb19605dc6e", "score": "0.6805415", "text": "def patch_user_callforwarding_with_http_info(user_id, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UsersApi.patch_user_callforwarding ...\"\n end\n \n \n # verify the required parameter 'user_id' is set\n fail ArgumentError, \"Missing the required parameter 'user_id' when calling UsersApi.patch_user_callforwarding\" if user_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'body' is set\n fail ArgumentError, \"Missing the required parameter 'body' when calling UsersApi.patch_user_callforwarding\" if body.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/users/{userId}/callforwarding\".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(body)\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'CallForwarding')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UsersApi#patch_user_callforwarding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "ec0534963777246d4c2f3247d6167d51", "score": "0.6737546", "text": "def patch_user_callforwarding_with_http_info(user_id, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UsersApi.patch_user_callforwarding ...\"\n end\n \n \n # verify the required parameter 'user_id' is set\n fail ArgumentError, \"Missing the required parameter 'user_id' when calling UsersApi.patch_user_callforwarding\" if user_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'body' is set\n fail ArgumentError, \"Missing the required parameter 'body' when calling UsersApi.patch_user_callforwarding\" if body.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/users/{userId}/callforwarding\".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(body)\n \n auth_names = ['PureCloud Auth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'CallForwarding')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UsersApi#patch_user_callforwarding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "c56de9fcd04e15e9aca9dd6922c7bd1d", "score": "0.6294469", "text": "def update_forward(username, forward_to, action=\"KEEP\", enable=true)\n msg = EmailMessage.new\n msg.update_forward(forward_to, enable, action)\n response = @apps.request(:update_forward, username+'/forwarding', msg.to_s)\n end", "title": "" }, { "docid": "68a2c42dc45d9d120d8b5a3b1e4a3671", "score": "0.61998856", "text": "def put_user_callforwarding_with_http_info(user_id, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UsersApi.put_user_callforwarding ...\"\n end\n \n \n # verify the required parameter 'user_id' is set\n fail ArgumentError, \"Missing the required parameter 'user_id' when calling UsersApi.put_user_callforwarding\" if user_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'body' is set\n fail ArgumentError, \"Missing the required parameter 'body' when calling UsersApi.put_user_callforwarding\" if body.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/users/{userId}/callforwarding\".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(body)\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'CallForwarding')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UsersApi#put_user_callforwarding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "bf8f84e4793affc7e5d5df69d897879f", "score": "0.61781436", "text": "def put_user_callforwarding_with_http_info(user_id, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UsersApi.put_user_callforwarding ...\"\n end\n \n \n # verify the required parameter 'user_id' is set\n fail ArgumentError, \"Missing the required parameter 'user_id' when calling UsersApi.put_user_callforwarding\" if user_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'body' is set\n fail ArgumentError, \"Missing the required parameter 'body' when calling UsersApi.put_user_callforwarding\" if body.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/users/{userId}/callforwarding\".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(body)\n \n auth_names = ['PureCloud Auth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'CallForwarding')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UsersApi#put_user_callforwarding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "d5fe3be67db0cb031ef1e89537885208", "score": "0.6118769", "text": "def put_user_callforwarding(user_id, body, opts = {})\n data, _status_code, _headers = put_user_callforwarding_with_http_info(user_id, body, opts)\n return data\n end", "title": "" }, { "docid": "d5fe3be67db0cb031ef1e89537885208", "score": "0.6118769", "text": "def put_user_callforwarding(user_id, body, opts = {})\n data, _status_code, _headers = put_user_callforwarding_with_http_info(user_id, body, opts)\n return data\n end", "title": "" }, { "docid": "1bed4afcd95c932a7527badc3cd7bfb2", "score": "0.6100106", "text": "def forward\n @call.update(action: 'forward', status: params[:CallStatus])\n end", "title": "" }, { "docid": "3b79ec0097a76ef85fc6e9656edc3daf", "score": "0.60204494", "text": "def patch_user(user_id, request)\n start.uri('/api/user')\n .url_segment(user_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .patch()\n .go()\n end", "title": "" }, { "docid": "6b7f9fc3b7fdf8afd4736aafc0541f06", "score": "0.59133875", "text": "def patch_as user, patch_path, patch_args = nil\n send_as :patch, user, patch_path, patch_args\n end", "title": "" }, { "docid": "4efb797efabe021f66cb7fa9deeb094f", "score": "0.5879926", "text": "def patch_as(user, url, **opt, &block); end", "title": "" }, { "docid": "12908f39105753da11062ff82551e59b", "score": "0.5790648", "text": "def get_user_callforwarding_with_http_info(user_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UsersApi.get_user_callforwarding ...\"\n end\n \n \n # verify the required parameter 'user_id' is set\n fail ArgumentError, \"Missing the required parameter 'user_id' when calling UsersApi.get_user_callforwarding\" if user_id.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/users/{userId}/callforwarding\".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'CallForwarding')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UsersApi#get_user_callforwarding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "c19b1efb0bb941ffbf33bd367f73e897", "score": "0.57562876", "text": "def patch_agent\n if not $redis.exists(\"call:#{self.id}:started_calling_agents\")\n $redis.setex(\"call:#{self.id}:started_calling_agents\", 600, \"1\")\n User.available.each do |user|\n $redis.rpush(\"call:#{self.id}:agents_to_call\", user.id)\n end\n $redis.expire(\"call:#{self.id}:agents_to_call\", 600)\n end \n \n if $redis.exists(\"call:#{self.id}:started_calling_agents\")\n id = $redis.lpop(\"call:#{self.id}:agents_to_call\")\n if id \n user = User.where(:id => id).first\n user.accept_call(self)\n else\n $twilio_client.account.calls.get(self.twilio_call_sid).redirect_to(\"http://184.183.31.238:3000/call_handler/leave_message.xml?sorry=true\")\n end\n end\n end", "title": "" }, { "docid": "bfe24383251efd55e088cc2b6f8ca0ec", "score": "0.57424456", "text": "def get_user_callforwarding_with_http_info(user_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UsersApi.get_user_callforwarding ...\"\n end\n \n \n # verify the required parameter 'user_id' is set\n fail ArgumentError, \"Missing the required parameter 'user_id' when calling UsersApi.get_user_callforwarding\" if user_id.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/users/{userId}/callforwarding\".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud Auth']\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 => 'CallForwarding')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UsersApi#get_user_callforwarding\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "ac9f00671dec21ad74eb65dde4104b28", "score": "0.56448793", "text": "def patch_registration(user_id, request)\n start.uri('/api/user/registration')\n .url_segment(user_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .patch()\n .go()\n end", "title": "" }, { "docid": "13767d6ee68da4068615d9dbe7f7726a", "score": "0.56333685", "text": "def update\n session[:forwarding_url] = request.url\n end", "title": "" }, { "docid": "302fd13d7fd5b632d7924e0c6a21e2fd", "score": "0.55182266", "text": "def update_user(options)\n patch \"user\", options\n end", "title": "" }, { "docid": "5151e07b09e48347ad407f636b085d24", "score": "0.5514495", "text": "def update\n @call_forward = CallForward.find(params[:id])\n\n respond_to do |format|\n if @call_forward.update_attributes(params[:call_forward])\n format.html { redirect_to(@call_forward, :notice => t(:call_forward_updated)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @call_forward.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "18b67256d36c9aec8daea30200d74cd7", "score": "0.5476996", "text": "def forwarded!\n @forwarded = true\n end", "title": "" }, { "docid": "fb1d4679208c976a61c0f24e22af2f0f", "score": "0.54692376", "text": "def patch_user_action(user_action_id, request)\n start.uri('/api/user-action')\n .url_segment(user_action_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .patch()\n .go()\n end", "title": "" }, { "docid": "7cc73cdaf607b3add6427fdc3b588c65", "score": "0.5373949", "text": "def set_ForwardingURL(value)\n set_input(\"ForwardingURL\", value)\n end", "title": "" }, { "docid": "7cc73cdaf607b3add6427fdc3b588c65", "score": "0.5373949", "text": "def set_ForwardingURL(value)\n set_input(\"ForwardingURL\", value)\n end", "title": "" }, { "docid": "7cc73cdaf607b3add6427fdc3b588c65", "score": "0.5373949", "text": "def set_ForwardingURL(value)\n set_input(\"ForwardingURL\", value)\n end", "title": "" }, { "docid": "47038f2dfa659cb10106deea47d735e8", "score": "0.5369258", "text": "def proxy_user; end", "title": "" }, { "docid": "47038f2dfa659cb10106deea47d735e8", "score": "0.5369258", "text": "def proxy_user; end", "title": "" }, { "docid": "47038f2dfa659cb10106deea47d735e8", "score": "0.5369258", "text": "def proxy_user; end", "title": "" }, { "docid": "9b0852db7ef4d60c342117953796234d", "score": "0.5362706", "text": "def update!(**args)\n @forwarding_path = args[:forwarding_path] if args.key?(:forwarding_path)\n @ipv4_address = args[:ipv4_address] if args.key?(:ipv4_address)\n @ipv6_address = args[:ipv6_address] if args.key?(:ipv6_address)\n @kind = args[:kind] if args.key?(:kind)\n end", "title": "" }, { "docid": "9b0852db7ef4d60c342117953796234d", "score": "0.5362706", "text": "def update!(**args)\n @forwarding_path = args[:forwarding_path] if args.key?(:forwarding_path)\n @ipv4_address = args[:ipv4_address] if args.key?(:ipv4_address)\n @ipv6_address = args[:ipv6_address] if args.key?(:ipv6_address)\n @kind = args[:kind] if args.key?(:kind)\n end", "title": "" }, { "docid": "4fdf8ed5ee51675f1b18038fca44061a", "score": "0.53523624", "text": "def set_ForwardingURL(value)\n set_input(\"ForwardingURL\", value)\n end", "title": "" }, { "docid": "4fdf8ed5ee51675f1b18038fca44061a", "score": "0.53523624", "text": "def set_ForwardingURL(value)\n set_input(\"ForwardingURL\", value)\n end", "title": "" }, { "docid": "4fdf8ed5ee51675f1b18038fca44061a", "score": "0.53518295", "text": "def set_ForwardingURL(value)\n set_input(\"ForwardingURL\", value)\n end", "title": "" }, { "docid": "4fdf8ed5ee51675f1b18038fca44061a", "score": "0.5351477", "text": "def set_ForwardingURL(value)\n set_input(\"ForwardingURL\", value)\n end", "title": "" }, { "docid": "4fdf8ed5ee51675f1b18038fca44061a", "score": "0.5351477", "text": "def set_ForwardingURL(value)\n set_input(\"ForwardingURL\", value)\n end", "title": "" }, { "docid": "4fdf8ed5ee51675f1b18038fca44061a", "score": "0.5351477", "text": "def set_ForwardingURL(value)\n set_input(\"ForwardingURL\", value)\n end", "title": "" }, { "docid": "4fdf8ed5ee51675f1b18038fca44061a", "score": "0.5351477", "text": "def set_ForwardingURL(value)\n set_input(\"ForwardingURL\", value)\n end", "title": "" }, { "docid": "4fdf8ed5ee51675f1b18038fca44061a", "score": "0.5351477", "text": "def set_ForwardingURL(value)\n set_input(\"ForwardingURL\", value)\n end", "title": "" }, { "docid": "4fdf8ed5ee51675f1b18038fca44061a", "score": "0.5351477", "text": "def set_ForwardingURL(value)\n set_input(\"ForwardingURL\", value)\n end", "title": "" }, { "docid": "4fdf8ed5ee51675f1b18038fca44061a", "score": "0.5351477", "text": "def set_ForwardingURL(value)\n set_input(\"ForwardingURL\", value)\n end", "title": "" }, { "docid": "4fdf8ed5ee51675f1b18038fca44061a", "score": "0.5351477", "text": "def set_ForwardingURL(value)\n set_input(\"ForwardingURL\", value)\n end", "title": "" }, { "docid": "4fdf8ed5ee51675f1b18038fca44061a", "score": "0.5351477", "text": "def set_ForwardingURL(value)\n set_input(\"ForwardingURL\", value)\n end", "title": "" }, { "docid": "4fdf8ed5ee51675f1b18038fca44061a", "score": "0.5351477", "text": "def set_ForwardingURL(value)\n set_input(\"ForwardingURL\", value)\n end", "title": "" }, { "docid": "4fdf8ed5ee51675f1b18038fca44061a", "score": "0.5351477", "text": "def set_ForwardingURL(value)\n set_input(\"ForwardingURL\", value)\n end", "title": "" }, { "docid": "4fdf8ed5ee51675f1b18038fca44061a", "score": "0.5351477", "text": "def set_ForwardingURL(value)\n set_input(\"ForwardingURL\", value)\n end", "title": "" }, { "docid": "123ed15f3c0139aa7606ec4fdd5fdfe4", "score": "0.5341004", "text": "def update!(**args)\n @forwarding_path = args[:forwarding_path] if args.key?(:forwarding_path)\n @ipv4_address = args[:ipv4_address] if args.key?(:ipv4_address)\n @kind = args[:kind] if args.key?(:kind)\n end", "title": "" }, { "docid": "123ed15f3c0139aa7606ec4fdd5fdfe4", "score": "0.5341004", "text": "def update!(**args)\n @forwarding_path = args[:forwarding_path] if args.key?(:forwarding_path)\n @ipv4_address = args[:ipv4_address] if args.key?(:ipv4_address)\n @kind = args[:kind] if args.key?(:kind)\n end", "title": "" }, { "docid": "dabbab4b5f802da30c43fa8169c2f0c6", "score": "0.52966374", "text": "def recieve(user)\n user_id = user.resolve_id if user.respond_to?(:resolve_id)\n response = API::Shimakaze.give(@interface, @bot_id, user_id || user, @id)\n patch(response['targetUser'])\n user.patch(response['sourceUser']) if user.is_a?(User)\n self\n end", "title": "" }, { "docid": "5e04784af635946dc5729c559cd82ca2", "score": "0.5277324", "text": "def update_user!(user: nil)\n not_implemented(__method__)\n end", "title": "" }, { "docid": "02ab705bfe086128813ab0a3cc1f6484", "score": "0.5265624", "text": "def change_phone_number(phone_number, allow_flash_call: false, is_current_phone_number: false)\n broadcast('@type' => 'changePhoneNumber',\n 'phone_number' => phone_number,\n 'allow_flash_call' => allow_flash_call,\n 'is_current_phone_number' => is_current_phone_number)\n end", "title": "" }, { "docid": "68d3c09d46312da88641a11493b658bf", "score": "0.5248308", "text": "def proxy_user=(_arg0); end", "title": "" }, { "docid": "68d3c09d46312da88641a11493b658bf", "score": "0.5248308", "text": "def proxy_user=(_arg0); end", "title": "" }, { "docid": "68d3c09d46312da88641a11493b658bf", "score": "0.5248308", "text": "def proxy_user=(_arg0); end", "title": "" }, { "docid": "55f0e38dac16812e20980dfd84ded443", "score": "0.52331537", "text": "def enable_forwarding(username, forward_to, action=\"ARCHIVE\")\n msg = GEmailMessage.new\n msg.add_property('enable', \"true\")\n msg.add_property('forwardTo', forward_to)\n msg.add_property('action', action)\n response = @connection.request(@action[:forwarding], \"/#{username}/forwarding\", msg.to_s)\n return !response.nil?\n end", "title": "" }, { "docid": "1873c8a022443c6612d38e2388e989f5", "score": "0.5210699", "text": "def create_forward\n\n active = false\n entry.montanaEduPersonClassicRoles.each do |role|\n if $forward_domains.has_key?(role[0..3])\n active = true\n forward = \"#{username}@#{$forward_domains[role[0..3]]}\"\n elsif role[3,1] == \"e\"\n active = false\n forward = entry.mail\n end\n begin\n # Add the email address they're used to seeing\n puts \" Adding mailforward |#{forward}| to |#{username}|.\" if $options.verbose\n result = apps.mail.update_forward(username, forward, \"KEEP\", active)\n puts \"Result: #{result}\" if $options.debug\n update = true\n rescue GData::GDataError => e\n if e.code == \"1300\"\n puts \" => adding mailforward #{forward} to #{username} exists\" if $options.verbose\n update = true\n elsif e.code == \"1000\"\n puts \" => adding mailforward #{forward} to #{username} unknown error\" if $options.verbose\n update = false\n #retry\n else\n puts \"Error creating user: #{username}\" if $options.verbose\n raise e\n end\n rescue OpenSSL::SSL::SSLError => e\n retry\n end\n end\nend", "title": "" }, { "docid": "e1487978f83fc3b25bdbc2a82cdd925d", "score": "0.52033967", "text": "def update\n @old_phone_number = @user.phone_number\n respond_to do |format|\n if @user.update(user_params)\n reverify_if_phone_changed and return\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { render :show, status: :ok, location: @user }\n else\n format.html { render :edit }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "83b426e5d294044c38d3c65c49b1a2af", "score": "0.5177688", "text": "def ref_update(user)\n send_as :ref\n from user\n fbml render(:action=>\"/users/profile\",:assigns=>{:user=>user_to_update})\n handle \"a_ref_handle\"\n end", "title": "" }, { "docid": "4860e01ceab7b147429ec3c3e6e85b41", "score": "0.5174395", "text": "def incomingCall\n sys.SetFromHeader(formatNum(@cname || @cid,true), nil, Host) # Set FromName & FromHost for sys.Dial\n\n # Forward call to the bindings (ATA / softphone)\n # Change FromURI when forwarding to @local, or else Bria won't find contact in its phonebook!\n\n callswitch(\"#{@user}@local[fu=#{@cid}]\",45) unless (30..745) === @t.hour*100 + @t.min # reject incoming calls from 0:30a to 7:45a\n\n @code, @reason = 480, \"#{@user} is asleep\" unless @code # if nothing else, must be the night hour\n @code = 486 if @trunk =~ /IPCOMM/i ## *** temporary fix for IPCOMMS ***\nend", "title": "" }, { "docid": "548cf3025e111aaab2775c88a9586b25", "score": "0.5167687", "text": "def test_update_webhook\n user = Plaid::User.load(:connect, 't0k3n')\n\n body = credentials.merge('options' =>\n '{\"webhook\":\"http://example.org/hook\"}')\n\n stub_api :patch, 'connect', body: body, response: :connect_add\n\n assert_same user, user.update_webhook('http://example.org/hook')\n end", "title": "" }, { "docid": "f96b040c65bca5a09c338191ffa1408b", "score": "0.5146822", "text": "def patch_forwarding_rule_0(domain_id, forwarding_policy_id, rule_id, forwarding_rule, opts = {})\n patch_forwarding_rule_0_with_http_info(domain_id, forwarding_policy_id, rule_id, forwarding_rule, opts)\n nil\n end", "title": "" }, { "docid": "5ed18bd7e3da11394d226e50683aac2c", "score": "0.5141658", "text": "def update_contact_methods(user)\n contact_methods = fetch_users_contact_methods(user['id'])\n user['contact_methods'] = contact_methods.select { |cm|\n SupportApp.pager_duty_contact_method_types.include? cm['type']\n }\n user\n end", "title": "" }, { "docid": "e966ef542c555403cca0f55e4426d3ee", "score": "0.5063912", "text": "def reboot_phone\n self.sip_account.phone.reboot if self.sip_account.phone.rebootable?\n end", "title": "" }, { "docid": "077c1f1a3034909d4cc0da703a8d82d6", "score": "0.5063084", "text": "def spoof\n @grpc.spoof\n end", "title": "" }, { "docid": "d577a96e7ab4fe747ed7c2ee011de4ec", "score": "0.505138", "text": "def patch_forwarding_rule(domain_id, forwarding_policy_id, rule_id, forwarding_rule, opts = {})\n patch_forwarding_rule_with_http_info(domain_id, forwarding_policy_id, rule_id, forwarding_rule, opts)\n nil\n end", "title": "" }, { "docid": "88096de8e989373270a39397dafb2ab3", "score": "0.5051152", "text": "def enable_two_factor(user_id, request)\n start.uri('/api/user/two-factor')\n .url_segment(user_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .post()\n .go()\n end", "title": "" }, { "docid": "1899ecdd57ea56b19b2bb41dc2650458", "score": "0.50394416", "text": "def user_calls\n redirect_to action: 'user_calls_get', params: params\n end", "title": "" }, { "docid": "531ee0f687ac4ee1eed366fd3713262f", "score": "0.5035075", "text": "def reactivate_user(user_id)\n start.uri('/api/user')\n .url_segment(user_id)\n .url_parameter('reactivate', true)\n .put()\n .go()\n end", "title": "" }, { "docid": "829bf2d7f28aef83e6e72e8f695c8e08", "score": "0.50338", "text": "def enable_two_factor(user_id, request)\n start.uri('/api/user/two-factor')\n .url_segment(user_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .post()\n .go()\n end", "title": "" }, { "docid": "3cf89a3e01b568cf29abc4a30bfe8b73", "score": "0.50285065", "text": "def update_number\n @call = Call.where(:twilio_call_sid => params[:CallSid]).first\n @call.update_attribute(:caller, params[:Digits]) if params[:Digits] and params[:Digits].size > 1 \n respond_to do |format|\n format.html\n format.xml\n end\n end", "title": "" }, { "docid": "ac7991ee06b390eaeb4f093b28f0c768", "score": "0.50271183", "text": "def trigger_call_from_customer\n client.calls.create(\n from: \"+#{config['callee_id']}\",\n to: \"+#{config['caller_id']}\",\n url: twiml_test_message_url\n )\n end", "title": "" }, { "docid": "550438f363ed0d0c24215064c568c848", "score": "0.5017377", "text": "def reactivate_user(user_id)\n start.uri('/api/user')\n .url_segment(user_id)\n .url_parameter('reactivate', true)\n .put()\n .go()\n end", "title": "" }, { "docid": "03cae84b7354c5cd690a94e0c5372d17", "score": "0.49996078", "text": "def _sync_campaign_forwards(forwards, campaign)\n end", "title": "" }, { "docid": "d415935ab8eaac6a8210b5c5a01d673c", "score": "0.49794787", "text": "def patch_agent\n if params[:agent_call_id]\n @call = Call.find(params[:agent_call_id])\n else\n @call = Call.received_from_agent(params)\n end\n @customer_call = Call.find(params[:call_id])\n if params[:next_agent] and params[:agent_call_id]\n @call.user.unlock_agent\n @customer_call.patch_agent\n end\n respond_to do |format|\n format.html\n format.xml\n end\n end", "title": "" }, { "docid": "9c3e04ef354c8ae26a5e98f86ca6c3da", "score": "0.49600464", "text": "def user_set_friend_pings(user_id, value)\n response = connection.post do |req|\n req.url \"users/#{user_id}/setpings\", value\n end\n return_error_or_body(response, response.body.response)\n end", "title": "" }, { "docid": "201fc3f5f59897641a49ea7a7236f3f0", "score": "0.49477455", "text": "def set_override_call_list\n @override_call_list = OverrideCallList.find(params[:id])\n end", "title": "" }, { "docid": "3cf2732832e04e99db5260c927b9f933", "score": "0.49323204", "text": "def patch\n redirect_to root_url if current_user.user_type != 1\n end", "title": "" }, { "docid": "3b6b9f9f2d780679ee7d5d6f90a1aef6", "score": "0.49303314", "text": "def forward_user_attributes\n User.attribute_names.each do |attr|\n # Don't allow methods to be over written\n if not self.attribute_names.include?(attr) \n meta_def attr do self.user.send attr\n end\n\n meta_def \"#{attr}=\".to_sym do |x|\n self.user.send \"#{attr}=\".to_sym, x\n end\n end\n end\n end", "title": "" }, { "docid": "ffdb59071a95a760c0eeba26eabc1d3a", "score": "0.49191022", "text": "def update_user(options); end", "title": "" }, { "docid": "2e7f73d956195fdfc6407240a1d34507", "score": "0.49119848", "text": "def link_netbadge\n redirect_to(me_path) if session['REMOTE_USER'].blank?\n # make changes to user record\n #link_account_to_netbadgeid()\n current_user.netbadgeid = session['REMOTE_USER']\n upgrade_to_full_access()\n current_user.save!\n # restart the session as a netbadge based session\n #logout_session()\n # redirect to user profile in http protocol\n redirect_to( me_path )\n end", "title": "" }, { "docid": "77a4ba26785e0bcacfb4f2112e1b949e", "score": "0.4889731", "text": "def get_forwarding_number\n puts \"===========in get_forwarding_number #{Time.now}\"\n uri = URI.parse(GET_FORWARDING_NUMBER)\n param_hash = {APIUserName: USER_NAME, APIPassword: PASSWORD}\n PhoneScript.unscoped.where(is_deleted: false).without_xps_number.with_twilio.each do |phone_script|\n param_hash.merge!(CampaignID: phone_script.campaign_id)\n res = Net::HTTP.post_form(uri,param_hash)\n puts \"*********res.body = #{res.body}\"\n xps_phone = Hash.from_xml(res.body)[\"ForwardingNumber\"][\"FordwardingNumber\"]\n phone_script.update_column(:xps_phone, xps_phone)\n if xps_phone && xps_phone != '-1'\n ClientMailer.delay.new_script_active(phone_script.name, phone_script.created_at, phone_script.tenant.owner.first_name, phone_script.tenant.owner.email, phone_script)\n end\n puts \"==== xps_phone = #{xps_phone}=====in -> campaign_id = #{phone_script.id} loop #{Time.now}\"\n end\n end", "title": "" }, { "docid": "11befa1032cdefb3a933660fc12b53c0", "score": "0.4887698", "text": "def callin=(value)\n execute(\"ipmitool channel setaccess #{@channel} #{@property_hash[:userid]} callin=#{to_enable(value)}\")\n end", "title": "" }, { "docid": "bbfd47753e80e0080e2d5f15b3ef0bda", "score": "0.48686036", "text": "def patch=(_arg0); end", "title": "" }, { "docid": "d35a252c21167cf32205adf25388f62a", "score": "0.48675898", "text": "def disable_two_factor_with_request(user_id, request)\n start.uri('/api/user/two-factor')\n .url_segment(user_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .delete()\n .go()\n end", "title": "" }, { "docid": "be8fc2319445d9cfc70e0194b348bf63", "score": "0.48637596", "text": "def accept_call(call)\n if self.available?\n self.lock_agent\n $twilio_client.account.calls.create(\n :from => \"+16023888925\",\n :to => \"#{self.phone}\",\n :url => @@router.patch_agent_call_handler_url(:format => :xml, :call_id => call.id),\n :method => \"GET\"\n )\n end\n end", "title": "" }, { "docid": "03f19b28625995234448f711c94848b1", "score": "0.4863258", "text": "def update\n phone_call_params[:admin_user_id] = current_admin_user.id\n ap phone_call_params\n respond_to do |format|\n if @phone_call.update(phone_call_params)\n format.html { redirect_to @phone_call, notice: 'Phone call was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @phone_call.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6cc49a88549a08a8c1ffcfcf0166ded2", "score": "0.48618466", "text": "def perform_patch; end", "title": "" }, { "docid": "2096cfda58249d680b3f8e5628b6bf3b", "score": "0.485752", "text": "def get_user_callforwarding(user_id, opts = {})\n data, _status_code, _headers = get_user_callforwarding_with_http_info(user_id, opts)\n return data\n end", "title": "" }, { "docid": "2096cfda58249d680b3f8e5628b6bf3b", "score": "0.485752", "text": "def get_user_callforwarding(user_id, opts = {})\n data, _status_code, _headers = get_user_callforwarding_with_http_info(user_id, opts)\n return data\n end", "title": "" }, { "docid": "8f9bd0167328ee4339eab2f95939ca76", "score": "0.48526227", "text": "def call_forward(phone_number,\n use_case_code,\n extra=nil,\n timeout=nil)\n\n params = {:ucid => use_case_code}\n\n unless extra.nil?\n params.merge!(extra)\n end\n\n execute(Net::HTTP::Get,\n \"/v1/phoneid/call_forward/#{phone_number}\",\n params,\n nil,\n timeout)\n end", "title": "" }, { "docid": "4c1d9611d42d038eb3f5cef81b6040b5", "score": "0.48454106", "text": "def follow! user\n comm_peer = request_grant_to_follow user\n comm_peer.comm_port.user.grant_to_follow self\n end", "title": "" }, { "docid": "f6f2f6d1aa9f1d52604ec8f910ff1690", "score": "0.4844963", "text": "def set_ViaUser(value)\n set_input(\"ViaUser\", value)\n end", "title": "" }, { "docid": "f6f2f6d1aa9f1d52604ec8f910ff1690", "score": "0.4844963", "text": "def set_ViaUser(value)\n set_input(\"ViaUser\", value)\n end", "title": "" }, { "docid": "a81920d9e28e141a3a1e996d7e98a90b", "score": "0.48414886", "text": "def addforward (opts)\n default_options = {\n :user => '',\n :forward_what => '',\n :forward_to => ''\n }\n\n opts.reverse_merge! default_options\n post 'addforward', opts\n end", "title": "" }, { "docid": "a6d2e276d02c66970a03a21e13d8cf37", "score": "0.4837133", "text": "def patch; end", "title": "" }, { "docid": "602bb0877be0ed1458fb554735125ea9", "score": "0.4826611", "text": "def update!(**args)\n @direct_user_request = args[:direct_user_request] if args.key?(:direct_user_request)\n @ip_address = args[:ip_address] if args.key?(:ip_address)\n @user_agent = args[:user_agent] if args.key?(:user_agent)\n @user_id = args[:user_id] if args.key?(:user_id)\n end", "title": "" }, { "docid": "396fd748d719bfd8637bc08e21c341ff", "score": "0.48231924", "text": "def receive(user, person)\n Rails.logger.info(\"event=receive payload_type=request sender=#{self.sender} to=#{self.recipient}\")\n\n contact = user.contacts.find_or_initialize_by_person_id(self.sender.id)\n contact.sharing = true\n contact.save\n \n user.share_with(person, user.auto_follow_back_aspect) if user.auto_follow_back && !contact.receiving\n\n self\n end", "title": "" }, { "docid": "bdbebba67acee6e81e7a58cfdf9c35c3", "score": "0.48224923", "text": "def try_to_forward_device\n @fwd_to = params[:select_fwd]\n\n can_fwd = true\n\n if @fwd_to != \"0\"\n\n #checking can we forward\n d = Device.where(:id => @fwd_to).first\n can_fwd = false if d.forward_to == @device.id\n\n while !(d.forward_to == 0 or d.forward_to == @device.id)\n d = Device.where(:id => d.forward_to).first\n can_fwd = false if d.forward_to == @device.id\n end\n\n end\n\n\n if can_fwd\n\n if @fwd_to != \"0\"\n flash[:status] = _('device') + ' '+@device.name.to_s + ' ' +_('forwarded_to')+ ' ' + Device.where(:id => @fwd_to).first.name.to_s\n else\n flash[:status] = _('device') + ' ' + @device.name.to_s + ' ' + _('forward_removed')\n end\n\n @device.forward_to = @fwd_to\n @device.save\n\n a=configure_extensions(@device.id, {:current_user => current_user})\n return false unless a\n else\n flash[:notice] = _('device') +' ' + @device.name.to_s + ' ' + _('not_forwarded_close_circle')\n end\n\n redirect_to :action => :device_forward, :id => @device\n end", "title": "" }, { "docid": "ea7e0464ad0dbe065777b4c305b60aab", "score": "0.4821599", "text": "def toggle_call_status\n end", "title": "" }, { "docid": "e3760ef793e2d60cdfc7888dd3fdbf39", "score": "0.48191804", "text": "def upgrade\n if request.post?\n @user = User.find(session[:user_id])\n @user.telephone = params[:telephone]\n @user.update\n @req = UpgradeRequest.new\n @req.user_id = session[:user_id]\n if @req.save\n flash[:notice] = Resource.get(\"upgrade_req_recieved\") \n else\n return\n end\n redirect_to :action => 'index'\n end\n end", "title": "" }, { "docid": "ad628f1fbccc9ec84489acc4f44a2ff1", "score": "0.4818688", "text": "def patch_update\n user = @company.public_send(ScimRails.config.scim_users_scope).find(params[:id])\n update_status(user)\n json_scim_response(object: user)\n end", "title": "" }, { "docid": "f59348bc45e22ec5881176dcafd36546", "score": "0.48168874", "text": "def change_user_to_host\n self.host.update(host: true)\n end", "title": "" } ]
a399cef14700f68ee23cfc42c797662b
Render a JS window.location redirect (and metarefresh fallback)
[ { "docid": "7eba19b0945d1f83f6dab78fea1136c2", "score": "0.0", "text": "def render_js_redirect_to_receipt sim_response, transaction_saved, error_msg = nil\n url = payments_receipt_url(\n :transaction_saved => transaction_saved,\n :error_msg => error_msg,\n :only_path => false)\n render body: sim_response.direct_post_reply(url, :include => true)\n end", "title": "" } ]
[ { "docid": "b3b1d7087b85c03f30baf53fb8baa433", "score": "0.7641516", "text": "def script_redirect(location) \"<script> document.location=\\\"#{location}\\\"</script>\" end", "title": "" }, { "docid": "2adaa11dfeceea2372904104c68df1e1", "score": "0.7452937", "text": "def js_redirect(opts = {})\n js = if defined? opts[:to]\n \"window.location.href = '#{opts[:to]}';\"\n elsif defined? opts[:reload]\n \"window.location.reload();\"\n end\n render js: js\n end", "title": "" }, { "docid": "b722514583a980fcfb67a973a234c871", "score": "0.74018395", "text": "def render_js_redirect(url)\n render text: \"<script>parent.location = '#{url}';</script>\"\n end", "title": "" }, { "docid": "15851048ad9884eee4874c86cb446836", "score": "0.7256002", "text": "def javascript_redirect_to(url)\n render :js => \"window.document.location = '#{url}';\"\n end", "title": "" }, { "docid": "cec41e8122102369a0b24a5d81d129f2", "score": "0.7131439", "text": "def rest_graph_authorize_redirect\n if !rest_graph_in_canvas?\n redirect_to @rest_graph_authorize_url\n\n else\n render :inline => <<-HTML\n <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n <html>\n <head>\n <script type=\"text/javascript\">\n window.top.location.href = '<%= @rest_graph_authorize_url %>'\n </script>\n <noscript>\n <meta http-equiv=\"refresh\" content=\"0;url=<%= h @rest_graph_authorize_url %>\" />\n <meta http-equiv=\"window-target\" content=\"_top\" />\n </noscript>\n </head>\n <body>\n <div>Please <a href=\"<%= h @rest_graph_authorize_url %>\" target=\"_top\">authorize</a> if this page is not automatically redirected.</div>\n </body>\n </html>\n HTML\n end\n end", "title": "" }, { "docid": "caea2005c1d314c31f05a650263d6527", "score": "0.70134395", "text": "def redirect_using_js_if_needed(url)\n url = url_for(url)\n\n if !request.xhr?\n redirect_to url\n else\n render(:update) { |page| page << \"parent.document.location = '#{ url }'\" }\n end\n end", "title": "" }, { "docid": "d85f7aabc43c9a95b9ae4094cbccf0fa", "score": "0.7010134", "text": "def javascript_redirect_to(options={}, *parameters_for_method_reference)\n url = url_for(options, *parameters_for_method_reference)\n render :text => %Q{<script type=\"javascript\">window.location=\"#{url}\"</script>}\n end", "title": "" }, { "docid": "307dedcd3463c39738a59db1a177c3cc", "score": "0.6998516", "text": "def js_redirect(path) # :doc:\n if (path == :back) \n js = \"window.history.back()\"\n else\n path = url_for(path) unless path.kind_of? String\n js = \"kss.redirect('#{escape_javascript path}');\"\n end\n # We specifically set content_type because we\n # often use #js_redirect inside of a MIME block\n # that expects HTML.\n response.content_type = \"text/javascript\"\n # Since we are using the same code to handle\n # Ajax and non-Ajax, sometimes the \"Location\" header\n # gets set somewhere in the middle. If we\n # leave it there, the AJAX call itself gets redirected\n # and the javascript does not reach\n # the server. That's not what we mean by our #js_redirect.\n response.headers.delete(\"Location\")\n\n # The rationale for using status_code 333 is given above in\n # the comments for this method.\n #\n # jQuery automatically redirects whenever the status is\n # 301, 302, 303, 307 and raises an error whenever the final\n # status is not from 200 <= status < 300 or 304.\n # Furthermore, the response body and the headers are trashed so we can't do\n # anything about it. The only workaround is to send a status 200\n # when we want the redirect with Javascript.\n #\n # When we send a status:200, the back button\n # will come back to the redirect page instead of \n # the page before. We can't help this.\n status_code = uses_jquery? ? 200 : 333\n\n render :js => js, :status => status_code\n end", "title": "" }, { "docid": "b0bd5d12a1f5c998a3cf719c9cf153fb", "score": "0.69601893", "text": "def do_redirect_to(url_or_path)\n respond_to do |format|\n format.js {\n @redirect_url = url_or_path\n render :redirect\n }\n format.html { redirect_to url_or_path }\n end\n end", "title": "" }, { "docid": "40acb253304421be5bef381f49f083d1", "score": "0.6900711", "text": "def redirect(location, status = '302'); request.redirect(location, status); end", "title": "" }, { "docid": "40acb253304421be5bef381f49f083d1", "score": "0.6900711", "text": "def redirect(location, status = '302'); request.redirect(location, status); end", "title": "" }, { "docid": "50150e962ff972bb4a4ef0a3b1098d17", "score": "0.6781393", "text": "def redirect(url, args = {})\n #Header way\n if !_httpsession.alert_sent and !self.headers_sent?\n if args[:perm]\n _httpsession.resp.status = 301 if !self.headers_sent?\n else\n _httpsession.resp.status = 303 if !self.headers_sent?\n end\n \n self.header(\"Location\", url) if !self.headers_sent?\n end\n \n print \"<script type=\\\"text/javascript\\\">location.href=\\\"#{url}\\\";</script>\"\n exit\n end", "title": "" }, { "docid": "aca79e651f6d1c3f133b381253a47f65", "score": "0.6757146", "text": "def js_redirect_to(path, flash_type = nil, flash_message = nil)\n flash[flash_type] = flash_message if flash_type\n\n render js: %(window.location.href='#{path}') && return\n end", "title": "" }, { "docid": "aca79e651f6d1c3f133b381253a47f65", "score": "0.6757146", "text": "def js_redirect_to(path, flash_type = nil, flash_message = nil)\n flash[flash_type] = flash_message if flash_type\n\n render js: %(window.location.href='#{path}') && return\n end", "title": "" }, { "docid": "11df806a3a2c3b0832e17a077793e2e6", "score": "0.673238", "text": "def redirect_to_referer(req, res)\n # STDERR.puts \"referrer = #{req['Referer'].inspect}\"\n referer = req['Referer']\n res['Content-Type'] = 'text/html'\n res.body = <<-\"EOF\"\n<html>\n <head>\n <meta http-equiv=\"refresh\" content=\"1;url=#{referer}\" />\n </head>\n <body>\n <script type=\"text/javascript\">\n//<!--\n history.go(-1)\n//-->\n </script>\n <a href=\"#{referer}\">#{h referer}</a>\n </body>\n</html\n EOF\n end", "title": "" }, { "docid": "33ee0add2085676565f9320c548aea21", "score": "0.6684094", "text": "def redirect_to(location)\n url = location.is_a?(String) ? location : @context.url_for(location)\n record \"window.location.href = #{url.inspect}\"\n end", "title": "" }, { "docid": "33ee0add2085676565f9320c548aea21", "score": "0.6684094", "text": "def redirect_to(location)\n url = location.is_a?(String) ? location : @context.url_for(location)\n record \"window.location.href = #{url.inspect}\"\n end", "title": "" }, { "docid": "b001fc34a81b0aec5a2fac0bbdd988e8", "score": "0.6681099", "text": "def redirect_to(location)\n url = location.is_a?(String) ? location : @context.url_for(location)\n record \"window.location.href = #{url.inspect}\"\n end", "title": "" }, { "docid": "6296d6664aaa3b6eb9db8bfbdc93d16d", "score": "0.66759", "text": "def redirect_to(url)\n raise 'DOH' if already_rendered?\n\n @res.header['location'] = url\n @res.status = 302\n\n @already_built_response = true\n nil\n end", "title": "" }, { "docid": "b1ddb8c414db9047e77ec57af1dc03bb", "score": "0.66246855", "text": "def redirect_to(url)\n prepare_render_or_redirect\n\n @res.status = 302\n @res[\"Location\"] = url\n\n nil\n end", "title": "" }, { "docid": "22cadce3f96ce54cd0bb6b2d947d4aa2", "score": "0.6617869", "text": "def top_redirect_to(url)\n render :layout => false, :inline => '<html><head><script type=\"text/javascript\">window.top.location.href = '+\n url.to_json+\n ';</script></head></html>'\n end", "title": "" }, { "docid": "9a1d79d4252136f56914ef895d48a1b8", "score": "0.65826875", "text": "def redirect_url\n refresh = html.css('meta[http-equiv]').detect { |node| /refresh/i === node['http-equiv'] }\n if refresh\n match_data = refresh['content'].match(/.*URL=['\"]?(?<path>[^'\"]*)/i)\n return nil if match_data.nil?\n\n new_path = match_data[:path]\n URI.join(url, Addressable::URI.encode(new_path)).to_s\n end\n end", "title": "" }, { "docid": "7e11b8f89d56208c563d17fc48449581", "score": "0.65591055", "text": "def redirect_to para\n return'<script type=\"text/javascript\">window.document.location.href=\"redirector/goto/'+para+'\";</script>'\n end", "title": "" }, { "docid": "e95ec2e7df190154b67907cf30c375d8", "score": "0.6540388", "text": "def redirect_to_hashed_url_equivalent\n r302(::Ajax.hashed_url_from_traditional(@env['REQUEST_URI']))\n end", "title": "" }, { "docid": "84ebcac419183d014f4e2fb4e47d797c", "score": "0.65097946", "text": "def redirect(url); end", "title": "" }, { "docid": "a77028ac80356252d0a79078abc3d470", "score": "0.6486707", "text": "def website_redirect_location; end", "title": "" }, { "docid": "d7f9cab9fd7bf985bdc478d615c059f8", "score": "0.64853686", "text": "def redirect_to(url)\n raise 'double render error' if already_built_response?\n\n # response status code to 302\n @res.status = 302\n\n # the location is where the response will be\n # sent?\n @res[\"Location\"] = url\n\n @already_built_response = true\n end", "title": "" }, { "docid": "5daccc2db4f9f0c3ad9108781eb0f31c", "score": "0.6474274", "text": "def website_redirect_location(value); end", "title": "" }, { "docid": "bea98783ab91e286ee4b1c1fac07ba68", "score": "0.64631355", "text": "def top_redirect_to(url)\n render :layout => false, :inline => '<html><head><script type=\"text/javascript\">window.top.location.href = '+\n url.to_json+\n ';</script></head></html>'\n end", "title": "" }, { "docid": "bea98783ab91e286ee4b1c1fac07ba68", "score": "0.64631355", "text": "def top_redirect_to(url)\n render :layout => false, :inline => '<html><head><script type=\"text/javascript\">window.top.location.href = '+\n url.to_json+\n ';</script></head></html>'\n end", "title": "" }, { "docid": "dfde935b115a7db8052b07a45cd9c6d9", "score": "0.64586335", "text": "def redirect_to_with_rplatform(options = {}, responseStatus = {})\n # get the url\n redirectUrl = url_for(options)\n\n # canvas redirect\n if in_facebook_canvas?\n \n RAILS_DEFAULT_LOGGER.debug \"** RFACEBOOK INFO: Canvas redirect to #{redirectUrl}\"\n render :text => \"<fb:redirect url=\\\"#{redirectUrl}\\\" />\"\n \n # iframe redirect\n elsif redirectUrl.match(/^https?:\\/\\/([^\\/]*\\.)?#{get_network}\\.com(:\\d+)?/i)\n RAILS_DEFAULT_LOGGER.debug \"** RFACEBOOK INFO: iframe redirect to #{redirectUrl}\"\n render :text => %Q(<script type=\"text/javascript\">\\ntop.location.href='#{redirectUrl}';\\n</script>)\n \n # otherwise, we only need to do a standard redirect\n else\n RAILS_DEFAULT_LOGGER.debug \"** RFACEBOOK INFO: Regular redirect_to\"\n redirect_to_without_rplatform(options)\n end\n end", "title": "" }, { "docid": "75b035f046a9a014198d9769f05c465e", "score": "0.64543957", "text": "def refresh_or_redirect_to(url, **options)\n turbo_native_action_or_redirect url, :refresh, :to, options\n end", "title": "" }, { "docid": "b8eea9197aba47ec4908bf332dc4d7a1", "score": "0.64521974", "text": "def redirect_to(url)\n raise 'double render' if already_built_response?\n res.status = 302\n res['Location'] = url\n clean_up\n end", "title": "" }, { "docid": "f236327e3b7b135075751fe28e148e30", "score": "0.6450171", "text": "def redirect_url(realm, return_to = T.unsafe(nil), immediate = T.unsafe(nil)); end", "title": "" }, { "docid": "3bd979912ccc5f50b2a702991aec164d", "score": "0.6434301", "text": "def redirect_to(url)\n raise \"Already rendered\" if already_built_response?\n res['Content-Type'] = 'text/html'\n res.status = 302\n res.location = url\n @already_built_response = true\n end", "title": "" }, { "docid": "36d35e7303a0ea31edc2bd8f7b830dd2", "score": "0.64331853", "text": "def redirect_to(url)\n raise \"Already rendered\" if already_rendered?\n @res.status = 302\n @res.header['location'] = url\n session.store_session(@res)\n\n @already_built_response = true\n nil\n end", "title": "" }, { "docid": "7c89946567c6a4fa091b61bf0ebeb89c", "score": "0.64287794", "text": "def redirect_to(url)\n handle_already_rendered\n res[\"Location\"] = url\n res.status = 302\n session.store_session(@res)\n end", "title": "" }, { "docid": "a36ff8e4348157f2290cb167d32e642a", "score": "0.6421782", "text": "def redirect_to(url)\n ensure_no_double_render\n session.store_session(res)\n\n @res.status = 302\n @res.header[\"location\"] = url\n @already_built_response = true\n end", "title": "" }, { "docid": "b3da3714f11828430e6459d8f54fca6a", "score": "0.6421432", "text": "def redirect_url\n redirect? ? headers['location'] : nil\n end", "title": "" }, { "docid": "ae089ae4c7aa6cc410f95bb868ccd4b2", "score": "0.64165914", "text": "def redirect_to(url)\n unless already_rendered?\n @res.status = 302\n @res.header[\"location\"] = url\n\n session.store_session(@res)\n @already_rendered = true\n return nil\n end\n raise \"Double Render Error\"\n end", "title": "" }, { "docid": "87a9d0528dcb1fb93ac378adb8555c16", "score": "0.639605", "text": "def redirect_to(*args)\n return super unless request.xhr?\n\n # Note: this code modifies the options hash **in place**. This is intended: \n # if this method is called with \n #\n # redirect_to :controller => \"x\", :action => \"y\", :notice => \"z\"\n #\n # then we want to extract the :notice key and call url_for with just the \n # :controller and :action keys.\n \n # Extract flash\n options = args.last.is_a?(Hash) ? args.last : {}\n if flash = options.delete(:flash)\n self.flash.each do |key, value|\n self.flash[key] = value\n end\n elsif notice = options.delete(:notice)\n self.flash[:notice] = notice\n end\n \n # determine redirection URL.\n js = \"window.location = #{url_for(args.first).to_json};\\n\"\n \n respond_to do |format|\n format.html { render :text => M.javascript_tag(js); }\n format.js { render :text => js }\n format.any { super }\n end\n end", "title": "" }, { "docid": "bf7e846dd14e2dbd1c9ab5e4b662cc90", "score": "0.63804674", "text": "def redirect_to_shib_login\n if request.xml_http_request?\n render js: \"window.location.replace('#{shib_login_and_redirect_url(root_path)}');\" and return false\n else\n redirect_to shib_login_and_redirect_url and return false\n end\n end", "title": "" }, { "docid": "96f000e03b48160fa1c2009ffc43f499", "score": "0.63746905", "text": "def redirect_to location, status: :see_other\n head status, location: location\n end", "title": "" }, { "docid": "96f000e03b48160fa1c2009ffc43f499", "score": "0.63746905", "text": "def redirect_to location, status: :see_other\n head status, location: location\n end", "title": "" }, { "docid": "bf9a15bd372664c0467c0799a48f5f69", "score": "0.63659835", "text": "def contents\n contents =<<END\n<html>\n <head>\n <noscript><meta http-equiv=\"refresh\" content=\"0; url=/#{@redirect_to}\" /></noscript>\n <link rel=\"canonical\" href=\"/#{@redirect_to}\" /> \n </head>\n <body>\n <span style=\"display:none;\">Redirecting from #{@name} to #{@redirect_to}</span>\n <!-- Redirect in JavaScript with meta refresh fallback above in noscript -->\n <script>\n var destination = '/#{@redirect_to}';\n window.location.href = destination + (window.location.search || '') + (window.location.hash || '');\n </script>\n </body>\n</html> \nEND\n return contents\n end", "title": "" }, { "docid": "9ca46430214a74305353ac8efa923399", "score": "0.63545966", "text": "def contents\n contents =<<END\n\n<html>\n <head>\n <noscript><meta http-equiv=\"refresh\" content=\"0;\" url=\"#{@redirect_to}\" /></noscript>\n <link rel=\"canonical\" href=\"#{@redirect_to}\" />\n </head>\n <body>\n <span style=\"display:none;\">Redirecting from #{@name} to #{@redirect_to}</span>\n <!-- Redirect in JavaScript with meta refresh fallback above in noscript -->\n <script>\n var destination = '#{@redirect_to}';\n window.location.href = destination + (window.location.search || '') + (window.location.hash || '');\n\n</script>\n </body>\n</html> \nEND\n return contents\n end", "title": "" }, { "docid": "89d69943a4b91854c2649845d8278245", "score": "0.6352805", "text": "def redirect_to(url)\n raise \"double render error\" if already_built_response?\n\n #redirect_status = WEBrick::HTTPStatus::TemporaryRedirect #307, not sure how to get a 302 redirect object\n #@res.set_redirect(redirect_status, url)\n @res.header['location'] = url\n @res.status = 302\n session.store_session(res)\n\n @already_built_response = true\n nil\n end", "title": "" }, { "docid": "d4f28cf12458591ca5c7bc6ee54b8ff8", "score": "0.6350776", "text": "def redirect_to(url)\n raise 'double render' if already_built_response?\n @res['location']=(url)\n @res.status = 302\n @already_built_response = true\n session.store_session(@res)\n end", "title": "" }, { "docid": "26f14940e36a74e57be78d1974069a6a", "score": "0.63403", "text": "def redirect_to(url)\n @res['Location'] = url\n @res.status = 302\n if already_built_response?\n raise \"Double Render Error\"\n end \n @already_built_response = true\n session.store_session(@res)\n end", "title": "" }, { "docid": "e5a85e9cc769a5e74b5a3a5087fdbfb2", "score": "0.6337333", "text": "def redirect_to(url)\n raise \"Double render detected.\" if already_built_response?\n res['Location'] = url\n res.status = 302\n session.store_session(res)\n flash.store_flash(res)\n @already_built_response = true\n end", "title": "" }, { "docid": "99aef58bdd49ce19d4e50ef749f6c422", "score": "0.6320395", "text": "def redirect_legacy\n render layout: nil\n end", "title": "" }, { "docid": "5265480da87bc906dd34585175bcd3d8", "score": "0.6319688", "text": "def open_page url\n puts <<PLAYER\n<html>\n<head>\n <script>\n function redirect() {\n document.location.href = \"#{url}\";\n }\n </script>\n</head>\n<body onload=\"redirect()\"></body>\n</html>\nPLAYER\nend", "title": "" }, { "docid": "d5561dafd6815ffd29fe4f8e99453e64", "score": "0.6312195", "text": "def signon_redirect(return_path = nil)\n return_path = request&.path || root_url if return_path.blank?\n full_path, anchor = return_path.split('#')\n full_path << (full_path.include?('?') ? '&' : '?')\n full_path << 'refresh=true' # TODO: Implement to avoid using the cached version of the destination page.\n full_path << ('#' + anchor) if anchor.present?\n full_path = CGI.escape(full_path)\n \"#{SIGN_ON_PATH}?redirect=#{full_path}\"\n end", "title": "" }, { "docid": "92f9f329ab2fcfe296d5720d1220ad51", "score": "0.63094", "text": "def redirect_to(url)\n before_render\n # there is a Rack method - #redirect - but they explicitly told us not to use it\n # so this code sets the status for the redirect and the new location\n # then sets @already_built_response so that the controller can't render/redirect twice\n @res.status = 302\n @res.location = url\n end", "title": "" }, { "docid": "1207a0124b7d0d4af5bd8e4bf4ed33e9", "score": "0.6278773", "text": "def redirect_to(url)\n raise \"double render error\" if already_built_response?\n # self.already_built_response?\n\n # Issuing a redirect consists of two parts,\n @res.status = 302\n # and setting the response status code to 302\n @res[\"Location\"] = url\n # setting the 'Location' field of the response header to the redirect url\n\n @already_built_response = true\n end", "title": "" }, { "docid": "b8141dbf7839dbb5a6528ce5e84181ff", "score": "0.6266714", "text": "def redirect_to(url)\n raise \"Double render error\" if already_built_response?\n\n @res['location'] = url\n @res.status = 302\n @already_built_response = true\n\n session.store_session(@res)\n flash.store_flash(@res)\n nil\n end", "title": "" }, { "docid": "19a47ca31bf4a47540a3d62b46eb3557", "score": "0.625604", "text": "def redirect!(url, params = T.unsafe(nil), opts = T.unsafe(nil)); end", "title": "" }, { "docid": "4bae6a3194c1113b977a0c93640f6143", "score": "0.6254057", "text": "def redirect_to(url)\n raise \"Double Render\" if self.already_built_response?\n \n session\n @res.status = 302\n @res[\"location\"] = url\n @already_built_response = true\n session.store_session(@res)\n end", "title": "" }, { "docid": "84dc038e7d3ce8125828e5b2c85b7cea", "score": "0.6251309", "text": "def json_redirect(url)\n render json: { status: 'redirect', url: url }\n end", "title": "" }, { "docid": "f5bc9f18e8063ff143ff158d7eb7df32", "score": "0.62484", "text": "def correct_login(url)\n respond_to do |accepts|\n accepts.html { redirect_to url }\n accepts.js { redirect_to url }\n end\n end", "title": "" }, { "docid": "bc6263613c9010d3b2ec91cf1a49429d", "score": "0.62414473", "text": "def gocardless_redirect\n start_redirect_flow(gocardless_success_url)\n end", "title": "" }, { "docid": "c944b5e5a598fa54ccc2786fc0bb4a5c", "score": "0.62286043", "text": "def generate_redirect_ie(m3u_location)\r\n\t\tie_redir = <<-HTML_REDIR\r\n\t\t\t<!DOCTYPE HTML>\r\n\t\t\t<html>\r\n\t\t\t<head>\r\n\t\t\t<meta http-equiv=\"refresh\" content=\"0; URL=#{m3u_location}\">\r\n\t\t\t</head>\r\n\t\t\t</html>\r\n\t\tHTML_REDIR\r\n\r\n\t\tie_redir = ie_redir.gsub(/^\\t\\t\\t/, '')\r\n\r\n\t\treturn ie_redir\r\n\tend", "title": "" }, { "docid": "03b790cc1ed48dec7f7174596897ab96", "score": "0.62211937", "text": "def redirect_to(url)\n raise \"double render error\" if already_built_response?\n\n @res['Location'] = url\n @res.status = 302\n\n session.store_session(@res)\n flash.store_flash(@res)\n\n @already_built_response = true\n end", "title": "" }, { "docid": "b1fe44363db1331a344e92a4b01732a6", "score": "0.6211805", "text": "def redirect; end", "title": "" }, { "docid": "f3142aae3ddc18a244e0830ae4b06d30", "score": "0.62101626", "text": "def generate_redirect_ie(m3u_location)\r\n\r\n ie_redir = <<-HTML_REDIR\r\n <!DOCTYPE HTML>\r\n <html>\r\n <head>\r\n <meta http-equiv=\"refresh\" content=\"0; URL=#{m3u_location}\">\r\n </head>\r\n </html>\r\n HTML_REDIR\r\n\r\n return ie_redir\r\n\r\n end", "title": "" }, { "docid": "038f810bcc63e73bd2147341eb277419", "score": "0.6199096", "text": "def redirect_body\n \"<a href=\\\"#{@headers['location']}\\\">redirect</a>\"\n end", "title": "" }, { "docid": "a53bc88ba09ecb9b7616c6c70177ad77", "score": "0.61957765", "text": "def redirect_back_or_default(default=nil)\n uri = nil\n if default\n uri = default\n elsif session[:return_to_params]\n uri = session[:return_to_params]\n else\n uri = \"/\"\n end\n if uri.kind_of? Hash\n uri[:only_path] = true\n uri = url_for uri\n end \n\n if request.xhr?\n render :js => \"window.location = '#{uri}'\"\n else\n redirect_to uri\n end \n end", "title": "" }, { "docid": "2781acc2ea2fd7d1d82c28d4eedae0c5", "score": "0.6168624", "text": "def redirect_to(url)\n raise \"Double rendering/redirecting\" if already_built_response?\n\n res.header[\"location\"] = url\n res.status = 302\n @already_built_response = true\n\n # store_token_in_cookies\n session.store_session(res)\n # debugger\n flash.store_flash(res)\n end", "title": "" }, { "docid": "2ada01eeaf995f3976bb2d54e6c08fc3", "score": "0.6160665", "text": "def ajax_login_redirect(url)\n render text: url\n end", "title": "" }, { "docid": "47be8f926e77f2d5204faab9c57b2dff", "score": "0.61573446", "text": "def redirect_to_referer_or_default( default )\n if request.xhr?\n render :js => \"window.location = '#{j(session[:refer_to] || default)}'\"\n else\n redirect_to( session[:refer_to] || default )\n end\n session[:refer_to] = nil\n end", "title": "" }, { "docid": "da1cb4fb589f2b5c7fa989a97a563bdc", "score": "0.61542875", "text": "def redirect_to(url)\n if already_built_response?\n raise \"can't render twice fool!\"\n else\n res.location = url\n res.status = 302\n @already_built_response = true\n end\n end", "title": "" }, { "docid": "8a1f286bd3fa72561631dac71fb60731", "score": "0.6153228", "text": "def redirect(options = {})\r\n end", "title": "" }, { "docid": "241ba515a5f7fdf87e25b6d11bb3f98a", "score": "0.6143562", "text": "def redirect_to(url)\n if already_built_response? \n fail \"Cannot redirect or render more than once\"\n end \n self.res['location'] = url\n self.res.status = 302\n\n @already_built_response = true\n \n session.store_session(res)\n flash.store_flash(res)\n end", "title": "" }, { "docid": "0605024bfea74297e144c0061b2f99aa", "score": "0.61414164", "text": "def redirect_to_hashed_url_from_fragment\n r302(::Ajax.hashed_url_from_fragment(@env['REQUEST_URI']))\n end", "title": "" }, { "docid": "17b50a9e333f835594a2621d9ced439d", "score": "0.6138937", "text": "def redirect_to_full_url_with_ajax(url, status)\n return redirect_to_full_url_without_ajax(url, status) unless Ajax.is_enabled?\n raise DoubleRenderError if performed?\n \n if url == request.headers[\"Referer\"] && !request.headers['Ajax-Info'].blank?\n url = request.headers['Ajax-Info']['referer']\n Ajax.logger.debug(\"[ajax] using referer #{url} from Ajax-Info\")\n end\n\n if !Ajax.exclude_path?(url) && !Ajax.is_hashed_url?(url)\n url = Ajax.hashed_url_from_traditional(url)\n Ajax.logger.info(\"[ajax] rewrote redirect to #{url}\")\n end\n\n session[:redirected_to] = url\n if request.xhr?\n render(:update) { |page| page.redirect_to(url) }\n else\n redirect_to_full_url_without_ajax(url, status)\n end\n end", "title": "" }, { "docid": "93e133686f574e0d2f3af4b7930c0e5a", "score": "0.6125498", "text": "def redirect_to(url)\n raise \"already rendered\" if already_built_response?\n res.status = 302\n res[\"Location\"] = url\n @already_built_response = true\n session.store_session(@res)\n end", "title": "" }, { "docid": "12223b32125ac98fc650427067baec36", "score": "0.61251444", "text": "def redirect_to(url)\n raise RuntimeError if already_built_response?\n\n res['location'] = url.to_s\n res.status = 302\n session.store_session(res)\n\n response_built!\n end", "title": "" }, { "docid": "a6521c31848bf9479a961d5f2ccc3bbd", "score": "0.61225796", "text": "def redirect_to(url)\n prepare_response\n @res.status = 302\n @res.header['location'] = url\n end", "title": "" }, { "docid": "42a4a0be58010b42e9af02f0531e4b97", "score": "0.61143166", "text": "def redirect_to(location)\n self.get(:document)[:location].href = (location.is_a?(String) ? location : @util.template.url_for(location))\n self\n end", "title": "" }, { "docid": "ee569dc0c2c2736bf808cd9d77c97df9", "score": "0.61023456", "text": "def redirect_to(url)\n raise 'Page Already Rendered?' if already_built_response?\n\n @res.header['location'] = url\n @res.status = 302\n @already_built_response = true\n session.store_session(@res)\n flash.store_flash(@res)\n end", "title": "" }, { "docid": "c808ceb37f4725d6c49e92627211e3f5", "score": "0.6100619", "text": "def redirect_to(url)\n raise \"Double rendering/redirecting\" if already_built_response?\n\n res.header[\"location\"] = url\n res.status = 302\n @already_built_response = true\n\n store_token_in_cookies\n session.store_session(res)\n # debugger\n flash.store_flash(res)\n end", "title": "" }, { "docid": "0a76b6b3909b9346ec75726462744349", "score": "0.6097946", "text": "def redirect_to url\n {url: url, status: 302}\n end", "title": "" }, { "docid": "a2866aa18fd6e7b673fa22c0bf70684d", "score": "0.60951203", "text": "def redirect_to(url)\n if already_built_response?\n raise 'Double render error'\n else\n res.status = 302\n res.header['location'] = url\n session.store_session(res)\n flash.store_flash(res)\n @already_built_response = true\n end\n end", "title": "" }, { "docid": "debf722674bfa8148f61aeec637c2342", "score": "0.6094415", "text": "def redirect_to(url)\n raise 'cannot render or redirect more that once' if already_built_response?\n @already_built_response = true\n\n session.store_session(res)\n flash.store_flash(res)\n\n res['Location'] = url\n res.status = 302\n end", "title": "" }, { "docid": "5d690e0fd8838d7b602fb08ffa2f54ee", "score": "0.60771435", "text": "def redirect_url\n if response['location'].nil?\n response.body.match(/<a href=\\\"([^>]+)\\\">/i)[1]\n else\n response['location']\n end\n end", "title": "" }, { "docid": "a0ce02d9c8041b03ebc2e51cfb624164", "score": "0.6072345", "text": "def redirect_to(*args)\n result = redirect_to_original(*args)\n if request.xhr?\n return redirect_clientside_when_outside_checkout(result)\n else\n return result\n end\n end", "title": "" }, { "docid": "61d1ae17fadb4bd2c6510d33ead6c7be", "score": "0.6064868", "text": "def redirect_to(url)\n prepare_built_response\n\n res.status = 302\n res['Location'] = url\n store_cookies\n end", "title": "" }, { "docid": "12891fdcd479b9af8a7f4578e6798307", "score": "0.6051329", "text": "def redirect_to(url)\n raise 'cannot render twice' if already_built_response?\n @res['Location'] = url\n @res.status = 302\n @session.store_session(@res)\n\n @already_built_response = true\n\n # ssuing a redirect consists of two parts,\n # setting the 'Location' field of the response header to the redirect\n # url and setting the response status code to 302.\n # Do not use #redirect; set each piece of the response individually.\n # Check the Rack::Response docs for how to set response header fields and statuses. Again,\n # set @already_built_response to avoid a double render.\n end", "title": "" }, { "docid": "51ec3f422d1d95520330248e33427314", "score": "0.60374016", "text": "def redirect_to(location, status=302, flash: nil)\n #; [!xkrfk] sets flash message if provided.\n set_flash_message(flash) if flash\n #; [!ev9nu] sets response status code as 302.\n @resp.status = status\n #; [!spfge] sets Location response header.\n @resp.headers['Location'] = location\n #; [!k3gvm] returns html anchor tag.\n href = Util.h(location)\n return \"<a href=\\\"#{href}\\\">#{href}</a>\"\n end", "title": "" }, { "docid": "6d00c1c716256a0634f2e09ebd9bb514", "score": "0.6036764", "text": "def redirect_to(url)\n if !already_built_response?\n @res.status = 302\n @res.header['location'] = url\n session.store_session(@res)\n already_built_response = true\n else\n raise\n end\n end", "title": "" }, { "docid": "802fa77e305dfc737c6670542f6abebd", "score": "0.6026074", "text": "def redirect_to(url)\n raise \"double render error\" if already_built_response?\n @res.status = 302\n @res.location = url\n @already_built_response = true\n\n session.store_session(@res)\n end", "title": "" }, { "docid": "76feb1ec89763d602e4865d8121d318f", "score": "0.6023835", "text": "def follow_redirect!; end", "title": "" }, { "docid": "76feb1ec89763d602e4865d8121d318f", "score": "0.6023835", "text": "def follow_redirect!; end", "title": "" }, { "docid": "76feb1ec89763d602e4865d8121d318f", "score": "0.6023835", "text": "def follow_redirect!; end", "title": "" }, { "docid": "312dc36a139f69ec607db04a85659d3b", "score": "0.6016838", "text": "def redirect_to(url)\n raise error if already_built_response?\n #@res.set_header('location', 'http://www.google.com')\n @res['location'] = 'http://www.google.com'\n @res.status = 302\n @already_built_response = true\n self.session.store_session(@res)\n end", "title": "" }, { "docid": "c57cf26f46ce87ad6089bafc2d325f19", "score": "0.6015812", "text": "def redirect_to(url) \n # Set the location field\n res.location = url # https://www.rubydoc.info/gems/rack/Rack/Response/Helpers#location-instance_method\n # Status Code 302 ... \n res.status = 302 # sets status\n end", "title": "" }, { "docid": "9568ff0edf9c17874226868298a81716", "score": "0.6014398", "text": "def redirect_from_last\n url = \"/activities/list\" # default\n\n if session[:history] && session[:history].any?\n url = session[:history].first\n elsif !current_user.seen_welcome?\n url = \"/activities/welcome\"\n end\n\n url = url.gsub(\"format=js\", \"\")\n redirect_using_js_if_needed(url)\n end", "title": "" }, { "docid": "ab982e0caaeebaf2c261f4703f02c94d", "score": "0.6006478", "text": "def redirect_to(url)\n return if @already_built_response \n # @res.set_redirect(WEBrick::HTTPStatus::TemporaryRedirect, url) \n # @res.header = \"Location: #{url}\"\n @res[\"location\"] = url\n @res.status = 302\n session.store_session(@res)\n @already_built_response = true \n end", "title": "" }, { "docid": "6dcf4838242bb652e774fd886f50f190", "score": "0.60014665", "text": "def redirect(_options = {})\n nil\n end", "title": "" }, { "docid": "1fd052304e246f9628218d8cb404a427", "score": "0.59924626", "text": "def redirect_to(url, options = {})\n options = {:status => 302}.merge(options)\n raise Rack::ForwardRequest.new(url) if options[:server_side]\n response.status = options[:status]\n response['Location'] = url\n render(:text, redirect_html(request.path_info, url, options[:status]))\n end", "title": "" }, { "docid": "9326f3e80ffe71cfb17eefa64d749900", "score": "0.5987734", "text": "def redirect?; url != redirect && !redirect.empty? end", "title": "" } ]
c805bd739ac40c991048bbda371730fd
Expects your Amazon keys to be in the environment, something like export AWS_KEY="KEY" export AWS_SECRET="SECRET" Usage: ruby sample/s3.rb [bucket name] [file to use] This script will upload the file, show that the file is up, then remove the file
[ { "docid": "653a9c0382f1e7512a8f8d6b2edaea4b", "score": "0.67177886", "text": "def bad_usage\n puts \"\"\n puts \"Usage:\"\n puts \" ruby sample/s3.rb [bucket name] [file to use]\"\n exit 1\nend", "title": "" } ]
[ { "docid": "64d3231fb87252dcac6115ade46f27fa", "score": "0.6982586", "text": "def run_me\n file_name = 'my-file-1.txt'\n bucket_name = 'doc-example-bucket'\n folder_name = 'my-folder/'\n region = 'us-west-2'\n s3_client = Aws::S3::Client.new(region: region)\n\n puts 'Checking whether the specified file exists and is indeed a file...'\n if file_exists_and_file?(file_name)\n puts \"The file '#{file_name}' exists and is a file.\"\n else\n puts \"The file '#{file_name}' does not exist or is not a file and will \" \\\n 'not be uploaded. Stopping program.'\n exit 1\n end\n\n puts \"\\nChecking whether the specified bucket exists...\"\n if bucket_exists?(s3_client, bucket_name)\n puts \"The bucket '#{bucket_name}' exists.\"\n else\n puts \"The bucket '#{bucket_name}' does not exist. Stopping program.\"\n exit 1\n end\n\n puts \"\\nChecking whether the specified folder exists...\"\n if folder_exists?(s3_client, bucket_name, folder_name)\n puts \"The folder '#{folder_name}' exists.\"\n else\n puts \"The folder '#{folder_name}' does not exist in the bucket \" \\\n \"'#{bucket_name}' or access to the bucket is denied. Stopping program.\"\n exit 1\n end\n\n puts \"\\nUploading file...\"\n if upload_file_to_folder?(s3_client, bucket_name, folder_name, file_name)\n puts \"The file '#{file_name}' was uploaded.\"\n else\n puts \"The file '#{file_name}' could not be uploaded. Stopping program.\"\n exit 1\n end\nend", "title": "" }, { "docid": "0d96abd044d52785f03d313395a8e3f5", "score": "0.69101036", "text": "def upload_file(bucket)\n File.open(\"demo.txt\", \"w+\") { |f| f.write(\"This is a demo file.\") }\n s3_object = bucket.object(File.basename(\"demo.txt\"))\n s3_object.upload_file(\"demo.txt\")\n puts(\"Uploaded file demo.txt into bucket #{bucket.name} with key #{s3_object.key}.\")\n rescue Aws::Errors::ServiceError => e\n puts(\"Couldn't upload file demo.txt to #{bucket.name}.\")\n puts(\"\\t#{e.code}: #{e.message}\")\n raise\n else\n s3_object\n end", "title": "" }, { "docid": "324bfe55029b520690a72995a502aac6", "score": "0.68910277", "text": "def run_me\n bucket_name = 'doc-example-bucket'\n object_key = 'my-file.txt'\n file_path = \"./#{object_key}\"\n region = 'us-west-2'\n s3_resource = Aws::S3::Resource.new(region: region)\n\n if object_uploaded?(s3_resource, bucket_name, object_key, file_path)\n puts \"Object '#{object_key}' uploaded to bucket '#{bucket_name}'.\"\n else\n puts \"Object '#{object_key}' not uploaded to bucket '#{bucket_name}'.\"\n end\nend", "title": "" }, { "docid": "6676c61090728346bbc000c869b898b7", "score": "0.68368876", "text": "def run_me\n bucket_name = 'doc-example-bucket'\n object_key = 'my-file.txt'\n object_content = 'This is the content of my-file.txt.'\n region = 'us-west-2'\n s3_resource = Aws::S3::Resource.new(region: region)\n\n unless object_uploaded_to_presigned_url?(\n s3_resource,\n bucket_name,\n object_key,\n object_content\n )\n puts \"Content '#{object_content}' not uploaded to '#{object_key}' \" \\\n \"in bucket '#{bucket_name}'.\"\n end\nend", "title": "" }, { "docid": "5cb438a1956f15362766e561b34c47ba", "score": "0.6812779", "text": "def run_me\n bucket_name = \"doc-example-bucket\"\n object_key = \"my-file.txt\"\n object_content = \"This is the content of my-file.txt.\"\n region = \"us-west-2\"\n public_key_file = \"my-public-key.pem\"\n public_key = OpenSSL::PKey::RSA.new(File.read(public_key_file))\n\n # When initializing this Amazon S3 encryption client, note:\n # - For key_wrap_schema, use rsa_oaep_sha1 for asymmetric keys.\n # - For security_profile, for reading or decrypting objects encrypted\n # by the v1 encryption client, use :v2_and_legacy instead.\n s3_encryption_client = Aws::S3::EncryptionV2::Client.new(\n encryption_key: public_key,\n key_wrap_schema: :rsa_oaep_sha1,\n content_encryption_schema: :aes_gcm_no_padding,\n security_profile: :v2,\n region: region\n )\n\n if object_uploaded_with_public_key_encryption?(\n s3_encryption_client,\n bucket_name,\n object_key,\n object_content\n )\n puts \"Object uploaded.\"\n else\n puts \"Object not uploaded.\"\n end\nend", "title": "" }, { "docid": "761b6a212359519fa70a130cb9d153ac", "score": "0.6807518", "text": "def run_me\n proposed_file_names = ['my-file-1.txt', 'my-file-2.txt']\n existing_file_names = []\n uploaded_file_names = []\n bucket_name = 'doc-example-bucket'\n region = 'us-west-2'\n s3_client = Aws::S3::Client.new(region: region)\n\n puts 'Checking whether the specified files exist and are indeed files...'\n proposed_file_names.each do |file_name|\n if file_exists_and_file?(file_name)\n puts \"The file '#{file_name}' exists and is a file.\"\n existing_file_names.push(file_name)\n else\n puts \"The file '#{file_name}' does not exist or is not a file and will \" \\\n 'not be uploaded.'\n end\n end\n\n if existing_file_names.count.positive?\n puts \"\\nThe list of existing file names is:\"\n puts existing_file_names\n else\n puts \"\\nNone of the specified files exist. Stopping program.\"\n exit 1\n end\n\n puts \"\\nChecking whether the specified bucket exists...\"\n if bucket_exists?(s3_client, bucket_name)\n puts \"The bucket '#{bucket_name}' exists.\"\n else\n puts \"The bucket '#{bucket_name}' does not exist. Stopping program.\"\n exit 1\n end\n\n puts \"\\nUploading files...\"\n existing_file_names.each do |file_name|\n if upload_file_to_bucket?(s3_client, bucket_name, file_name)\n puts \"The file '#{file_name}' was uploaded.\"\n uploaded_file_names.push(file_name)\n else\n puts \"The file '#{file_name}' could not be uploaded.\"\n end\n end\n\n if uploaded_file_names.count.positive?\n puts \"\\nThe list of uploaded file names is:\"\n puts uploaded_file_names\n else\n puts \"\\nNone of the existing files were uploaded. Stopping program.\"\n exit 1\n end\nend", "title": "" }, { "docid": "57e3ffbfcd4259c8a91fb2404388f5e4", "score": "0.6780637", "text": "def upload_file_to_aws_bucket(options)\n if options['file'].to_s.match(/^http/)\n download_file = \"/tmp/\"+File.basename(options['file'])\n download_http = open(options['file'])\n IO.copy_stream(download_http,download_file)\n options['file'] = download_file\n end\n if not File.exist?(options['file'])\n handle_output(options,\"Warning:\\tFile '#{options['file']}' does not exist\")\n quit(options)\n end\n if not options['bucket'].to_s.match(/[A-Z]|[a-z]|[0-9]/)\n handle_output(options,\"Warning:\\tNo Bucket name given\")\n options['bucket'] = options['bucket']\n handle_output(options,\"Information:\\tSetting Bucket to default bucket '#{options['bucket']}'\")\n end\n exists = check_if_aws_bucket_exists(options['access'],options['secret'],options['region'],options['bucket'])\n if exists == false\n s3 = create_aws_s3_bucket(options['access'],options['secret'],options['region'],options['bucket'])\n end\n if not options['key'].to_s.match(/[A-Z]|[a-z]|[0-9]/)\n options['key'] = options['object']+\"/\"+File.basename(options['file'])\n end\n s3 = initiate_aws_s3_resource(options['access'],options['secret'],options['region'])\n handle_output(options,\"Information:\\tUploading: File '#{options['file']}' with key: '#{options['key']}' to bucket: '#{options['bucket']}'\")\n s3.bucket(options['bucket']).object(options['key']).upload_file(options['file'])\n return\nend", "title": "" }, { "docid": "56870ef731a7193002a8a224003e3cee", "score": "0.6650075", "text": "def s3_deletefile(filename)\r\n #AWS::S3::S3Object.delete filename, QBUCKET.to_s if AWS::S3::S3Object.exists? filename, QBUCKET.to_s\r\n AWS::S3::S3Object.delete filename, IMAGES_BUCKET.to_s if AWS::S3::S3Object.exists? filename, IMAGES_BUCKET.to_s\r\n end", "title": "" }, { "docid": "d7f755aeecf051cf575ab516ea0d8a0e", "score": "0.66335964", "text": "def upload_file_to_bucket?(s3_client, bucket_name, file_name)\n s3_client.put_object(\n body: file_name,\n bucket: bucket_name,\n key: file_name\n )\n return true\nrescue StandardError => e\n puts \"Error while uploading the file '#{file_name}' to the \" \\\n \"bucket '#{bucket_name}': #{e.message}\"\nend", "title": "" }, { "docid": "42102a72bf26beca3058e8a008045d57", "score": "0.66055477", "text": "def run_me\n bucket_name = 'doc-example-bucket'\n region = 'us-west-2'\n\n s3_client = Aws::S3::Client.new(region: region)\n\n puts \"Creating the bucket '#{bucket_name}'...\"\n\n if bucket_created?(s3_client, bucket_name)\n puts 'The bucket was created.'\n else\n puts 'The bucket was not created. Stopping program.'\n exit 1\n end\nend", "title": "" }, { "docid": "e6c037a480f0890f23a40a3664a0f689", "score": "0.6599665", "text": "def run_scenario(scenario)\n puts(\"-\" * 88)\n puts(\"Welcome to the Amazon S3 getting started demo!\")\n puts(\"-\" * 88)\n\n bucket = scenario.create_bucket\n s3_object = scenario.upload_file(bucket)\n scenario.download_file(s3_object)\n scenario.copy_object(s3_object)\n scenario.list_objects(bucket)\n scenario.delete_bucket(bucket)\n\n puts(\"Thanks for watching!\")\n puts(\"-\" * 88)\nrescue Aws::Errors::ServiceError\n puts(\"Something went wrong with the demo!\")\nend", "title": "" }, { "docid": "0ee7228e3dee886653f1d1cac54fef98", "score": "0.6598979", "text": "def run_me\n bucket_name = 'doc-example-bucket'\n region = 'us-east-1'\n\n s3_client = Aws::S3::Client.new(region: region)\n\n puts \"Creating the bucket '#{bucket_name}'...\"\n\n if bucket_created?(s3_client, bucket_name)\n puts 'The bucket was created.'\n else\n puts 'The bucket was not created. Stopping program.'\n exit 1\n end\nend", "title": "" }, { "docid": "542acba5466cfd184777e89c0f5f7477", "score": "0.6592242", "text": "def upload\n extract_and_verify_credentials\n\n run('which aws &>/dev/null')\n unless $?.success?\n error('Ensure `aws` binary is available (`[sudo] pip install awscli`)')\n end\n\n ENV['AWS_REGION'] = @region\n ENV['AWS_ACCESS_KEY_ID'] = @key\n ENV['AWS_SECRET_ACCESS_KEY'] = @secret\n\n run(\"aws s3 cp #{LOCAL_FOLDER} s3://#{@bucket}/#{REMOTE_FOLDER} --recursive --acl public-read --exclude '.*'\")\n\n if $?.success?\n display(\"\\e[92mUpload successful.\\e[0m\")\n else\n error(\"\\e[91m\\e[5mUpload failed.\\e[0m\")\n end\n end", "title": "" }, { "docid": "94788948d58851d68e1faba7ea090ca6", "score": "0.6527803", "text": "def s3_deletefile(filename)\n #AWS::S3::S3Object.delete filename, QBUCKET.to_s if AWS::S3::S3Object.exists? filename, QBUCKET.to_s\n AWS::S3::S3Object.delete filename, IMAGES_BUCKET.to_s if AWS::S3::S3Object.exists? filename, IMAGES_BUCKET.to_s\n end", "title": "" }, { "docid": "20d3ebd648e29e1d80801bf952657684", "score": "0.649571", "text": "def run_me\r\n bucket_name = 'doc-example-bucket'\r\n object_key = 'my-file.txt'\r\n content_to_encrypt = 'This is the content of my-file.txt.'\r\n region = 'us-west-2'\r\n s3_client = Aws::S3::Client.new(region: region)\r\n\r\n # The following call generates a random AES256-GCM key. Alternatively, you can\r\n # provide a base64-encoded string representation of an existing key that\r\n # you want to use to encrypt the object. For example:#\r\n # encryption_key_string = 'XSiKrmzhtDKR9tTwJRSLjgwLhiMA82TC2z3GEXAMPLE='\r\n # encryption_key = encryption_key_string.unpack('m')[0]\r\n encryption_key = get_random_aes_256_gcm_key\r\n\r\n if customer_key_sse_encrypted_object_uploaded?(\r\n s3_client,\r\n bucket_name,\r\n object_key,\r\n content_to_encrypt,\r\n encryption_key\r\n )\r\n puts 'Encrypted object uploaded.'\r\n else\r\n puts 'Encrypted object not uploaded.'\r\n end\r\nend", "title": "" }, { "docid": "bde3c9ecd8212adbeb87d0b9468e2756", "score": "0.64909357", "text": "def upload\n ENV['AWS_REGION'] = 'us-east-2'\n\n s3 = Aws::S3::Resource.new(region: ENV['AWS_REGION'])\n obj = s3.bucket('ruby-upload-script').object($zipfile_name)\n\n obj.upload_file($zipfile_name)\nend", "title": "" }, { "docid": "a3665dc0fc3dc77cb6e4d4d8dfe7bcf7", "score": "0.6483753", "text": "def upload_file\n bucket_name = ENV[\"AMAZON_S3_DEFAULT_BUCKET\"] || \"\"\n access_key = ENV[\"AMAZON_ACCESS_KEY_ID\"] || \"\"\n secret_key = ENV[\"AMAZON_SECRET_ACCESS_KEY\"] || \"\"\n\n if bucket_name.empty?\n print_error(:no_default_bucket)\n exit(-2)\n end\n\n if access_key.empty? || secret_key.empty?\n print_error(:wrong_aws_credentials)\n exit(-3)\n end\n\n AWS::S3::Base.establish_connection!(\n :access_key_id => access_key,\n :secret_access_key => secret_key\n )\n\n create_bucket_if_it_does_not_exist(bucket_name)\n\n # TODO: Find a way to make this faster in the future\n t = Thread.new { start_progress_counter }\n\n AWS::S3::S3Object.store(@filename, open(\"#{@path}/#{@filename}\"),\n bucket_name,\n :access => :public_read)\n t.kill\n\n url = \"http://s3.amazonaws.com/#{bucket_name}/#{URI::escape(@filename)}\"\n puts \"\\n #{@filename} uploaded to: #{url}\\n\\n\"\n url\n end", "title": "" }, { "docid": "cdc91a84f38b30fc52d8767b9c39351f", "score": "0.6477509", "text": "def run_me\n source_bucket_name = 'doc-example-bucket1'\n source_key = 'my-source-file.txt'\n target_bucket_name = 'doc-example-bucket2'\n target_key = 'my-target-file.txt'\n region = 'us-west-2'\n\n s3_client = Aws::S3::Client.new(region: region)\n\n puts \"Copying object '#{source_key}' from bucket '#{source_bucket_name}' \" \\\n \"to bucket '#{target_bucket_name}'...\"\n\n if object_copied?(\n s3_client,\n source_bucket_name,\n source_key,\n target_bucket_name,\n target_key)\n puts 'The object was copied.'\n else\n puts 'The object was not copied. Stopping program.'\n exit 1\n end\nend", "title": "" }, { "docid": "86d4c746c9aff52db9f3eba5d61c7a84", "score": "0.6416235", "text": "def delete(s3_path, filename)\n path_including_filename = s3_path + filename\n #puts \"About to delete a file with the key #{path_including_filename}\"\n connection.delete_object(Brevidy::Application::S3_BUCKET, path_including_filename)\n #puts \"File should no longer exist.\"\n end", "title": "" }, { "docid": "db41e91d53d148d651b46069a2911591", "score": "0.6415569", "text": "def run_me\r\n bucket_name = 'doc-example-bucket'\r\n region = 'us-west-2'\r\n s3_client = Aws::S3::Client.new(region: region)\r\n\r\n if bucket_in_region?(s3_client, bucket_name, region)\r\n puts \"Bucket '#{bucket_name}' exists in Region '#{region}'.\"\r\n else\r\n puts \"Bucket '#{bucket_name}' does not exist, \" \\\r\n \"does not exist in AWS Region '#{region}', \" \\\r\n 'the Region was not specified when the bucket was initially created, ' \\\r\n 'or the bucket is not otherwise accessible to you.'\r\n end\r\nend", "title": "" }, { "docid": "e10979d46f7a224c2de0dc3a946f5163", "score": "0.6377949", "text": "def put_file(file, bucket = 'aam-user-photos', headers)\n unless file\n return 0\n end\n tries = 0\n return 0 if not FileTest.file?(file)\n while true do\n begin\n return 0 if tries > MAX_TRIES\n s3 = RightAws::S3Interface.new(@access_key, @secret_key)\n\n return 1 if s3.put(bucket, File.basename(file), File.open(file), headers)\n tries = tries + 1\n rescue Exception => e\n $logger.warn(e.inspect)\n tries = tries + 1\n end\n end\nend", "title": "" }, { "docid": "555b2935fa30e33e2ace956b06858a78", "score": "0.6360507", "text": "def test_bucket_basics\n\t\tassert(bucket_exists(@test_bucket), \"bucket doesnt exist\")\n\t\ttrace \"bucket exists\"\n\t\tcmd = \"#{s3cmd} put #{__FILE__} s3://#{@test_bucket}\"\n\t\trun(cmd)\n\t\ttrace \"cmd ran\"\n\t\tassert(object_exists(@test_bucket, __FILE__), \"object doesnt exist\")\n\t\ttrace \"object exists\"\n\tend", "title": "" }, { "docid": "bc8eb75e58fc307a74b083cd26b92e45", "score": "0.6328565", "text": "def destroy_file\n S3Object.delete full_filename, bucket_name\n end", "title": "" }, { "docid": "9bfab4fe2eda5f98242b3b3ccd99ceaf", "score": "0.63258016", "text": "def verify_upload\n file_name = params[:file_name]\n #key_name = Digest::MD5.hexdigest(file_name)\n key_name = file_name\n s3 = Aws::S3::Resource.new(region: 'eu-west-2')\n bucket = nil\n ENV['EMAIL_ENV'] == 'dev' ? bucket = 'prophety-image-uploads' : bucket = 'prpimgu'\n exists = !(s3.bucket(bucket).objects(prefix: key_name).map(&:key).empty?)\n render json: { exists: exists }, status: 200\n end", "title": "" }, { "docid": "acf34f864ca20f1ab521a7dfbca2ef28", "score": "0.63042045", "text": "def s3_delete(bucketName, filename)\n puts \"#{__method__} b:#{bucketName} f:#{filename}\"\n s3_bucket(bucketName).object(filename).delete\nend", "title": "" }, { "docid": "640bf7deb80d2d9aea559a006111ef8b", "score": "0.62044734", "text": "def delete_file!(bucket_name:, key:); end", "title": "" }, { "docid": "1f658cd02c32aef6aff9ef3876ad0bff", "score": "0.62026125", "text": "def upFile(flag, name)\n\n Dir[@temp_directory+name].each do |file|\n name_file = File.basename(file)\n\n if (flag == true)\n @logger.warn \"S3: have found temporary file: \"+name_file+\", something has crashed before... Prepare for upload in bucket!\"\n end\n\n if (!File.zero?(file))\n write_on_bucket(file, name_file)\n\n if (flag == true)\n @logger.debug \"S3: file: \"+name_file+\" restored on bucket \"+@bucket\n else\n @logger.debug \"S3: file: \"+name_file+\" was put on bucket \"+@bucket\n end\n end\n\n File.delete (file)\n\n end\n end", "title": "" }, { "docid": "159c452fe1e1420fe274c9daa2d31e3d", "score": "0.61905456", "text": "def destroy!(options = {:bucket_name => UFS::S3.bucket.to_s})\n return true unless exists?(options)\n \n begin\n vassal.delete && !refresh!\n rescue AWS::S3::NoSuchKey\n true\n end\n end", "title": "" }, { "docid": "af840dbfbecfd0f081e47e0232328993", "score": "0.61883384", "text": "def send_to_amazon(file_path)\n bucket = \"db-backups\"\n file_name = File.basename(file_path)\n AWS::S3::Base.establish_connection!(:access_key_id => 'YOUR KEY', :secret_access_key => 'YOUR SECRET')\n #push the file up\n AWS::S3::S3Object.store(file_name, File.open(file_path), bucket)\nend", "title": "" }, { "docid": "af840dbfbecfd0f081e47e0232328993", "score": "0.61883384", "text": "def send_to_amazon(file_path)\n bucket = \"db-backups\"\n file_name = File.basename(file_path)\n AWS::S3::Base.establish_connection!(:access_key_id => 'YOUR KEY', :secret_access_key => 'YOUR SECRET')\n #push the file up\n AWS::S3::S3Object.store(file_name, File.open(file_path), bucket)\nend", "title": "" }, { "docid": "d50385a3daeb6bc01b3df0cb05ca0193", "score": "0.6187791", "text": "def bad_usage\n puts \"\"\n puts \"Usage:\"\n puts \" ruby sample/s3_batch_download.rb [bucket name] [file to use]\"\n exit 1\nend", "title": "" }, { "docid": "f1ea0e4bbcdf7ba5a4b9fa6c3320bbbd", "score": "0.61723435", "text": "def put_file_with_key(file, key, bucket = 'slideshare', acl_value = 'public-read', s3interface = nil)\nunless file and key\n return false\nend\ntries = 0\nif FileTest.file?(file)\n while true do\n begin\n return false if tries > MAX_TRIES\n content_type = MIME::Types.of(File.basename(file)).to_a.join(',')\n content_type = 'text/plain' if content_type == \"\"\n if s3interface != nil\n s3 = s3interface\n else\n s3 = RightAws::S3Interface.new(@access_key, @secret_key, {:logger => $logger})\n end\n return true if s3.put(bucket, key, File.open(file), {'x-amz-acl' => acl_value, 'Content-Type' => content_type})\n tries = tries + 1\n rescue Exception => e\n $logger.warn(e.inspect)\n tries = tries + 1\n end\n end\nend\nend", "title": "" }, { "docid": "e1c5830507f3f812267abcf8e0fd66cd", "score": "0.617144", "text": "def run_me\n region = \"us-west-2\"\n bucket_name = \"BUCKET_NAME\"\n s3_client = Aws::S3::Client.new(region: region)\n\n exit 1 unless list_bucket_objects?(s3_client, bucket_name)\nend", "title": "" }, { "docid": "76e842150562484867db51327d1ef3c7", "score": "0.6131146", "text": "def run_me\n user_name = \"my-user\"\n region = \"us-west-2\"\n iam_client = Aws::IAM::Client.new(region: region)\n user = \"\"\n role_name = \"AmazonS3ReadOnly\"\n role_arn = \"arn:aws:iam::111111111111:role/\" + role_name\n role_session_name = \"ReadAmazonS3Bucket\"\n duration_seconds = 3600\n sts_client = Aws::STS::Client.new(region: region)\n bucket_name = \"doc-example-bucket\"\n\n puts \"Getting or creating user '#{user_name}'...\"\n\n if user_exists?(iam_client, user_name)\n user = get_user(iam_client, user_name)\n else\n user = create_user(iam_client, user_name)\n end\n\n if user.empty?\n puts \"Cannot get or create user '#{user_name}'. Stopping program.\"\n exit 1\n else\n puts \"Got or created user '#{user_name}'.\"\n end\n\n puts \"Checking whether the role '#{role_name}' exists...\"\n\n if role_exists?(iam_client, role_name)\n puts \"The role '#{role_name}' exists.\"\n else\n puts \"The role '#{role_name}' does not exist. Stopping program.\"\n end\n\n puts \"Getting credentials...\"\n\n credentials = get_credentials(sts_client, role_arn, role_session_name, duration_seconds)\n\n if credentials.nil?\n puts \"Cannot get credentials. Stopping program.\"\n exit 1\n else\n puts \"Got credentials.\"\n end\n\n s3_client = Aws::S3::Client.new(\n region: region,\n credentials: credentials\n )\n\n puts \"Checking whether the bucket '#{bucket_name}' exists...\"\n\n if bucket_exists?(s3_client, bucket_name)\n puts \"The bucket '#{bucket_name}' exists.\"\n else\n puts \"The role '#{bucket_name}' does not exist. Stopping program.\"\n exit 1\n end\n\n unless list_objects_in_bucket?(s3_client, bucket_name)\n puts \"Cannot access the bucket '#{bucket_name}'. Stopping program.\"\n exit 1\n end\nend", "title": "" }, { "docid": "d174f8c30db478a6073150250b3dbb2c", "score": "0.61077857", "text": "def delete_from_s3(key, bucket)\n begin\n S3VideoObject.delete(key, bucket)\n rescue AWS::S3::S3Exception => e\n logger.error(e)\n return false\n else\n true\n end\n end", "title": "" }, { "docid": "71acdfb82dc1bff5190434b654534083", "score": "0.60675293", "text": "def setup_s3\n client = S3Client.instance\n bucket = ::Configuration.instance.storage[:bucket]\n client.create_bucket(bucket: bucket) unless client.bucket_exists?(bucket)\n client.put_bucket_policy(bucket: bucket,\n policy: JSON.generate({\n Version: \"2012-10-17\",\n Statement: [\n {\n Principal: \"*\",\n Effect: \"Allow\",\n Action: [\n \"s3:GetObject\"\n ],\n Resource: [\n \"arn:aws:s3:::#{bucket}/*\"\n ]\n }\n ]\n }))\n client.delete_objects(bucket: bucket)\n\n @@seeding = true\n Bitstream.where(\"staging_key IS NOT NULL OR permanent_key IS NOT NULL\").each do |bs|\n fix_bitstream_keys(bs)\n File.open(file_fixture(bs.original_filename), \"r\") do |file|\n PersistentStore.instance.put_object(key: bs.effective_key,\n file: file)\n end\n end\n @@seeding = false\n end", "title": "" }, { "docid": "44d37be3a632c04a3a7c549e0d008e26", "score": "0.6067", "text": "def store_file(bucket, key, filename)\n puts \"Storing #{filename} in #{bucket}.#{key}\"\n S3Object.store(\n key,\n File.open(filename),\n bucket,\n :access => :public_read\n )\n end", "title": "" }, { "docid": "29375fe51bf05843f3d4ec9fdc25d4fd", "score": "0.60655147", "text": "def upload\n # Upload the given file\n AWS::S3::S3Object.store( FILE,\n open( FILE ),\n BUCKET,\n :access => :public_read )\n\n # display the URL of the file just uploaded\n puts AWS::S3::S3Object.url_for((FILE), BUCKET)[/[^?]+/]\nend", "title": "" }, { "docid": "3e7cd74604265e9847d511b8a1542955", "score": "0.6055399", "text": "def cleanup!\n s3_bucket.objects.each do |obj|\n if !files.include? \"#{folder_path}/#{obj.key}\"\n puts \"Deleting #{obj.key}\"\n obj.delete\n end\n end\n end", "title": "" }, { "docid": "92c4ae49930c454034bac53ae93f1e9f", "score": "0.6050535", "text": "def delete_from_s3(s3_filename)\n s3 = AWS::S3.new\n s3.buckets[@bucket].objects.delete(s3_filename)\n end", "title": "" }, { "docid": "095ad3ccdf3165a168c3e1216cccf3a2", "score": "0.60476106", "text": "def run_me\r\n bucket_name = 'doc-example-bucket'\r\n object_key = 'my-file.txt'\r\n content_to_encrypt = 'This is the content of my-file.txt.'\r\n kms_customer_key_id = '9041e78c-7a20-4db3-929e-828abEXAMPLE'\r\n region = 'us-west-2'\r\n s3_client = Aws::S3::Client.new(region: region)\r\n\r\n if kms_cmk_sse_encrypted_object_uploaded?(\r\n s3_client,\r\n bucket_name,\r\n object_key,\r\n content_to_encrypt,\r\n kms_customer_key_id\r\n )\r\n puts 'Encrypted object uploaded.'\r\n else\r\n puts 'Encrypted object not uploaded.'\r\n end\r\nend", "title": "" }, { "docid": "580d374bdc08265d41f8d2d21de86394", "score": "0.6042623", "text": "def cleanup\n AWS::S3::Base.establish_connection!(\n :access_key_id => @@access_key_id,\n :secret_access_key => @@secret_access_key\n )\n cleanName = File.basename(self.ImageLocation)\n\n if AWS::S3::S3Object.exists? cleanName, @@aws_bucket_id\n AWS::S3::S3Object.delete cleanName, @@aws_bucket_id\n end\n end", "title": "" }, { "docid": "068c6b9324fe25a83b3ad715a334d322", "score": "0.60399055", "text": "def run_me\n region = \"us-west-2\"\n user_name = \"my-user\"\n bucket_name = \"doc-example-bucket\"\n\n iam = Aws::IAM::Client.new(region: region)\n user = get_user(iam, user_name)\n\n exit 1 unless user.user_name\n\n puts \"User's name: #{user.user_name}\"\n sts = Aws::STS::Client.new(region: region)\n credentials = get_temporary_credentials(sts, 3600, user_name,\n {\n \"Version\" => \"2012-10-17\",\n \"Statement\" => [\n \"Sid\" => \"Stmt1\",\n \"Effect\" => \"Allow\",\n \"Action\" => \"s3:ListBucket\",\n \"Resource\" => \"arn:aws:s3:::#{bucket_name}\"\n ]\n }\n )\n\n exit 1 unless credentials.access_key_id\n\n puts \"Access key ID: #{credentials.access_key_id}\"\n s3_client = Aws::S3::Client.new(region: region, credentials: credentials)\n\n exit 1 unless list_objects_in_bucket?(s3_client, bucket_name)\nend", "title": "" }, { "docid": "e32743e0ba78afb7fb30ea2acb47c43d", "score": "0.60371727", "text": "def delete_from_cloud\n S3Connection.new(:media).bucket.delete(s3_key) if s3_key\n end", "title": "" }, { "docid": "7f84642e0f35e6a6089afd203ec272ab", "score": "0.6028644", "text": "def s3_bag\n data_bag_item(node['railslove']['backup']['databag'], node['railslove']['backup']['item'])\nrescue\n Chef::Log.warn(\"You need to provide access credentials for Amazon S3\")\n {}\nend", "title": "" }, { "docid": "35916f78e9df57a70e65d52de0809a95", "score": "0.60281", "text": "def upload_files(data_file_recs)\n test_config = JSON.parse(File.open('test_config.json').read)\n bucket_name = test_config['test-bucket-name-aws']\n\n aws_config = JSON.parse(File.open('aws_config.json').read)\n AWS.config(aws_config)\n s3 = AWS::S3.new\n\n $stderr.reopen(\"jmc_errorlog.txt\", \"w\")\n total = data_file_recs.length\n count = 1\n\n data_file_recs.each do |record|\n filename = \"#{record['path']}/#{record['name']}\"\n puts \"Attempting to upload: '#{filename}'\"\n STDOUT.flush\n retname = s3.buckets[bucket_name].objects[filename].write(file: filename)\n puts \"Uploaded file # #{count}/#{total} to #{bucket_name}/#{retname.key}.\"\n STDOUT.flush\n count += 1\n end\nend", "title": "" }, { "docid": "2727cba3b00ba03dc03f04f9c8daf262", "score": "0.6025517", "text": "def destroy(file, bucket_as_string)\n self.connection.put_bucket(s3_bucket)\n connection.delete_object(s3_bucket, file)\n end", "title": "" }, { "docid": "ae8729e1bc046f65a48c7f511de18fb2", "score": "0.6001746", "text": "def upload_file(file)\n target_path = s3_file_path(file)\n s3_object = @s3_bucket.object(target_path)\n\n content = File.read(file)\n digest = Digest::MD5.hexdigest(content)\n\n if s3_object.exists? && (digest == s3_object.etag.gsub('\"', ''))\n puts \"skipping #{file} to #{target_path} (ETAG matches)\"\n else\n puts \"uploading #{file} to #{target_path}\"\n s3_object.put(body: content)\n end\n end", "title": "" }, { "docid": "eea28120e2ec4a8f90f22ff6f7ff1a4b", "score": "0.59894127", "text": "def s3_credentials \n {:bucket => \"hifashion-images1\", :access_key_id => ENV[\"access_key_id\"] , :secret_access_key => ENV[\"secret_access_key\"]} \n end", "title": "" }, { "docid": "94ba895a452e9c79aa0b0361809f42aa", "score": "0.5988228", "text": "def upload_to_s3(upload, s3_options)\n headers = {\n 'Date' => s3_options['date'],\n 'Authorization' => s3_options['signature'],\n 'Content-Type' => s3_options['content_type'],\n 'x-amz-acl' => 'public-read'\n }\n\n file = File.open(upload['file_path'], 'r')\n response = self.class.put( s3_options['upload_url'], :body => file.read, :headers => headers )\n file.close\n\n complete(upload)\n end", "title": "" }, { "docid": "1a101548ddc992dfbc2ab91b9c1be671", "score": "0.5984569", "text": "def delete_file(file, bucket = 'aam-user-photos')\n s3 = RightAws::S3Interface.new(@access_key, @secret_key, {:logger => $logger})\n return s3.delete(bucket, file)\n end", "title": "" }, { "docid": "239311d6c9f30e723f208691a97b6390", "score": "0.5978036", "text": "def delete_s3_bucket(s3_handle, bucket_name)\n\n Rails.logger.info(\"[LIB] [AWS] [S3] [delete_s3_bucket] entering\" )\n\n if bucket_name.blank?\n Rails.logger.info(\"[LIB] [AWS] [S3] [delete_s3_bucket] empty bucket name\")\n return\n end\n\n #s3 = create_s3_connection\n\n if s3_handle.nil?\n Rails.logger.error(\"[LIB] [AWS] [S3] [delete_s3_bucket] S3 connection failed\\n\\n\" )\n return\n end\n\n bucket = s3_handle.bucket(bucket_name)\n\n if( bucket.nil?)\n raise \"No Bucket Exist\"\n end\n\n #clear objects from bucket\n bucket.clear()\n status = bucket.delete(:force=>false)\n\n Rails.logger.info(\"[LIB] [AWS] [S3] [delete_s3_bucket] bucket #{bucket_name} delete status = #{status} \\n\\n\")\n\n return true\n\n #Handle Right_Aws error\n rescue RightAws::AwsError=>err\n aws_s3_error(s3_handle,err)\n return false\n\n #Handling the RuntimeError\n rescue => e\n Rails.logger.error(\"[LIB] [AWS] [S3] [delete_s3_bucket] **** RESCUE **** #{e.message} \\n\\n\")\n return false\n end", "title": "" }, { "docid": "4851c6f1ac4a75fc3815c3b41af5ca02", "score": "0.597358", "text": "def add_file_to_bucket(bucket_name, file_name)\n\t#init bucket object\n\tbucket = @s3.buckets[bucket_name]\n\n\t#check if file exists\n\tif !File.exist?(file_name)\n\t\tputs \"File '#{file_name}' does not exist. Please correct file path.\"\n\telse\n\t\tif bucket.exists?\n\t\t\t# upload a file\n\t\t\tbasename = File.basename(file_name)\n\t\t\to = bucket.objects[basename]\n\t\t\to.write(:file => file_name)\n\n\t\t\tputs \"Uploaded #{file_name} to:\"\n\t\t\tputs o.public_url\n\n\t\t\t#generate a presigned URL\n\t\t\tputs \"\\nURL to download the file:\"\n\t\t\tputs o.url_for(:read)\n\t\telse\n\t\t\tputs \"Bucket '#{bucket_name}' does not exist. Cannot upload file.\"\n\t\tend\n\tend\n\tputs \" \" #blank line for readibility\nend", "title": "" }, { "docid": "f08ebbd2b7a7cf204c3a47123da16d36", "score": "0.5972146", "text": "def AWS_S3\n S3::Service.new(\n access_key_id: ENV[\"S3_ACCESS_KEY_ID\"],\n secret_access_key: ENV[\"S3_SECRET_ACCESS_KEY\"]\n )\n end", "title": "" }, { "docid": "f1591ae48b20f7c6d40166e016116fe2", "score": "0.59686154", "text": "def remove_from_s3\n PublicEarth::Db::Photo.connect_to_s3 unless AWS::S3::Base.connected?\n AWS::S3::S3Object.delete s3_key, s3_bucket if AWS::S3::S3Object.exists? s3_key, s3_bucket\n end", "title": "" }, { "docid": "8f8eec564462f65952ef599a556df417", "score": "0.5965665", "text": "def put_s3_files\n @s3_outs.clear\n @s3_endpoints.each do |ep|\n fname = ep['filename']\n if File.exists?(fname)\n EZQ.exceptional_retry_with_backoff(2){EZQ.send_file_to_s3(fname,ep['bucket'],ep['key'])}\n info = {'bucket'=>ep['bucket'],'key'=>ep['key']}\n @s3_outs.push(info)\n end\n end\n end", "title": "" }, { "docid": "d3e2a125a825b1d5b34b470ffc40d927", "score": "0.5956969", "text": "def setup_bucket(params={})\n granting_params = { \n :s3_videos_bucket => params[:bucket],\n :aws_access_key => params[:access_key],\n :aws_secret_key => params[:secret_key]\n }\n\n put(\"/clouds/#{@cloud_id}.json\", granting_params)\n end", "title": "" }, { "docid": "e9898d0342ace217a27291d84712cc98", "score": "0.5949743", "text": "def fetch_file(s3client,plaintext_key,filename,bucket)\r\n begin\r\n s3enc = Aws::S3::Encryption::Client.new(encryption_key: plaintext_key,\r\n client: s3client)\r\n res = s3enc.get_object(bucket: bucket,\r\n key: filename,\r\n response_target: filename)\r\n rescue Aws::S3::Errors::ServiceError => e\r\n puts \"upload failed: #{e}\"\r\n end\r\nend", "title": "" }, { "docid": "58743e6427a84aec74808b83c1843f7f", "score": "0.59444034", "text": "def run_demo\n bucket_name = \"doc-example-bucket\"\n object_key = \"my-object.txt\"\n\n wrapper = ObjectExistsWrapper.new(Aws::S3::Object.new(bucket_name, object_key))\n exists = wrapper.exists?\n\n puts \"Object #{object_key} #{exists ? 'does' : 'does not'} exist.\"\nend", "title": "" }, { "docid": "c5a36cffa49a3b18e1615872d8d61ad4", "score": "0.5938832", "text": "def run_demo\n source_bucket_name = \"doc-example-bucket1\"\n source_key = \"my-source-file.txt\"\n target_bucket_name = \"doc-example-bucket2\"\n target_key = \"my-target-file.txt\"\n\n source_bucket = Aws::S3::Bucket.new(source_bucket_name)\n wrapper = ObjectCopyWrapper.new(source_bucket.object(source_key))\n target_bucket = Aws::S3::Bucket.new(target_bucket_name)\n target_object = wrapper.copy_object(target_bucket, target_key)\n return unless target_object\n\n puts \"Copied #{source_key} from #{source_bucket_name} to #{target_object.bucket_name}:#{target_object.key}.\"\nend", "title": "" }, { "docid": "22e3880d7f8fcefbe24803e95d6f7319", "score": "0.5937217", "text": "def connect_to_s3()\n\n Aws::S3::Client.new(\n access_key_id: ENV['S3_KEY'],\n secret_access_key: ENV['S3_SECRET'],\n region: ENV['AWS_REGION'],\n force_path_style: ENV['PATH_STYLE']\n )\n\nend", "title": "" }, { "docid": "046c1eacd35106976c24a5ffd01945d8", "score": "0.5916259", "text": "def add_file_to_bucket(bucket_name, file_name)\n\t#init bucket object\n\tbucket = @s3.buckets[bucket_name]\n\n\t#check if file exists\n\tif !File.exist?(file_name)\n\t\tputs \"File '#{file_name}' does not exist. Please correct file path.\"\n\telse\n\t\tif bucket.exists?\n\t\t\t# upload a file\n\t\t\tbasename = File.basename(file_name)\n\t\t\to = bucket.objects[basename]\n\t\t\t#o.acl = \"public_read\"\n\t\t\to.write(:file => file_name, :acl => :public_read)\n\n\t\t\tputs \"Uploaded #{file_name} to:\"\n\t\t\tputs o.public_url\n\n\t\t\t#generate a presigned URL\n\t\t#\tputs \"\\nURL to download the file:\"\n\t\t#\tputs o.url_for(:read)\n\t\telse\n\t\t\tputs \"Bucket '#{bucket_name}' does not exist. Cannot upload file.\"\n\t\tend\n\tend\n\t#puts \" \" #blank line for readibility\nend", "title": "" }, { "docid": "ee50bf389ddcd7f209b16efde1b70197", "score": "0.5913979", "text": "def write_Amazon_file(filename, file_path)\n require 'aws-sdk'\n\n\n s3 = Aws::S3::Resource.new(\n credentials: Aws::Credentials.new(ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']),\n region: 'us-west-1'\n )\n\n obj = s3.bucket('stfyc-sots').object(filename)\n obj.upload_file(file_path, acl: 'public-read')\n end", "title": "" }, { "docid": "04bc9c959344d81951a2f1396edd8a04", "score": "0.59105515", "text": "def test\n connection = Fog::Storage::Google.new\n\n puts \"Put a bucket...\"\n puts \"----------------\"\n connection.put_bucket(\"fog-smoke-test\")\n\n puts \"Get the bucket...\"\n puts \"-----------------\"\n connection.get_bucket(\"fog-smoke-test\")\n\n puts \"Put a test file...\"\n puts \"---------------\"\n connection.put_object(\"fog-smoke-test\", \"my file\" ,\"THISISATESTFILE\")\n\n puts \"Delete the test file...\"\n puts \"---------------\"\n connection.delete_object(\"fog-smoke-test\", \"my file\")\n\n puts \"Delete the bucket...\"\n puts \"------------------\"\n connection.delete_bucket(\"fog-smoke-test\")\nend", "title": "" }, { "docid": "7df5fa4db01fa17b75a715ace2476a68", "score": "0.59031594", "text": "def upload_to_aws(lambda)\n puts 'Initializing AWS Lambda upload...'\n puts 'Starting to upload to AWS...'\n puts exec(\"aws lambda update-function-code --function-name #{lambda} --zip-file fileb://archive.zip --publish\")\n puts 'Upload Successful ...'\n puts '--------------------------------'\nend", "title": "" }, { "docid": "6f09fc0bc3232f84fd48f21c3dcd4ae7", "score": "0.5898877", "text": "def upload_if_not_present(text, filename)\n if not AWS::S3::S3Object.exists? filename, BUCKET_NAME\n AWS::S3::S3Object.store filename, text, BUCKET_NAME, :access => :public_read\n end\n end", "title": "" }, { "docid": "27825c71e54320fe3c2577752fda0dd1", "score": "0.5892018", "text": "def s3_store_file(bucket_name, key, file, md5, s3 = nil)\n s3 ||= S3Tools.initialize_s3\n s3.interface.store_object_and_verify(:bucket => bucket_name, :key => key, :md5 => md5, :data => file)\n end", "title": "" }, { "docid": "428de9200823f447e839709ec90139e6", "score": "0.58837956", "text": "def s3_publish\n sts = AWS::STS.new\n user = sts.assume_role(:role_arn => @config[:publishing_role_arn], :role_session_name => \"Upload\")\n AWS::S3.new(user[:credentials])\nend", "title": "" }, { "docid": "b27df8af26ed4a8c809cb5c1f87c12e3", "score": "0.5872316", "text": "def delete\r\n\r\n \tkey = params[:key]\r\n\r\n \tif key.blank?\r\n\t\trender json: {error: \"missing 'key' parameter\"}, status: :bad_request\r\n\t\treturn\r\n \tend\r\n\r\n \tif !user_has_access?(@user, key)\r\n\t\trender json: {error: \"forbidden\"}, status: :forbidden\r\n\t\treturn\r\n\tend\r\n\r\n\r\n \tif !s3_exists?(key)\r\n\t\trender json: {error: \"file doesn't exist\"}, status: :not_found\r\n\t\treturn\r\n\tend\r\n\r\n\ts3_delete_file(key)\r\n\r\n\tresponse = {status: 'done'}\r\n\r\n\tcreate_log('DELETE_FILE', response)\r\n\r\n \trender json: response\r\n\r\n end", "title": "" }, { "docid": "da72fd5b2197b4a4a366dbf22011f1d4", "score": "0.5870271", "text": "def empty_s3_bucket\n s3_bucket_name = ENV['CARRIERWAVE_S3_BUCKET']\n resp = s3.list_objects(bucket: s3_bucket_name)\n if resp.contents.size > 0\n # IE: objects = [{key: \"objectkey1\"}, {key: \"objectkey2\"}]\n objects = resp.contents.map { |item| {key: item.key} }\n s3.delete_objects(\n bucket: s3_bucket_name,\n delete: {\n objects: objects,\n quiet: false,\n }\n )\n empty_s3_bucket # keep deleting objects until bucket is empty\n end\n end", "title": "" }, { "docid": "a290eb46cd3b6d8fda8bffbcce8aca60", "score": "0.58633035", "text": "def s3_updatefile(filename, filedata)\r\n s3_deletefile filename\r\n #AWS::S3::S3Object.store filename, filedata, QBUCKET.to_s, :access => :public_read\r\n AWS::S3::S3Object.store filename, filedata, IMAGES_BUCKET.to_s, :access => :public_read\r\n end", "title": "" }, { "docid": "50d216d5d76869fe697c873945ed9974", "score": "0.58628345", "text": "def delete_s3_key(s3_handle, key_url)\n\n Rails.logger.info(\"[LIB] [AWS] [S3] [delete_s3_key] entering\" )\n\n if key_url.blank?\n Rails.logger.info(\"[LIB] [AWS] [S3] [delete_s3_key] empty key url #{key_url}\")\n return\n end\n\n key_uri = key_url.sub(\"#{@@s3config[:protocol]}://#{@@s3config[:server]}/\",\"\")\n bkt = key_uri.split('/')[0]\n\n key_uri = key_uri.sub(bkt + \"/\", \"\")\n\n #s3 = create_s3_connection\n\n if s3_handle.nil?\n Rails.logger.error(\"[LIB] [AWS] [S3] [delete_s3_key] S3 connection failed\\n\\n\" )\n return\n end\n\n bucket = s3_handle.bucket(bkt)\n\n key = bucket.key(key_uri, true)\n\n status = key.delete\n Rails.logger.info(\"[LIB] [AWS] [S3] [delete_s3_key] key <#{key_uri}> in bucket <#{bkt}> has delete status = #{status} \\n\\n\")\n\n return true\n\n #Handle Right_Aws error\n rescue RightAws::AwsError=>err\n aws_s3_error(s3_handle,err)\n return false\n\n #Handling the RuntimeError\n rescue => e\n Rails.logger.error(\"[LIB] [AWS] [S3] [delete_s3_key] **** RESCUE **** #{e.message} \\n\\n\")\n return false\n\n end", "title": "" }, { "docid": "ba4e210af29a25b52ecd65f4982c5694", "score": "0.5859233", "text": "def object_put_file(filename:, key:, metadata: nil, not_if_exits: true)\n begin\n if not_if_exits\n begin\n md5 = obj_md5(key: key) # Object exists\n if md5 != nil && md5 == file_md5(filename: filename) # Already in object store with same MD5 checksum.\n raise S3_Exists, \"Already present: '#{key}'\"\n end\n rescue S3_Exists => e # Need to catch this, as it is a subclass of StandardError, so would be caught next.\n raise\n rescue StandardError => e\n $stderr.puts \"AWS_connection(#{@bucket}).object_put_file(#{key}) MD5: #{e.class} #{e}\"\n end\n end\n # Binary read on file\n File.open(filename, 'rb') do |file|\n begin\n @s3_client.put_object(bucket: @bucket, key: key, body: file, metadata: metadata)\n rescue StandardError => e\n raise \"AWS_connection(#{@bucket}).object_put_file(key: #{key}) put_object: #{e.class} #{e}\"\n end\n end\n rescue StandardError => e # Will catch and report the S3_Exists we raise above.\n raise \"AWS_connection(#{@bucket}).object_put_file(key: #{key}) : #{e.class} #{e}\"\n end\n end", "title": "" }, { "docid": "3746ad683e9a3eb52c57d0831d40a026", "score": "0.58547103", "text": "def run_me\r\n bucket_name = 'doc-example-bucket'\r\n object_key = 'my-file.txt'\r\n region = 'us-west-2'\r\n s3_client = Aws::S3::Client.new(region: region)\r\n private_key_file = 'my-private-key.pem'\r\n\r\n puts get_decrypted_object_content(\r\n s3_client,\r\n bucket_name,\r\n object_key,\r\n private_key_file\r\n )\r\nend", "title": "" }, { "docid": "9f39f3e9b3f177acc5dba37d33b48bf6", "score": "0.58495694", "text": "def sync_dir_to_s3(local_dir)\n # escape spaces in paths\n local_dir = local_dir.gsub(' ', '\\ ')\n s3path = \"s3://<s3bucket>\" + local_dir \n\n # use 'cp' if it's a file. 'sync' only works with directories.\n if File.file?(local_dir)\n s3command = \"aws s3 cp \" + local_dir + \" \" + s3path\n else\n s3command = \"aws s3 sync \" + local_dir + \" \" + s3path + \" \" + @excludes + \" --delete\"\n end\n\n begin \n s3_out = `#{s3command}`.split(\"\\n\") # Split s3command on newlines, so each can be output as it's own line.\n # if the output of the command is a blank string, it's because 'sync' found nothing to sync.\n if s3_out.count == 0\n `/bin/echo '#{Time.now}: Skipping #{local_dir}, no changes necessary.' >> /path/to/log/s3sync.log`\n else\n `/bin/echo #{Time.now}: >> /path/to/log/s3sync.log`\n # aws s3 sync gives constant updates to stdout in the form of \"completed X of Y parts with Z file(s) remaining\".\n # This output can become large enough to choke `echo` when outputting to the logs. All we want is the end of the \n # string, the part that tells us what file was either uploaded or deleted. e.g. \"delete: s3://<s3bucket>/somefolder/somefile.jpg\"\n # snatch it with regex and output that part only.\n s3_out.each do |line|\n clean_line = line.match(/((?:upload|delete):+.*$)/)\n # if clean_line is nil, no match was found.\n next if clean_line.nil?\n # echo the first match group to the log.\n `/bin/echo ' #{clean_line[1]}' >> /path/to/log/s3sync.log`\n end\n end\n\n rescue Exception => e\n `/bin/echo '#{Time.now}: Script error: #{e}' >> /path/to/log/s3sync.log`\n end\n\nend", "title": "" }, { "docid": "1c77db8a3125252258ee9ff58545f523", "score": "0.58487624", "text": "def upload(bucket_name, file, key = nil)\n key ||= File.basename(file)\n object = @s3.bucket(bucket_name).object(key)\n object.upload_file(file)\n object.load\n object.version_id\n end", "title": "" }, { "docid": "90448b39c527e3b59a41e5e8b8fb0417", "score": "0.58473456", "text": "def remove_file(s3_path)\n bucket.objects[s3_path].delete\n end", "title": "" }, { "docid": "f5d4caee8c99bae3bae3d8162322337a", "score": "0.5830464", "text": "def save(local_file_name, s3_key)\n s3.sync_clock\n unless bucket.files.head(s3_key)\n s3_file = bucket.files.create(\n :key => s3_key,\n :body => File.open(local_file_name),\n :storage_class => 'STANDARD_IA',\n :public => false\n )\n log \"s3: pushed #{local_file_name} to #{s3_key}\"\n s3_file\n end\n end", "title": "" }, { "docid": "5c4676b7a166f84a6e108a551721f824", "score": "0.582464", "text": "def push(s3_key, file, options = {})\n\n\t\tif file.is_a? String\n\t\t\tfile = File.open(file, 'r')\n\t\tend\n\t\t\n\t\tputs \"--> pushing #{file.path} to #{s3_key}...\".green\n obj = @s3.buckets[@bucket].objects[s3_key]\n obj.write(file, options)\n\n @dirty_keys << s3_key\n # Special cases for index files.\n # for /index.html we should also invalidate /\n # for /archive/index.html we should also invalidate /archive/\n if (s3_key == \"index.html\")\n\t\t\t@dirty_keys << \"/\"\n elsif File.basename(s3_key) == \"index.html\"\n\t\t\t@dirty_keys << s3_key.chomp(s3_key.split(\"/\").last)\n end\n\t \n\tend", "title": "" }, { "docid": "d3bd4a225bb03dc1e1e61c23807dc77a", "score": "0.5818061", "text": "def run_me\n bucket_name = 'doc-example-bucket'\n object_key = 'my-file.txt'\n region = 'us-east-1'\n s3_client = Aws::S3::Client.new(region: region)\n\n puts \"Getting server-side encryption state for object '#{object_key}' \" \\\n \"in bucket '#{bucket_name}'...\"\n\n state = get_server_side_encryption_state(\n s3_client,\n bucket_name,\n object_key\n )\n\n puts \"Encryption state is #{state}.\"\nend", "title": "" }, { "docid": "24a330f748969c1387a5385a352eb202", "score": "0.5809019", "text": "def require_aws_keys() \n unless verify_aws_keys()\n auth = Mortar::Auth\n if !auth.has_credentials \n error(NO_AWS_KEYS_ERROR_MESSAGE)\n else\n vars = fetch_aws_keys(auth, Mortar::Command::Base.new)\n if vars['aws_access_key_id'] && vars['aws_secret_access_key']\n set_aws_keys(vars['aws_access_key_id'], vars['aws_secret_access_key'])\n else\n error(API_CONFIG_ERROR_MESSAGE)\n end\n end \n end\n end", "title": "" }, { "docid": "50d5256134a23bc388beb63ae418af8c", "score": "0.5799847", "text": "def initiate_aws_s3_bucket(options)\n s3 = Aws::S3::Bucket.new(\n :region => options['region'], \n :access_key_id => options['access'],\n :secret_access_key => options['secret']\n )\n return s3\nend", "title": "" }, { "docid": "2cbfcbffff243ecf6ed10ce81f40a1af", "score": "0.5795648", "text": "def run_me\n bucket_name = 'doc-example-bucket'\n object_key = 'my-file.txt'\n region = 'us-west-2'\n s3_client = Aws::S3::Client.new(region: region)\n\n puts \"Getting server-side encryption state for object '#{object_key}' \" \\\n \"in bucket '#{bucket_name}'...\"\n\n state = get_server_side_encryption_state(\n s3_client,\n bucket_name,\n object_key\n )\n\n puts \"Encryption state is #{state}.\"\nend", "title": "" }, { "docid": "5beec98c8bdd1e653304a8bd16bb4a71", "score": "0.57935655", "text": "def putAsset(filePath, metadata)\n\n # Calculate the sha256 hash, and use it to form the s3 path\n md5sum = Digest::MD5.file(filePath).hexdigest\n sha256Sum = Digest::SHA256.file(filePath).hexdigest\n s3Path = \"#{ENV['S3_PREFIX'] || raise(\"missing env S3_PREFIX\")}/binaries/#{sha256Sum[0,2]}/#{sha256Sum[2,2]}/#{sha256Sum}\"\n\n # If the S3 file is already correct, don't re-upload it.\n obj = $s3Bucket.object(s3Path)\n if !obj.exists? || obj.etag != \"\\\"#{md5sum}\\\"\"\n #puts \"Uploading #{filePath} to S3.\"\n obj.put(body: File.new(filePath),\n metadata: metadata.merge({\n original_path: filePath.sub(%r{.*/([^/]+/[^/]+)$}, '\\1'), # retain only last directory plus filename\n mime_type: MimeMagic.by_magic(File.open(filePath)).to_s\n }))\n # 2018-06-01: Is AWS introducing a introducing a new kind of etag? This occasionally fails.\n # obj.etag == \"\\\"#{md5sum}\\\"\" or raise(\"S3 returned md5 #{resp.etag.inspect} but we expected #{md5sum.inspect}\")\n end\n\n return sha256Sum\nend", "title": "" }, { "docid": "963ef2e17e5f01376a27ba2f70716629", "score": "0.5792079", "text": "def upload_file_to_folder?(s3_client, bucket_name, folder_name, file_name)\n s3_client.put_object(\n body: file_name,\n bucket: bucket_name,\n key: folder_name + file_name\n )\n return true\nrescue StandardError => e\n puts \"Error while uploading the file '#{file_name}' to the \" \\\n \"folder '#{folder_name}' in the bucket '#{bucket_name}': #{e.message}\"\nend", "title": "" }, { "docid": "c5636fcced0772410a3d78fb0d6c910c", "score": "0.57917166", "text": "def set_to_s3(key, file, bucket, options={})\n begin\n options.merge!(:access => :public_read)\n S3VideoObject.store(key, File.open(file), bucket, options)\n rescue AWS::S3::S3Exception => e\n logger.error(e)\n return false\n else\n return true\n end\n end", "title": "" }, { "docid": "234a6ee243eef381f775e872ae4194da", "score": "0.578592", "text": "def write_to_aws(name)\n s3 = Aws::S3::Resource.new(region: 'us-west-1')\n obj = s3.bucket('audire-test-bucket').object(\"#{name}.mp3\")\n obj.upload_file(\"/home/pan/giskards-positronic-brain/visual-classifier/sonicpi/#{name}.mp3\", acl:'public-read')\n obj.public_url\nend", "title": "" }, { "docid": "f189a407063ad1f5402bdda43fd34748", "score": "0.5785634", "text": "def initialize(bucket_name)\n @files = []\n @files_to_cleanup = []\n @tar_excludes = []\n @copies_to_keep = 5\n @bucket_name = bucket_name\n @backup_name = 'backup'\n \n @s3 = RightAws::S3.new(AWSCredentials.access_key, AWSCredentials.secret_access_key, :logger => Logger.new(nil))\n end", "title": "" }, { "docid": "1038f724c400a4dbfbe6e765ecc618ca", "score": "0.57839745", "text": "def upload_signature\n request = S3::Service.service_request(:put)\n signature = S3::Signature.generate(host: Ind.backup.host, request: request, access_key_id: params[:accesskey], secret_access_key: params[:secretkey])\n end", "title": "" }, { "docid": "312dbc453683f752e19377bd7261b384", "score": "0.5780248", "text": "def object_uploaded?(s3_resource, bucket_name, object_key, file_path)\n object = s3_resource.bucket(bucket_name).object(object_key)\n File.open(file_path, 'rb') do |file|\n object.put(body: file)\n end\n return true\nrescue StandardError => e\n puts \"Error uploading object: #{e.message}\"\n return false\nend", "title": "" }, { "docid": "031631ad0225c21b34144aa9f1bc3787", "score": "0.57760257", "text": "def s3_upload_signature\n @signature ||= Base64.encode64(\n OpenSSL::HMAC.digest(\n OpenSSL::Digest::Digest.new('sha1'),\n ENV['AWS_SECRET_ACCESS_KEY'],\n s3_upload_policy_document\n )\n ).gsub(/\\n/, '')\nend", "title": "" }, { "docid": "81fc21a2cd1a2b6b3d1db161144a0608", "score": "0.5756765", "text": "def upload (fname, folder)\n \n raise \"ERROR: Invalid S3 location: #{folder}\" unless validate_s3(folder)\n fname_array = folder.split(':')\n bucket_name = fname_array[0]\n key_name = fname_array[1].chomp('/') + '/'\n key = RightAws::S3::Key.create( bucket = RightAws::S3::Bucket.create(@s3, bucket_name, true), \"#{key_name}#{fname}\")\n key.data = File.new(fname).read\n key.put\n DaemonKit.logger.info \"Uploaded #{fname} --> #{bucket_name}:#{key.to_s}\"\n return \"#{bucket_name}:#{key.to_s}\"\n \n end", "title": "" }, { "docid": "26f64127be76c44ab21ef775483a5892", "score": "0.57491773", "text": "def clean_s3\n file.remove!\n file.thumb.remove! # if you have thumb version or any other version\n file.large_image.remove!\n file.medium_image.remove!\n file.small_image.remove!\n file.pdf_thumb.remove!\n file.pdf_medium.remove!\n rescue Excon::Errors::Error => error\n puts \"Something gone wrong\"\n false\n end", "title": "" }, { "docid": "c7050e2a1b50fbc8dbc8e201132963d9", "score": "0.57457525", "text": "def set_variables\n @version = \"1.1.0\"\n begin\n s3 = Struct.new(:url, :port, :bucket, :token, :shared_secret, :ip_addresses)\n if ENV['S3_ACCESS_KEY_ID'] && ENV['S3_SECRET_ACCESS_KEY'] && ENV['S3_URL'] && ENV['S3_PORT'] && ENV['S3_BUCKET']\n @s3 = s3.new(ENV['S3_URL'], ENV['S3_PORT'].to_i, ENV['S3_BUCKET'], ENV['S3_ACCESS_KEY_ID'], ENV['S3_SECRET_ACCESS_KEY'], \"\")\n end\n rescue\n end\n end", "title": "" }, { "docid": "3e048c3082fa1235041fc863db02837f", "score": "0.5741091", "text": "def verify_aws_keys()\n if (not (ENV['AWS_ACCESS_KEY'] and ENV['AWS_SECRET_KEY'])) then\n if not ENV['MORTAR_IGNORE_AWS_KEYS']\n return false\n else\n return true\n end\n else\n return true\n end\n end", "title": "" }, { "docid": "d4f730eedea5bb713231a85b1faf38f1", "score": "0.57398367", "text": "def s3\n @conn ||= Fog::Storage.new({\n :provider => 'AWS',\n :aws_access_key_id => ENV['AWS_ACCESS_KEY_ID'],\n :aws_secret_access_key => ENV['AWS_SECRET_ACCESS_KEY'],\n :region => ENV['AWS_REGION']\n })\nend", "title": "" }, { "docid": "b58e20ca5b4e42a99c2d37dba76730e0", "score": "0.573904", "text": "def upload_image_to_aws\n\n puts \"HERE\"\n\n file_name = params[:file]\n\n puts file_name.tempfile\n\n key = SecureRandom.hex + \".jpg\"\n\n obj = S3_BUCKET.object(key)\n obj.upload_file(file_name.tempfile)\n\n\n response = {\n success: true,\n url: 'https://s3-us-west-2.amazonaws.com/mailfunnels-dev/' + key\n }\n\n render json: response\n\n end", "title": "" }, { "docid": "9016a6f796923c1bb4e63ecc722c8338", "score": "0.5738078", "text": "def deleteS3(appName)\n dbOriginalFile = \"#{@productionFolder}#{appName}/db/production.sqlite3\"\n if File.exists?(dbOriginalFile)\n success = @system.delete(dbOriginalFile)\n return success\n end\n end", "title": "" }, { "docid": "f29f4f4d8b085d9fcb6f33a671ca24d0", "score": "0.57352704", "text": "def put_files(names, bucket = @test_bucket)\n\t\tnames = [names] if not names.respond_to?('each')\n\t\tnames.each do |f|\n\t\t\tcmd = \"#{s3cmd} put #{f} s3://#{bucket}\"\n\t\t\trun(cmd)\n\t\tend\n\t\tnames.each do |f|\n\t\t\tassert(object_exists(bucket, f.rpartition('/')[-1]), \"put_files: object doesnt exist\")\n\t\tend\n\tend", "title": "" }, { "docid": "aa4802e7c1f600bb6b758bb142dfd969", "score": "0.5731311", "text": "def configure_s3_bucket\n connection = Fog::Storage.new(:provider => 'AWS',\n :aws_access_key_id => Constants::S3_ACCESS_KEY_ID,\n :aws_secret_access_key => Constants::S3_SECRET_ACCESS_KEY)\n\n connection.directories.create(:key => Constants::S3_BUCKET_NAME,\n :public => true)\n end", "title": "" } ]
348f9283b507eae0bdec9539fb03913b
GET /sudokus/new GET /sudokus/new.json
[ { "docid": "4d3f2f9cf6a2c60f0c366b9bac1dcedc", "score": "0.0", "text": "def new\n @sudoku = Sudoku.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sudoku }\n end\n end", "title": "" } ]
[ { "docid": "7e22a81a487f74bcff9ed990be2ebec8", "score": "0.7705423", "text": "def new\n @su = Sus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @su }\n end\n end", "title": "" }, { "docid": "2d20d62dcb8ffe2f9b7144a89fb8af12", "score": "0.73401374", "text": "def new\n @soupdejour = Soupdejour.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @soupdejour }\n end\n end", "title": "" }, { "docid": "31c8c5a421b4dbecf26238b1bf18fb49", "score": "0.71820337", "text": "def new\n @newse = Newse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newse }\n end\n end", "title": "" }, { "docid": "d6114d3a718d35055eb1c98d4916a55b", "score": "0.71669817", "text": "def new\n @usre = Usre.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @usre }\n end\n end", "title": "" }, { "docid": "cee795039dac4cc26e1c6abc4b4b095d", "score": "0.7148418", "text": "def new\n @sname = Sname.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sname }\n end\n end", "title": "" }, { "docid": "e16166750bb4a46039159c9f0650bf57", "score": "0.7123821", "text": "def new\n @solicitud = Solicitud.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @solicitud }\n end\n end", "title": "" }, { "docid": "e16166750bb4a46039159c9f0650bf57", "score": "0.7123821", "text": "def new\n @solicitud = Solicitud.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @solicitud }\n end\n end", "title": "" }, { "docid": "e9b448337cdfea946680a0902655f21a", "score": "0.71005255", "text": "def new\n @uese = Uese.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @uese }\n end\n end", "title": "" }, { "docid": "ff33ee57c718acabacc2310479d713be", "score": "0.70804405", "text": "def new\n @satu = Satu.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @satu }\n end\n end", "title": "" }, { "docid": "317bd0cde50c98d4138bc995faef804d", "score": "0.70702183", "text": "def new\n @sueldo = Sueldo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sueldo }\n end\n end", "title": "" }, { "docid": "b2009914b44292bd6d44750db1bdf231", "score": "0.7063853", "text": "def create\n @su = Sus.new(params[:su])\n\n respond_to do |format|\n if @su.save\n format.html { redirect_to @su, notice: 'Sus was successfully created.' }\n format.json { render json: @su, status: :created, location: @su }\n else\n format.html { render action: \"new\" }\n format.json { render json: @su.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "78b9e580f67d0532855a94a9d1af1d32", "score": "0.705931", "text": "def new\n @stau = Stau.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stau }\n end\n end", "title": "" }, { "docid": "6a091a33b9a002a5aa4c96832336571c", "score": "0.70272684", "text": "def new\n @otu = Otu.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @otu }\n end\n end", "title": "" }, { "docid": "b7055b31b9117f12f9268d464e5a1d44", "score": "0.70185447", "text": "def new\n @ussr = Ussr.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ussr }\n end\n end", "title": "" }, { "docid": "17d7da60333d97967bcd96628c11fd45", "score": "0.7011251", "text": "def new\n json_404\n end", "title": "" }, { "docid": "a695a4fdb279c1fd0136c71b8baa52dd", "score": "0.70083", "text": "def new\n @ua = Ua.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ua }\n end\n end", "title": "" }, { "docid": "cfe298cec0171e799a3e631e0378c5a5", "score": "0.6995275", "text": "def new\n @staatu = Staatu.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @staatu }\n end\n end", "title": "" }, { "docid": "3bd8fdfe3b42e9c557b1a80d380defa5", "score": "0.69759136", "text": "def new\n @ruku = Ruku.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ruku }\n end\n end", "title": "" }, { "docid": "0dcf3da24d721c399f3fffb71f54c60b", "score": "0.69743925", "text": "def new\n @siswa = Siswa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @siswa }\n end\n end", "title": "" }, { "docid": "2879ff713b8d11e43b5c240743508af5", "score": "0.69574887", "text": "def new\n @sujet = Sujet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sujet }\n end\n end", "title": "" }, { "docid": "2059796e8c29c760e7562a20908afe99", "score": "0.69447434", "text": "def new\n @usha = Usha.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @usha }\n end\n end", "title": "" }, { "docid": "284d05c662f4c351913f3503bab9ec7a", "score": "0.6931976", "text": "def create\n @newse = Newse.new(params[:newse])\n\n respond_to do |format|\n if @newse.save\n format.html { redirect_to newses_path, notice: t('newses.successfully_created') }\n format.json { render json: @newse, status: :created, location: @newse }\n else\n format.html { render action: \"new\" }\n format.json { render json: @newse.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "70764b1d7907cd4413a787947eb6dd28", "score": "0.6931509", "text": "def new\n @ulcer = Ulcer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ulcer }\n end\n end", "title": "" }, { "docid": "e676086c9c7fa6cba32d8205762e8705", "score": "0.692636", "text": "def new\n @sn = Sn.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sn }\n end\n end", "title": "" }, { "docid": "8e720517b2be41bb86455b0fe7aef14c", "score": "0.6912852", "text": "def new\n @unite = Unite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @unite }\n end\n end", "title": "" }, { "docid": "41dd5229908dce28526085b83eef60d6", "score": "0.6909747", "text": "def new\n @taluk = Taluk.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @taluk }\n end\n end", "title": "" }, { "docid": "be2d86b5cdc85303703834919b3cdbc3", "score": "0.6900759", "text": "def new\n @sucursal = Sucursal.new\n\n respond_to do |format|\n format.html # new.html.erb\n #format.json { render json: @sucursal }\n end\n end", "title": "" }, { "docid": "d2b1ea95d9b3ea67c3997ab11367f7c8", "score": "0.6892226", "text": "def new\n @tuanti = Tuanti.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tuanti }\n end\n end", "title": "" }, { "docid": "d89d88dcb488b2acf0e3af27a9893512", "score": "0.6872769", "text": "def new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: ''}\n end\n end", "title": "" }, { "docid": "e68003f1537c7a56c6c4e2b18ab62167", "score": "0.6863528", "text": "def new\n @surah = Surah.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @surah }\n end\n end", "title": "" }, { "docid": "0743fc6395d3dc5f23bdeeb3bc531088", "score": "0.684285", "text": "def new\n @secubat_model = SecubatModel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @secubat_model }\n end\n end", "title": "" }, { "docid": "b0dde4c9a0c5c1fcb9b8932106a3bc2b", "score": "0.6839764", "text": "def new\n @make = Make.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @make }\n end\n end", "title": "" }, { "docid": "bb5d9876281660e897eb7885b209608d", "score": "0.68384796", "text": "def new\n @syllabus = Syllabus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @syllabus }\n end\n end", "title": "" }, { "docid": "f610197fb7f8c7e0fae1e061a2f0a128", "score": "0.68369603", "text": "def new\n @nail = Nail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nail }\n end\n end", "title": "" }, { "docid": "b3e5ae2152702419e5f12aeca367b400", "score": "0.6835993", "text": "def new\n @universidad = Universidad.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @universidad }\n end\n end", "title": "" }, { "docid": "b3e5ae2152702419e5f12aeca367b400", "score": "0.6835993", "text": "def new\n @universidad = Universidad.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @universidad }\n end\n end", "title": "" }, { "docid": "b3e5ae2152702419e5f12aeca367b400", "score": "0.6835993", "text": "def new\n @universidad = Universidad.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @universidad }\n end\n end", "title": "" }, { "docid": "761c96a17419b0c19e8df10b273b8472", "score": "0.68301827", "text": "def new\n @sangano = Sangano.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sangano }\n end\n end", "title": "" }, { "docid": "249e434533f24b63179ba056bf3dd0be", "score": "0.682808", "text": "def new\n @statu = Statu.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @statu }\n end\n end", "title": "" }, { "docid": "fbb221e0dac1e7043946860433ac438e", "score": "0.6827734", "text": "def new\n @exist = Exist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @exist }\n end\n end", "title": "" }, { "docid": "89755a3b6c77cb991256787b29b66d3b", "score": "0.6823431", "text": "def create\n @uese = Uese.new(params[:uese])\n\n respond_to do |format|\n if @uese.save\n format.html { redirect_to @uese, notice: 'Uese was successfully created.' }\n format.json { render json: @uese, status: :created, location: @uese }\n else\n format.html { render action: \"new\" }\n format.json { render json: @uese.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7ef9716d0c86393ed8622d8ba1e18a35", "score": "0.68167794", "text": "def new\n @haiku = Haiku.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @haiku }\n end\n end", "title": "" }, { "docid": "88a8ea21b1898eef6e0d6500509f357e", "score": "0.6816326", "text": "def new\n @truong = Truong.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @truong }\n end\n end", "title": "" }, { "docid": "2587cb77c2fde678df8f278fd6452800", "score": "0.68063396", "text": "def new\n @sjt = Sjt.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sjt }\n end\n end", "title": "" }, { "docid": "60bfa13cfdd22649946c859c8079b9dd", "score": "0.6805732", "text": "def new\n @signup = Signup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @signup }\n end\n end", "title": "" }, { "docid": "6ab2016674211317953ef3df9ca8184f", "score": "0.6802262", "text": "def new\n @title = \"New sudoer\"\n @sudoer = Sudoer.new \n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sudoer }\n end\n end", "title": "" }, { "docid": "0aa0321c64792edded67493b5d7dcd62", "score": "0.6798552", "text": "def new\n @srsaavipaa = Srsaavipaa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @srsaavipaa }\n end\n end", "title": "" }, { "docid": "1e4f2be15cf1f47d12978210d3fd2ec3", "score": "0.6795376", "text": "def new\n @usstate = Usstate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @usstate }\n end\n end", "title": "" }, { "docid": "a11d0cec9be51c19e1706952080eb338", "score": "0.6793953", "text": "def new\n @uzytkownik = Uzytkownik.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @uzytkownik }\n end\n end", "title": "" }, { "docid": "f4d6e815ee45a3ea9da9ab81496da5d5", "score": "0.678974", "text": "def create\n @solicitud = Solicitud.new(params[:solicitud])\n\n respond_to do |format|\n if @solicitud.save\n format.html { redirect_to @solicitud, notice: 'Solicitud was successfully created.' }\n format.json { render json: @solicitud, status: :created, location: @solicitud }\n else\n format.html { render action: \"new\" }\n format.json { render json: @solicitud.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b81e3fe8873f2b7f057bfb55ebc3ba35", "score": "0.6785501", "text": "def new\n @shuoshuo = Shuoshuo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @shuoshuo }\n end\n end", "title": "" }, { "docid": "77dd799250730357783a025d7f4826c3", "score": "0.6781881", "text": "def new\n @toushikomon = Toushikomon.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @toushikomon }\n end\n end", "title": "" }, { "docid": "849777449cced5669430788c0cf8becf", "score": "0.67795837", "text": "def new\n @spl = Spl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @spl }\n end\n end", "title": "" }, { "docid": "206e9dc432b2abb335031447e77735cf", "score": "0.67788535", "text": "def new\n @toriaezu = Toriaezu.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @toriaezu }\n end\n end", "title": "" }, { "docid": "d43f688f68186bdcba32fd225b24862d", "score": "0.67757416", "text": "def new\n @statua = Statua.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @statua }\n end\n end", "title": "" }, { "docid": "a0bd9b1442a87f24e40c1059af3e36cd", "score": "0.6772248", "text": "def new\n @tuyen = Tuyen.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tuyen }\n end\n end", "title": "" }, { "docid": "a0bd9b1442a87f24e40c1059af3e36cd", "score": "0.6772248", "text": "def new\n @tuyen = Tuyen.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tuyen }\n end\n end", "title": "" }, { "docid": "a943f903b4efe467f6d8640bee4d994e", "score": "0.67708343", "text": "def new\n @sequent = Sequent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sequent }\n end\n end", "title": "" }, { "docid": "7f3c04dacab322403aec30293e578176", "score": "0.67703724", "text": "def new\n @db_usiasekolah = DbUsiasekolah.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @db_usiasekolah }\n end\n end", "title": "" }, { "docid": "300ae31550f2426dd0a7723bb9b1ca3c", "score": "0.67675614", "text": "def new\n @cuotum = Cuotum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cuotum }\n end\n end", "title": "" }, { "docid": "300ae31550f2426dd0a7723bb9b1ca3c", "score": "0.67675614", "text": "def new\n @cuotum = Cuotum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cuotum }\n end\n end", "title": "" }, { "docid": "f2733396bcce3db7d474737042650273", "score": "0.6767506", "text": "def new\n @sake = Sake.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sake }\n end\n end", "title": "" }, { "docid": "a0788c16c833d75df4ca8171338b16a7", "score": "0.67641604", "text": "def new\n @puntaje = Puntaje.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @puntaje }\n end\n end", "title": "" }, { "docid": "5ea6777e2e5f88f2ec27715a3f5161d6", "score": "0.6764035", "text": "def new\n @ubicacion = Ubicacion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ubicacion }\n end\n end", "title": "" }, { "docid": "f86a13a7b0bceb92cf3034e0180bf254", "score": "0.67624915", "text": "def new\n @termo_uso = TermoUso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @termo_uso }\n end\n end", "title": "" }, { "docid": "16a6086e1a8d26d4ec0348c84c331eaa", "score": "0.6760442", "text": "def new\n @studinfo = Studinfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @studinfo }\n end\n end", "title": "" }, { "docid": "63eeec5d0c30e43881ce74f60c552753", "score": "0.67564833", "text": "def new\n @signup = Signup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @signup }\n end\n end", "title": "" }, { "docid": "63eeec5d0c30e43881ce74f60c552753", "score": "0.67564833", "text": "def new\n @signup = Signup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @signup }\n end\n end", "title": "" }, { "docid": "2708e1fe8a5a4f39b6e4b15432d61e1c", "score": "0.6751598", "text": "def new\n @policial = Policial.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @policial }\n end\n end", "title": "" }, { "docid": "e8e2630b93a4aadcd553ca295e40808e", "score": "0.67474395", "text": "def new\n @singer = Singer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @singer }\n end\n end", "title": "" }, { "docid": "55aad9d04b138bc19dda6fbd57adde8b", "score": "0.6742704", "text": "def new\n @pasien = Pasien.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pasien }\n end\n end", "title": "" }, { "docid": "75e0f3f9b25e543932187e4377f692c1", "score": "0.67393047", "text": "def new\n @newtest = Newtest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @newtest }\n end\n end", "title": "" }, { "docid": "ec730ffd3d89cb067f41792d4b903de5", "score": "0.6733976", "text": "def new\n @utype = Utype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @utype }\n end\n end", "title": "" }, { "docid": "44295962ff94c3c9e0096c57ec2b3176", "score": "0.6733489", "text": "def new\n @punt = Punt.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @punt }\n end\n end", "title": "" }, { "docid": "e91ca944465e3093f78e3b502c6848d1", "score": "0.67294127", "text": "def new\n @suscription = Suscription.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @suscription }\n end\n end", "title": "" }, { "docid": "102b1c5dd4a14d40d38db901eba06ff7", "score": "0.6726255", "text": "def new\n @shain = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @shain }\n end\n end", "title": "" }, { "docid": "8df5a702cf3a52b07cd2b13a00f0cf8b", "score": "0.6725369", "text": "def new\n @sobre = Sobre.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sobre }\n end\n end", "title": "" }, { "docid": "8156c591e921d3416fc4c14e6903e66e", "score": "0.6725153", "text": "def new\n @testudo = Testudo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @testudo }\n end\n end", "title": "" }, { "docid": "26e6752b7647f03139812e82d6403fb9", "score": "0.67129284", "text": "def new\n @unit = Unit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @unit }\n end\n end", "title": "" }, { "docid": "26e6752b7647f03139812e82d6403fb9", "score": "0.67129284", "text": "def new\n @unit = Unit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @unit }\n end\n end", "title": "" }, { "docid": "26e6752b7647f03139812e82d6403fb9", "score": "0.67129284", "text": "def new\n @unit = Unit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @unit }\n end\n end", "title": "" }, { "docid": "26e6752b7647f03139812e82d6403fb9", "score": "0.67129284", "text": "def new\n @unit = Unit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @unit }\n end\n end", "title": "" }, { "docid": "7c2eedab75c23b270980c16c33c0c704", "score": "0.671149", "text": "def new\n @dummy = Dummy.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dummy }\n end\n end", "title": "" }, { "docid": "447d6c697bdcbbd6caff935bf37098c9", "score": "0.6710836", "text": "def new\n @stiker = Stiker.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stiker }\n end\n end", "title": "" }, { "docid": "580ac9b93c2d04c6c5e083a4b89ea00e", "score": "0.670706", "text": "def new\n @hasini = Hasini.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @hasini }\n end\n end", "title": "" }, { "docid": "646d157546f39adde04d6cf3ae59e7c1", "score": "0.6705806", "text": "def new\n @stake = Stake.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stake }\n end\n end", "title": "" }, { "docid": "92008bad042579793da1bda239d95223", "score": "0.67017937", "text": "def create\n api.post('', nil, 'application/json')\n end", "title": "" }, { "docid": "23443d842bd622d29c4bc5c1eb53f699", "score": "0.669362", "text": "def new\n @puesto = Puesto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @puesto }\n end\n end", "title": "" }, { "docid": "b92eee561d08f20f58fe201c33ae4072", "score": "0.6693009", "text": "def create\n @newsville = Newsville.new(newsville_params)\n\n respond_to do |format|\n if @newsville.save\n format.html { redirect_to @newsville, notice: 'Newsville was successfully created.' }\n format.json { render :show, status: :created, location: @newsville }\n else\n format.html { render :new }\n format.json { render json: @newsville.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "70661f46203c0155bd8b673fada16569", "score": "0.6689817", "text": "def new\n @osignup = Osignup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @osignup }\n end\n end", "title": "" }, { "docid": "0a3cfa13d0314d60961f34a206a69bc7", "score": "0.6689094", "text": "def new\n @make = Make.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @make }\n end\n end", "title": "" }, { "docid": "d2154dd77ae431ccbef348815c21b18c", "score": "0.668875", "text": "def new\n @sanatorium = Sanatorium.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sanatorium }\n end\n end", "title": "" }, { "docid": "2285ac07e7478f427ca225bb708a9992", "score": "0.66883016", "text": "def new\n @unita = Unita.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @unita }\n end\n end", "title": "" }, { "docid": "d74879ebe08f43826b14d73880433ea8", "score": "0.6687007", "text": "def new\n @userss = Userss.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @userss }\n end\n end", "title": "" }, { "docid": "3d687a48cfad748f795e2ad8b2c0caac", "score": "0.6684316", "text": "def new\n @seccion = Seccion.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @seccion }\n end\n end", "title": "" }, { "docid": "d6508a29399c209698698bdea9e63a96", "score": "0.66811186", "text": "def new\n @uni_class = UniClass.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @uni_class }\n end\n end", "title": "" }, { "docid": "70f6b3855e1d738ba13320e6546a90a7", "score": "0.66810244", "text": "def new\n @musica = Musica.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @musica }\n end\n end", "title": "" }, { "docid": "d6f11ba32efe47254c450d1caec4e8b2", "score": "0.6677654", "text": "def create\n @sangue = Sangue.new(sangue_params)\n\n respond_to do |format|\n if @sangue.save\n format.html { redirect_to @sangue, notice: 'Sangue was successfully created.' }\n format.json { render :show, status: :created, location: @sangue }\n else\n format.html { render :new }\n format.json { render json: @sangue.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "15962dd7b7e5c5d87e45dfdc1875af8e", "score": "0.66776377", "text": "def new\n @plantstype = Plantstype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @plantstype }\n end\n end", "title": "" }, { "docid": "1fe7a0eb754b891d211533173d6ae2a7", "score": "0.6677526", "text": "def new\n\t\n\t\t\n\t\trender json: {}\n\tend", "title": "" }, { "docid": "e20897997e54c6af1b5684405896f0b2", "score": "0.66767174", "text": "def new\n @sorvete = Sorvete.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sorvete }\n end\n end", "title": "" } ]
e92f285de81e471d5c569a537b0f30c7
GET /zip_msas GET /zip_msas.json
[ { "docid": "8340f101da086eab65b6f00a0fb66b07", "score": "0.76392174", "text": "def index\n @zip_msas = ZipMsa.all\n end", "title": "" } ]
[ { "docid": "0e4e3f16fe188beb8eec2ab8b48af7a1", "score": "0.64158803", "text": "def set_zip_msa\n @zip_msa = ZipMsa.find(params[:id])\n end", "title": "" }, { "docid": "0d666a98210ba5ffb3288a2288ce6e85", "score": "0.6359716", "text": "def show\n @zip = Zip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @zip }\n end\n end", "title": "" }, { "docid": "72c2823446c3d3fdcfeed528196aefb4", "score": "0.61899847", "text": "def zips\n response = HTTParty.get(\"https://www.zipcodeapi.com/rest/#{ENV['API_KEY']}/radius.json/#{params[:zip]}/20/mile\")\n # byebug\n response['zip_codes'].map {|e| e['zip_code']}\n end", "title": "" }, { "docid": "7a88ce0590695dcdbbe28b6a0b1801fd", "score": "0.6159823", "text": "def get_response(params)\r\n zip = params[:zip_code]\r\n zip = params[:zip_code].present? ? params[:zip_code] : 43659\r\n url = \"https://mdms.owenscorning.com/api/v1/product/shingles?zip=#{zip}\"\r\n uri = URI(url)\r\n response = Net::HTTP.get(uri)\r\n return JSON.parse(response)\r\n end", "title": "" }, { "docid": "b7460e2b58e116cd5bfb343eb541950c", "score": "0.60899657", "text": "def create\n @zip_msa = ZipMsa.new(zip_msa_params)\n\n respond_to do |format|\n if @zip_msa.save\n format.html { redirect_to @zip_msa, notice: 'Zip msa was successfully created.' }\n format.json { render :show, status: :created, location: @zip_msa }\n else\n format.html { render :new }\n format.json { render json: @zip_msa.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c825abc57b97976c219c4ccef8c0317a", "score": "0.60288656", "text": "def zipcodes\n response_from_redis_or_service(:zipcodes)\n end", "title": "" }, { "docid": "960c79e715736e15963caff551893c0f", "score": "0.59316796", "text": "def destroy\n @zip_msa.destroy\n respond_to do |format|\n format.html { redirect_to zip_msas_url, notice: 'Zip msa was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2bb0d7b191d3f64cce9104f66d4fad11", "score": "0.58101124", "text": "def parse_smzip(path)\n unpack_smzip path\n @fs_data.each do |name, contents|\n if /\\.sm$/ =~ name\n parse_sm contents, File.dirname(name)\n end\n end\n end", "title": "" }, { "docid": "3b3a5d27af57fcf16b18f62479d16aa5", "score": "0.57923156", "text": "def show\n @sms_archive = SmsArchive.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sms_archive }\n end\n end", "title": "" }, { "docid": "0fe664e7638a0256dec8df7ac20a5296", "score": "0.5708048", "text": "def index\n @ziploads = Zipload.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ziploads }\n end\n end", "title": "" }, { "docid": "add292bd71a0cdb3be3731963bdf8301", "score": "0.5707905", "text": "def zip\n unless locations.empty?\n locations.first.zip\n else\n '80202'\n end\n end", "title": "" }, { "docid": "9238c52be052d6cf156c8b5733044d33", "score": "0.56784344", "text": "def metadata(zip_code)\n uri = URI(BASE_URI + zip_code)\n JSON.parse Net::HTTP.get(uri)\n end", "title": "" }, { "docid": "7cdde6f4cd99dca99acf65c37a6975c7", "score": "0.56167585", "text": "def containing_zip zip\n\t\t\tok, body = get('/containing/zip', zip: zip)\n\t\t\tok && body\n\t\tend", "title": "" }, { "docid": "a9fd2b29415a935c5dbcf5d668a531df", "score": "0.5603344", "text": "def new\n @zip = Zip.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @zip }\n end\n end", "title": "" }, { "docid": "f02d3ef8c64defc1f2e21db9d6c8e886", "score": "0.55791736", "text": "def grab_the_zips()\n\n url = \"http://feed.omgili.com/5Rh5AMTrc4Pv/mainstream/posts/\"\n Dir.mkdir(\"files/\") unless File.exists?(\"files/\")\n http = Curl.get(url)\n zip_strings = http.body_str.scan(/([0-9]+.zip)+/)\n formatted_strings = zip_strings.flatten.map {|item| \"#{url}#{item}\"}\n download_the_zips(formatted_strings, zip_strings)\nend", "title": "" }, { "docid": "c68cabb69cb6e6e229980fb43b65535f", "score": "0.55484784", "text": "def zip\n if addresses.first\n addresses.first.fetch('zip', '')\n end\n end", "title": "" }, { "docid": "33379a46d9277410e27e007f3f4f092b", "score": "0.55316895", "text": "def index\n @admins_zips = Admins::Zip.all\n end", "title": "" }, { "docid": "3af4b9acdb01fa0d89aa7a90d81f6907", "score": "0.55297387", "text": "def get_details_archive\n ensure_client && ensure_uri\n response = @client.rest_get(\"#{BASE_URI}/archive/#{data['uri'].split('/').last}\")\n @client.response_handler(response)\n end", "title": "" }, { "docid": "6a93e88fdf94b5cc0ae0d1e1fdf40ded", "score": "0.5525008", "text": "def create\n @admins_zip = Admins::Zip.new(admins_zip_params)\n\n respond_to do |format|\n if @admins_zip.save\n format.html { redirect_to @admins_zip, notice: 'Zip was successfully created.' }\n format.json { render :show, status: :created, location: @admins_zip }\n else\n format.html { render :new }\n format.json { render json: @admins_zip.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a96d5fc3ba614eaabca00aa4620ed92a", "score": "0.55078906", "text": "def show\n \n @zip_code = ZipCode.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @zip_code }\n end\n end", "title": "" }, { "docid": "8795b5bbe387465b141247312739ec44", "score": "0.54976517", "text": "def update\n respond_to do |format|\n if @zip_msa.update(zip_msa_params)\n format.html { redirect_to @zip_msa, notice: 'Zip msa was successfully updated.' }\n format.json { render :show, status: :ok, location: @zip_msa }\n else\n format.html { render :edit }\n format.json { render json: @zip_msa.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e00f3720a750d175ebb8ae7a68d63c9f", "score": "0.5495982", "text": "def nearby_zip zip, radius, units = 'mile'\n\t\t\tunless Units.include?(units)\n\t\t\t\traise ArgumentError, \"Invalid unit #{units}. Must be one \"\\\n\t\t\t\t\t\"of #{Units.to_a.join(', ')}.\"\n\t\t\tend\n\t\t\tok, body = get('/nearby/zip',\n\t\t\t\tzip: zip, radius: radius, units: units)\n\t\t\tok && body['zips']\n\t\tend", "title": "" }, { "docid": "7fbe855047da63df795601a8fc18b8ea", "score": "0.54924333", "text": "def create\n @zip = Zip.new(zip_params)\n\n respond_to do |format|\n if @zip.save\n format.html { redirect_to @zip, notice: 'Zip was successfully created.' }\n format.json { render :show, status: :created, location: @zip }\n else\n format.html { render :new }\n format.json { render json: @zip.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8004b18d64da9576ca5a1ab14c4bdc35", "score": "0.54865813", "text": "def show\n @promotion_zip = PromotionZip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @promotion_zip }\n end\n end", "title": "" }, { "docid": "192b3cd1847528f2acd6509fe9666f87", "score": "0.5477324", "text": "def create\n @zip = Zip.new(params[:zip])\n\n respond_to do |format|\n if @zip.save\n format.html { redirect_to @zip, notice: 'Zip was successfully created.' }\n format.json { render json: @zip, status: :created, location: @zip }\n else\n format.html { render action: \"new\" }\n format.json { render json: @zip.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3f75a8e56158e986cd205a6f1452920e", "score": "0.54703003", "text": "def show\n @zip_loc = ZipLoc.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @zip_loc }\n end\n end", "title": "" }, { "docid": "2d39124ea298aac4a148cb4d4f73977b", "score": "0.5467919", "text": "def zip\n \"zip=#{@filter[:zip]}\"\n end", "title": "" }, { "docid": "5ae0e014ab043f4ca447375028601003", "score": "0.5460078", "text": "def zip_link\n path = @workflow_run.zip_link\n if path\n redirect_to path\n else\n render(\n json: { status: \"Output not available\" },\n status: :not_found\n )\n end\n end", "title": "" }, { "docid": "221b6a937764000fbc3c25ba2b823955", "score": "0.5443057", "text": "def set_zip\n @zip = Zip.find(params[:id])\n end", "title": "" }, { "docid": "221b6a937764000fbc3c25ba2b823955", "score": "0.5443057", "text": "def set_zip\n @zip = Zip.find(params[:id])\n end", "title": "" }, { "docid": "0fba244263e174f2cd70e604bdccdba7", "score": "0.5436734", "text": "def show\n @zipcode = Zipcode.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @zipcode }\n end\n end", "title": "" }, { "docid": "8142fddf10577d390136bc2da755c9fe", "score": "0.5404342", "text": "def index\n @appzips = Appzip.all\n end", "title": "" }, { "docid": "8d06f3949ccc7640e4adfdb30389920b", "score": "0.5391733", "text": "def destroy\n @zip = Zip.find(params[:id])\n @zip.destroy\n\n respond_to do |format|\n format.html { redirect_to zips_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "50aafdb84f3842dc168c0dd4ba2f2cb6", "score": "0.53884244", "text": "def index\n @zipcodes = Zipcode.all\n end", "title": "" }, { "docid": "50aafdb84f3842dc168c0dd4ba2f2cb6", "score": "0.53884244", "text": "def index\n @zipcodes = Zipcode.all\n end", "title": "" }, { "docid": "50aafdb84f3842dc168c0dd4ba2f2cb6", "score": "0.53884244", "text": "def index\n @zipcodes = Zipcode.all\n end", "title": "" }, { "docid": "c2f230add0899ee71b2f7a1c3f1082dd", "score": "0.5385873", "text": "def index\n @zip_to_providers = ZipToProvider.all\n end", "title": "" }, { "docid": "111e8ef3a01e79ce47346b0b2301b7ab", "score": "0.53765434", "text": "def get_dispatch_zip_with_http_info(dispatch_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DispatchApi.get_dispatch_zip ...'\n end\n # verify the required parameter 'dispatch_id' is set\n if @api_client.config.client_side_validation && dispatch_id.nil?\n fail ArgumentError, \"Missing the required parameter 'dispatch_id' when calling DispatchApi.get_dispatch_zip\"\n end\n if @api_client.config.client_side_validation && opts[:'type'] && !['SCORM12'].include?(opts[:'type'])\n fail ArgumentError, 'invalid value for \"type\", must be one of SCORM12'\n end\n # resource path\n local_var_path = '/dispatch/dispatches/{dispatchId}/zip'.sub('{' + 'dispatchId' + '}', dispatch_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?\n query_params[:'cssUrl'] = opts[:'css_url'] if !opts[:'css_url'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/zip'])\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 = ['APP_NORMAL', 'OAUTH']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'File')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DispatchApi#get_dispatch_zip\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "212bd8f1530bba3cdedf89ef1b8e48fe", "score": "0.53744864", "text": "def zip_path\n \"/tmp/play-zips/#{zip_name}\"\n end", "title": "" }, { "docid": "960f845d03a8dd36fd088e1307a60323", "score": "0.53653926", "text": "def get_coordinates( zip )\n result = HTTParty::get( ZIP_LOOKUP_URL, :query => { :q => zip, :flags => \"j\" })\n # must be a cleaner way to do this\n result.first[1][\"Results\"][0]\n end", "title": "" }, { "docid": "1538ef844cd01e792abe6211c24af37b", "score": "0.5359584", "text": "def list\n self.class.list(@zip_file)\n end", "title": "" }, { "docid": "2988f84aa25a10a831db6ddd3eaa2f8d", "score": "0.532333", "text": "def show\n @lesson = Lesson.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lesson }\n format.zip\n end\n end", "title": "" }, { "docid": "451c8551d83b47e3b346af4203ed2a05", "score": "0.53182673", "text": "def index\n @zip_codes = ZipCode.all\n end", "title": "" }, { "docid": "bd0a3f42bd9da1562a03dfd0a1dd21be", "score": "0.5315476", "text": "def zip_path\n \"/tmp/play-zips/#{zip_name}\"\n end", "title": "" }, { "docid": "bd0a3f42bd9da1562a03dfd0a1dd21be", "score": "0.5315476", "text": "def zip_path\n \"/tmp/play-zips/#{zip_name}\"\n end", "title": "" }, { "docid": "f3281afb0690edb2ab69f43f97962385", "score": "0.5315456", "text": "def show\n @breadcrumb = 'read'\n @zipcode = Zipcode.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @zipcode }\n end\n end", "title": "" }, { "docid": "d4b053c5849333239ce8568b8a02a7f1", "score": "0.5315193", "text": "def index\n @unzips = Unzip.all\n end", "title": "" }, { "docid": "460885c30e42ac010f1e04e97886c87f", "score": "0.53051627", "text": "def zipfile; end", "title": "" }, { "docid": "0dd4e76255c2fa33a3c3c50cc1e20608", "score": "0.53017193", "text": "def show\n redirect_to :action => \"index\"\n # @zipcode = Zipcode.find(params[:id])\n\n # respond_to do |format|\n # format.html # show.html.erb\n # format.json { render json: @zipcode }\n # end\n end", "title": "" }, { "docid": "169360563222a5a073ff00457bbdb798", "score": "0.5281421", "text": "def logs_zip\n res_name = 'logs.zip'\n endpoint = \"projects/#{@project_id}/runs/#{id}/logs.zip\"\n\n @client.get_file(endpoint, res_name)\n end", "title": "" }, { "docid": "4203af5a3ff260784b04db818e899110", "score": "0.5276088", "text": "def index\n #@zips = Zip.all\n\n args = params.as_json.clone\n args[:sort]=get_sort_hash(args[:sort])\n @zips = Zip.paginate(args)\n end", "title": "" }, { "docid": "48e5869d6c211acb9df91b6c96d3a30d", "score": "0.52691585", "text": "def download_analysis_zip\n @analysis = Analysis.find(params[:id])\n\n unless @analysis.seed_zip.nil?\n send_data File.open(@analysis.seed_zip.path, 'rb').read, filename: 'analysis.zip', type: @analysis.seed_zip.content_type, disposition: 'attachment'\n end\n end", "title": "" }, { "docid": "9684771a0650a829972c459d4bc1f04b", "score": "0.52507424", "text": "def show\n @zipload = Zipload.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @zipload }\n end\n end", "title": "" }, { "docid": "ded5a4eaa55936ee21c240135d0aafff", "score": "0.5244149", "text": "def multi_zipcodes_location_info(zip_codes, options = {})\n\t\toptions = {} unless options.is_a? Hash\n\t\tunit, format = Locator.init(options[:unit], options[:format])\n\t\tzip_codes = [zip_codes].flatten.join(',')\n\t\turl = \"http://www.zipcodeapi.com/rest/#{@api_key}/multi-info.#{format}/#{zip_codes}/#{unit}\"\n\t\tresponse = Locator.get_response(url, format)\n\tend", "title": "" }, { "docid": "fa45ecac1856860bdcb5c5062e086311", "score": "0.523557", "text": "def fifty_miles_from_zip(zip_code)\n uri = URI(\"https://www.riteaid.com/services/ext/v2/stores/getStores?address=#{zip_code}&attrFilter=PREF-112&fetchMechanismVersion=2&radius=50\")\n\n # Create client\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_PEER\n\n # Create Request\n req = Net::HTTP::Get.new(uri)\n # Add headers\n req.add_field \"User-Agent\", \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:87.0) Gecko/20100101 Firefox/87.0\"\n # Add headers\n req.add_field \"Accept\", \"*/*\"\n # Add headers\n req.add_field \"Accept-Language\", \"en-US,en;q=0.5\"\n # Add headers\n req.add_field \"Accept-Encoding\", \"gzip\"\n # Add headers\n req.add_field \"X-Requested-With\", \"XMLHttpRequest\"\n # Add headers\n req.add_field \"Connection\", \"keep-alive\"\n # Add headers\n req.add_field \"Referer\", \"https://www.riteaid.com/pharmacy/apt-scheduler\"\n # Add headers\n req.add_field \"Cookie\", \"AMCV_3B2A35975CF1D9620A495FA9%40AdobeOrg=77933605%7CMCIDTS%7C18722%7CMCMID%7C63001271026252849621839870043326006138%7CMCAAMLH-1618173036%7C9%7CMCAAMB-1618173036%7C6G1ynYcLPuiQxYZrsz_pkqfLG9yMXBpb2zX5dvJdYQJzPXImdj0y%7CMCOPTOUT-1617575436s%7CNONE%7CMCSYNCSOP%7C411-18727%7CvVersion%7C4.5.1; check=true; mbox=PC#3250fdc64b8142cd8c4e804483805172.35_0#1680573602|session#7ff71dc40a9444098109c0a301546c00#1617570130; AMCVS_3B2A35975CF1D9620A495FA9%40AdobeOrg=1; __rutma=149436981-nz-hn-4s-1p-jn2g61gks3sk9k9abih9-1617328801587.1617328801587.1617568236129.2.3.2; __rpckx=0!eyJ0NyI6eyIzIjoxNjE3NTY4MjY5MjgxfSwidDd2Ijp7IjMiOjE2MTc1Njg1NjkzMDh9LCJpdGltZSI6IjIwMjEwNDA0LjIwMzAifQ~~; __ruid=149436981-nz-hn-4s-1p-jn2g61gks3sk9k9abih9-1617328801587; __rcmp=0!bj1fZ2MsZj1nYyxzPTAsYz0xNDgsdHI9MCxybj02MDAsdHM9MjAyMTA0MDIuMDIwMCxkPXBj; _gcl_au=1.1.1488707025.1617328802; _ga=GA1.2.271718044.1617328802; s_cc=true; _mibhv=anon-1617328802186-4160420714_7189; _scid=a53bb560-bc12-4555-b7c9-730060d3f81b; adcloud={%22_les_v%22:%22y%2Criteaid.com%2C1617570069%22}; _derived_epik=dj0yJnU9ckR2VDBCWmhsTTh1c1B6bHRfcW5ncWtCZzBlSVQtX2Imbj16aVdFUlVTeU5KWm1vbjI5Zll1MmRnJm09MSZ0PUFBQUFBR0JxSWc0JnJtPTEmcnQ9QUFBQUFHQnFJZzQ; _pin_unauth=dWlkPU9EaGxZbU5rWWpFdFlqWm1aaTAwWXpZeUxXSXdPR1F0WmpOaU5qWTRZV0UyTURFdw; _fbp=fb.1.1617328802947.436957664; _sctr=1|1617260400000; s_plt=0.91; s_pltp=web%3Apharmacy%3Aapt-scheduler; __rutmb=149436981; __rpck=0!eyJwcm8iOiJkaXJlY3QiLCJDIjp7fSwiTiI6e319; _gid=GA1.2.2014667105.1617568236; gpv_Page=web%3Apharmacy%3Aapt-scheduler; s_sq=rtaidglobalproduction%3D%2526c.%2526a.%2526activitymap.%2526page%253Dweb%25253Apharmacy%25253Aapt-scheduler%2526link%253DNext%2526region%253Dskip-content%2526pageIDType%253D1%2526.activitymap%2526.a%2526.c%2526pid%253Dweb%25253Apharmacy%25253Aapt-scheduler%2526pidt%253D1%2526oid%253DNext%2526oidt%253D3%2526ot%253DSUBMIT; _gali=covid-store-search; _gat_UA-1427291-1=1\"\n # Add headers\n req.add_field \"Pragma\", \"no-cache\"\n # Add headers\n req.add_field \"Cache-Control\", \"no-cache\"\n # Add headers\n req.add_field \"Te\", \"Trailers\"\n\n # Fetch Request\n res = http.request(req)\n JSON.parse(res.body)\nrescue StandardError => e\n puts \"HTTP Request failed (#{e.message})\"\nend", "title": "" }, { "docid": "09b80b413cf2fd42c4f6e5a3e254a340", "score": "0.5235088", "text": "def get_message_store_report_archive(taskId)\n puts \"Getting report uri ...\"\n begin\n endpoint = \"/restapi/v1.0/account/~/message-store-report/\"+ taskId +\"/archive\"\n resp = $platform.get(endpoint)\n length = resp.body['records'].length\n dateLog = Time.now.strftime(\"%Y_%m_%d_%H_%M\")\n for i in (0...length)\n\t fileName = \"message_store_\" + dateLog + \"_\" + i.to_s + \".zip\"\n\t get_message_store_report_archive_content(resp.body['records'][i]['uri'], fileName)\n end\n rescue StandardError => e\n puts (e)\n end\nend", "title": "" }, { "docid": "7a4358abd11c631ded43cd8d0c1c1142", "score": "0.52107114", "text": "def zip_file\n Base64.decode64(result.zip_file)\n end", "title": "" }, { "docid": "4d010454bff98de34face79d4392bbb3", "score": "0.52006966", "text": "def new\n @sms_archive = SmsArchive.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sms_archive }\n end\n end", "title": "" }, { "docid": "a6b7cb4fa1a421db9fd119c2ec98cfea", "score": "0.518737", "text": "def set_appzip\n @appzip = Appzip.find(params[:id])\n end", "title": "" }, { "docid": "7e62e2888309f7b04239434046ddf70e", "score": "0.5183596", "text": "def all_files\n respond_to do |format|\n format.zip do\n collection_ids = [@collection.id] + @collection.all_child_ids\n item_ids = policy_scope(Item.search.filter(Item::IndexFields::COLLECTIONS, collection_ids),\n policy_scope_class: ItemPolicy::Scope).to_id_a\n if item_ids.any?\n download = Download.create!(institution: @collection.institution,\n ip_address: request.remote_ip)\n ZipItemsJob.perform_later(item_ids: item_ids,\n download: download,\n user: current_user)\n redirect_to download_url(download)\n else\n head :no_content\n end\n end\n end\n end", "title": "" }, { "docid": "558174a92c8b87a19dfa78a5152ec5cc", "score": "0.5177735", "text": "def create_zipped_moab_versions!\n params = (1..version).map do |v|\n ZipEndpoint.which_need_archive_copy(preserved_object.druid, v).map { |zep| { version: v, zip_endpoint: zep } }\n end.flatten.compact.uniq\n zipped_moab_versions.create!(params)\n end", "title": "" }, { "docid": "9d2199c86947029dfb36f8310ee9cb19", "score": "0.5165889", "text": "def search_by_zip(page, zip)\n\t\tpage.form_with(:action => '/cgi-bin/findweather/getForecast') do |search|\n\t\t\tsearch.query = zip\n\t\tend.submit\n\tend", "title": "" }, { "docid": "5b5678ebd4f83d7994d3e4b8124c1dcd", "score": "0.51639247", "text": "def destroy\n @zip.destroy\n respond_to do |format|\n format.html { redirect_to zips_url, notice: 'Zip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9716cc86d9818fb5d026818aefbde8bd", "score": "0.515323", "text": "def zip_params\n params.require(:zip).permit(:zip)\n end", "title": "" }, { "docid": "9d94c71485347bfb147c3154ab4493e9", "score": "0.51512384", "text": "def get_zip()\r\n\t\t\t# Option 1: use zip code supplied in the request params\r\n\t\t\tif params[:zip_code]\r\n\t\t\t\treturn params[:zip_code]\r\n\t\t\tend\r\n\r\n\t\t\t# Option 2: use zip code in the logged-in user's settings\r\n\t\t\tif logged_in? && current_user.zip_code.length > 0\r\n\t\t\t\treturn current_user.zip_code\r\n\t\t\tend\r\n\r\n\t\t\t# Option 3: use zip code that was previously detected and stored in session storage\r\n\t\t\tif session[:detected_zip_code]\r\n\t\t\t\treturn session[:detected_zip_code]\r\n\t\t\tend\r\n\r\n\t\t\t# Option 4: detect zip code using Geocoder gem's IP lookup service\r\n\t\t\t# But this only works in production because it needs the request to come from a real IP address.\r\n\t\t\tif Rails.env.production?\r\n\t\t\t\tputs \"Detecting zip code.\"\r\n\t\t\t\t# The location method can sometimes fail because of timeout so put it in this\r\n\t\t\t\tbegin\r\n\t\t\t\t\t# request.location is a method that Geocoder added\r\n\t\t\t\t\tzip = request.location.postal_code\r\n\t\t\t\t\tputs \"Detected Zip: #{zip}\"\r\n\r\n\t\t\t\t\t# This isn't guaranteed to return a valid zip so we must check it\r\n\t\t\t\t\tif zip != nil && zip.length > 0\r\n\t\t\t\t\t\t# Store detected zip code in session storage so it doesn't\r\n\t\t\t\t\t\t# have to be detected for each morsel API call.\r\n\t\t\t\t\t\tsession[:detected_zip_code] = zip\r\n\t\t\t\t\t\treturn zip\r\n\t\t\t\t\tend\r\n\t\t\t\trescue\r\n\t\t\t\t\tputs \"Zip code could not be detected.\"\r\n\t\t\t\tend\r\n\t\t\tend\r\n\r\n\t\t\t# Option 5: if zip could not be detected then the last resort is to use 90210 as default.\r\n\t\t\treturn \"90210\"\r\n\t\tend", "title": "" }, { "docid": "6dc538341bddac25e5421f1477bff584", "score": "0.5148317", "text": "def download\n selected_photos = JSON.parse params[:selected_photos]\n\n zipfile_name = params[:zip_filename] || DEFAULT_ZIPFILE_NAME\n\n paparazzo = PhotoFetcher.new(photo_ids: selected_photos, size: :full)\n archie = Archivist.new(PhotoFetcher::FILESTREAM_WRITER)\n\n archie.zipping(paparazzo.filenames, zipfile_name) do |filename, zipfile|\n send_data(zipfile, :type => 'application/zip', :filename => filename)\n end\n end", "title": "" }, { "docid": "c38d2ef88404c481a92413ec48709e57", "score": "0.5141772", "text": "def get_destination_dispatch_zip_with_http_info(destination_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DispatchApi.get_destination_dispatch_zip ...'\n end\n # verify the required parameter 'destination_id' is set\n if @api_client.config.client_side_validation && destination_id.nil?\n fail ArgumentError, \"Missing the required parameter 'destination_id' when calling DispatchApi.get_destination_dispatch_zip\"\n end\n if @api_client.config.client_side_validation && opts[:'type'] && !['SCORM12'].include?(opts[:'type'])\n fail ArgumentError, 'invalid value for \"type\", must be one of SCORM12'\n end\n # resource path\n local_var_path = '/dispatch/destinations/{destinationId}/dispatches/zip'.sub('{' + 'destinationId' + '}', destination_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?\n query_params[:'cssUrl'] = opts[:'css_url'] if !opts[:'css_url'].nil?\n query_params[:'tags'] = @api_client.build_collection_param(opts[:'tags'], :csv) if !opts[:'tags'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/zip'])\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 = ['APP_NORMAL', 'OAUTH']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'File')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DispatchApi#get_destination_dispatch_zip\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "b8ed7da9277a8bf1140f00fdc2801268", "score": "0.51085895", "text": "def show\n @album = Album.find_by_slug(params[:id])\n @images = @album.images.order(:subject_file_name).page(params[:page]).per(12)\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @album }\n format.zip do\n send_file @album.to_zip.path,\n :type => \"application/zip\",\n :filename => \"#{@album.name}.zip\"\n end\n end\n end", "title": "" }, { "docid": "0fb8fada0352d8901167d477ba0a76f7", "score": "0.5105308", "text": "def zip_msa_params\n params.require(:zip_msa).permit(:zip_code, :state_abbreviation, :msa_number, :gpci_one, :gpci_two, :gpci_three, :county_number, :msa_name, :zip_population, :msa_population)\n end", "title": "" }, { "docid": "f17f59d6303c1cf993e50a1880168017", "score": "0.5096809", "text": "def get_contents_from_zip zip_file\n contents = {}\n Zip::File.open(zip_file) do |zip|\n zip.each_entry do |entry|\n entry.get_input_stream do |entryfile|\n contents[entry.name] = entryfile.read\n end\n end\n end\n return contents\n end", "title": "" }, { "docid": "81f7f6e2da22f6fac3c19fe43a5196b2", "score": "0.508029", "text": "def zip_url\n\t\tURI::parse ipa_url.to_s.gsub(/\\.ipa$/, '.zip')\n\tend", "title": "" }, { "docid": "c77381701fbd3de315871b2c4ce3d7f5", "score": "0.5069574", "text": "def zip\n @zip ||= retrieve_contact_field(:zip)\n end", "title": "" }, { "docid": "4605e8e0047c030c771a42121ec89c4f", "score": "0.50662243", "text": "def send_zipped_content\n files_array = []\n @file_list.each_with_index do |file, index|\n params[:id] = file[:id] # so file_url returns correct value\n @solr_document = file\n @attachments = JSON.parse(@solr_document[:attachments_ss])\n files_array << [file_url, \"#{(index + 1)}_#{file_name_with_extension}\"]\n end\n file_mappings = files_array.lazy.map { |url, path| [open(url), path] }\n zipline(file_mappings, \"#{file_name}.zip\")\n end", "title": "" }, { "docid": "1fcf47a081188de403f3c6e6fc3d435b", "score": "0.50645506", "text": "def zip_download\r\n add_one_to_counter('zip')\r\n download_zip_file if request.post?\r\n end", "title": "" }, { "docid": "bde58a607e7edb8e9d2a749af1399714", "score": "0.50631166", "text": "def show\n respond_to do |format|\n format.html { render :show }\n format.json { render :show }\n format.zip do\n if current_user.email.blank? and params[:email].blank?\n flash[:error] = 'Email required to zip images'\n else\n unless params[:email].blank? or current_user.email == params[:email]\n current_user.email = params[:email]\n current_user.save\n end\n\n @album.zip_images_for(current_user)\n\n flash[:success] = \"Your images will be emailed to you soon\"\n end\n\n redirect_to [@event, @album]\n end\n end\n end", "title": "" }, { "docid": "12d9f3265dc784a3ffeec7b52148a0a9", "score": "0.5061993", "text": "def z\n process_command_line preset_command: 'zip'\n end", "title": "" }, { "docid": "c483ade55acb1ecb1adaafcbd9878a40", "score": "0.50612813", "text": "def zip\n version = self.version\n zip_file = \"#{@current_branch}_#{version}_#{@random_id}.zip\"\n minifier = Minifier.new\n minifier.minify_js(\"#{@local_url}/js\")\n minifier.minify_css(\"#{@local_url}/css\")\n transifex = Transifex.new(\"#{@local_url}/languages/\")\n transifex.translate\n # Create new zip.\n if system \"cd #{Dir.pwd}/tmp/ && zip -r #{@@packages_path}/#{zip_file} #{@random_id}\"\n return zip_file\n end\n end", "title": "" }, { "docid": "5ce616a54a1e5bafa4566cb6282cc60a", "score": "0.5057609", "text": "def new\n @serviced_zip = ServicedZip.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @serviced_zip }\n format.js { render :action => \"new.html.erb\", :layout => false }\n end\n end", "title": "" }, { "docid": "17dae28ac63fe20705319f9c55f4a8f3", "score": "0.5057352", "text": "def zip_download(env)\n body = ZipDeferrableBody.new(env, json_data)\n end", "title": "" }, { "docid": "7851706997a5a4e420db5a5bd6866dd6", "score": "0.5056912", "text": "def index\n respond_to do |format|\n format.zip do\n bitstreams = policy_scope(@item.bitstreams,\n owning_item: @item,\n policy_scope_class: BitstreamPolicy::Scope)\n if bitstreams.any?\n bitstreams.each do |bs|\n bs.add_download(user: current_user)\n end\n download = Download.create!(ip_address: request.remote_ip,\n institution: current_institution)\n ZipBitstreamsJob.perform_later(bitstreams: bitstreams.to_a,\n download: download,\n item_id: @item.id,\n user: current_user)\n redirect_to download_url(download)\n else\n head :no_content\n end\n end\n end\n end", "title": "" }, { "docid": "759663826690265f8f58a91ba1a0394c", "score": "0.50491416", "text": "def download_archive \n begin\n pfin = {}\n uzone = {}\n content = open(@downlaod_addrss_url)\n Zip::File.open_buffer(content) do |zip_file|\n # Handle entries one by one\n zip_file.each do |entry|\n if entry.name == \"zone.csv\" # first\n $stderr.puts \"Extracting #{entry.name}\"\n entry.get_input_stream.read.each_line do |l|\n x = l.delete('\"').delete(\"\\n\").split(/,/)\n uzone[x[0]] = x[2]\n pfin[x[2]] = []\n end\n end\n end\n zip_file.each do |entry|\n if entry.name == \"timezone.csv\" # second\n $stderr.puts \"Extracting #{entry.name}\"\n entry.get_input_stream.read.each_line do |l|\n x = l.delete('\"').delete(\"\\n\").split(/,/)\n pfin[uzone[x[0].to_s]] << {'change'=>x[2],\"val\"=>x[3],\"st\"=>x[4]}\n end\n end\n end\n end\n \n # make sure it is in chronological order \n pfin.each do |k,v|\n pfin[k].sort_by { |v| v[\"change\"] }\n end\n IO.write(\"out.json\",pfin)\n return pfin\n rescue => e\n $stderr.puts \"Error downloading archive #{e}\"\n exit(1)\n end\nend", "title": "" }, { "docid": "55104bcd8dd19ff6b0c154b89504cca2", "score": "0.5048562", "text": "def zip?\n is_content_type?('application/zip')\n end", "title": "" }, { "docid": "55104bcd8dd19ff6b0c154b89504cca2", "score": "0.5048562", "text": "def zip?\n is_content_type?('application/zip')\n end", "title": "" }, { "docid": "55104bcd8dd19ff6b0c154b89504cca2", "score": "0.5048562", "text": "def zip?\n is_content_type?('application/zip')\n end", "title": "" }, { "docid": "55104bcd8dd19ff6b0c154b89504cca2", "score": "0.5048562", "text": "def zip?\n is_content_type?('application/zip')\n end", "title": "" }, { "docid": "57724673b3190e83f3e7046c12bc4b43", "score": "0.50484973", "text": "def get_breweries_by_zip_code(zip)\n @zipstring = zip\n uri = URI(BASE_URI + \"#{@zipstring}\")\n @breweries = make_request(uri)\n @breweries != nil \n brewery_name_list\n end", "title": "" }, { "docid": "a8c207f5cfaf9f8a671ff020132f198b", "score": "0.50443673", "text": "def index\n @zip_codes = ::Geocode::ZipCode.search_by_zip_code(params[:zip])\n puts \" zip codes found: #{@zip_codes.to_a}\"\n respond_to do |format|\n format.js { puts \"--> Autofill\"; render 'autofill_city_and_state.rjs' }\n format.json { render json: @zip_codes }\n end\n end", "title": "" }, { "docid": "c21d1854159fccab8cc0a539c3f14505", "score": "0.50440246", "text": "def set_admins_zip\n @admins_zip = Admins::Zip.find(params[:id])\n end", "title": "" }, { "docid": "61077f686220bd9a7be9723d3eb4cacb", "score": "0.5039358", "text": "def scrape_zip_links\n page = Net::HTTP.get( URI.parse( self.origin_url ) )\n \n self.zips = Nokogiri::HTML( page ).css( 'a' ).map do | link |\n if ( href = link.attr( 'href' ) ) && href.match( /zip$/ )\n href\n end\n end.compact.uniq\n end", "title": "" }, { "docid": "4f19252457580a1bdd2f85f59025259b", "score": "0.50371283", "text": "def screenshots_zip\n res_name = 'screenshots.zip'\n endpoint = \"projects/#{@project_id}/runs/#{id}/screenshots.zip\"\n\n @client.get_file(endpoint, res_name)\n end", "title": "" }, { "docid": "7803565aa87c7fca4255362410c8352b", "score": "0.5024695", "text": "def extract_gis_data\n if File.exists?(KoeppenGeiger::Utils::ARCHIVE) \n begin\n #Open the existing zip file\n Zip::ZipFile::open(KoeppenGeiger::Utils::ARCHIVE) do |zipfile|\n zipfile.each do |f|\n #start extracting each file\n path = File.join(KoeppenGeiger::Utils::EXTRACT_DIR, f.name)\n FileUtils.mkdir_p(File.dirname(path))\n zipfile.extract(f, path) \n end\n end\n rescue Exception => e\n #If the script blows up, then we should probably be somewhere in this region\n puts \"An error occurred during decompression: \\n #{e}.\"\n end\n else\n puts \"\\n\\nArchive could not be found.\"\n end\n end", "title": "" }, { "docid": "079890bb4f5c5495345cc9dd2071ac59", "score": "0.5022846", "text": "def list_zip(zip_file_path, all)\n puts \"#{all.size} Finder#list_zip #{zip_file_path}\"\n\t\tzf = Zip::ZipFile.new(zip_file_path)\n\t\tzf.each do |entry|\n\t\t\tif entry.file?\n obj = ZipPathname.new\n obj.name = entry.name\n obj.zip_name = zip_file_path\n obj.size = entry.size\n obj.crc = entry.crc\n\n \t\t\tall[obj] = true\n end\n end\n zf.close\n rescue => ex\n puts \"Bad zip: #{zip_file_path}\"\n pp ex\n\tend", "title": "" }, { "docid": "e403483566153f2ecf96ab90903f5f3a", "score": "0.50197244", "text": "def zip(ip)\n response = get_full_response(ip)\n err = error(response)\n return err unless err.nil?\n\n response['zip'].to_i\n end", "title": "" }, { "docid": "4614030ad4ee6187b767e3a842baee18", "score": "0.5009617", "text": "def step8\n begin\n @sro = Sro.find(params[:sro_id])\n rescue\n redirect_to(:action => 'show') and return\n end\n @zip = Zip.find_by sro_id: params[:sro_id]\n end", "title": "" }, { "docid": "8856c7c71d48a2363f43610ec0166f45", "score": "0.50073314", "text": "def destroy\n @admins_zip.destroy\n respond_to do |format|\n format.html { redirect_to admins_zips_url, notice: 'Zip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b6eea9bf999c1b23733385b48c56b578", "score": "0.5006966", "text": "def download_and_unpack( http, zip )\n uri = URI.parse( URI.encode( self.origin_url + zip ) )\n zip_destination = self.destination_folder + zip\n \n if Net::HTTP.get_response( uri ).kind_of?( Net::HTTPSuccess )\n puts 'Downloading and extracting ' + zip + '...'\n \n begin\n File.delete( zip_destination ) if File.exists?( zip_destination )\n \n File.open( zip_destination, 'wb' ) do | file |\n http.get( uri ) do | str |\n file.write( str )\n end\n end\n \n Zip::File.open( zip_destination ) do | zip_file |\n zip_file.each do | entry |\n entry_destination = self.destination_folder + entry.name\n File.delete( entry_destination ) if File.exists?( entry_destination )\n entry.extract( entry_destination )\n end\n end\n rescue StandardError => e\n puts( e )\n end\n else\n puts 'File ' + zip + ' could not be reached.'\n end\n \n File.delete( zip_destination ) if File.exists?( zip_destination )\n end", "title": "" }, { "docid": "5002fea963a21ea3e98daa6c8b908828", "score": "0.4997187", "text": "def unzip_files(zip_name:, search_name: nil)\n output = {\n status: false,\n out_info: []\n }\n Zip::File.open(zip_name) do |zip_file|\n zip_file.each do |entry|\n if search_name.nil?\n output[:status] = true\n content = entry.get_input_stream.read\n output[:out_info] << content\n else\n if entry.name == search_name\n output[:status] = true\n content = entry.get_input_stream.read\n output[:out_info] << content\n end\n end\n end\n end\n return output\nend", "title": "" }, { "docid": "f4b64738ffe0edb58db1e07077e069e8", "score": "0.4994941", "text": "def get_dispatch_zip_with_http_info(dispatch_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DispatchApi.get_dispatch_zip ...'\n end\n # verify the required parameter 'dispatch_id' is set\n if dispatch_id.nil?\n fail ArgumentError, \"Missing the required parameter 'dispatch_id' when calling DispatchApi.get_dispatch_zip\"\n end\n # resource path\n local_var_path = '/dispatch/dispatches/{dispatchId}/zip'.sub('{' + 'dispatchId' + '}', dispatch_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?\n query_params[:'cssUrl'] = opts[:'css_url'] if !opts[:'css_url'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/zip'])\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 = ['APP_NORMAL', 'OAUTH']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'File')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DispatchApi#get_dispatch_zip\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "d54897882cdb8c12dd17eb277e5eda65", "score": "0.49920171", "text": "def expects_zip_files\n ['application/octet-stream; gdal-format=AIG',\n 'application/zip; ogr-format=\"ESRI Shapefile\"']\n end", "title": "" }, { "docid": "6299d9418511c45e995176cbf6bb3ae2", "score": "0.49918044", "text": "def supported_archive_types\n [:zip, :seven_zip]\n end", "title": "" } ]
98d2ee36fe2023732ef33112bc1bebc5
DELETE /sitegroups/1 DELETE /sitegroups/1.xml
[ { "docid": "1e3e84c9bd51197a791db53a85d641e2", "score": "0.73688203", "text": "def destroy\n @sitegroup = Sitegroup.access(current_user).find(params[:id])\n @sitegroup.destroy\n\n respond_to do |format|\n format.html { redirect_to(sitegroups_url) }\n format.xml { head :ok }\n format.csv { head :ok }\n format.json { head :ok }\n end\n end", "title": "" } ]
[ { "docid": "2cd6dbd3d8dfc6a97f28e5aa64b7226f", "score": "0.6675472", "text": "def test_set3_04b_delete_group()\n group = \"test_group\"\n user = \"test_user\"\n \n @test_acl.create_principal(user)\n @test_acl.create_group(group, [\"ALL\"], [user])\n \n query = \"doc(\\\"#{@col_path}Principals.xml\\\")//node()[@id=\\\"#{user}\\\"]/membership/mgroup[@idref=\\\"#{group}\\\"]\"\n #puts query\n handle = @db.execute_query(query)\n hits = @db.get_hits(handle)\n assert_equal(1, hits)\n \n @test_acl.delete_principal(group)\n \n query = \"doc(\\\"#{@col_path}Principals.xml\\\")//node()[@id=\\\"#{user}\\\"]/membership/mgroup[@idref=\\\"#{group}\\\"]\"\n handle = @db.execute_query(query)\n hits = @db.get_hits(handle)\n assert_equal(0, hits)\n end", "title": "" }, { "docid": "3ed7273153ec007b9a490b7c5fcfef7a", "score": "0.6655868", "text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "612cf765654beaf2f045498ed9833be5", "score": "0.6639715", "text": "def destroy\n @add_to_group = AddToGroup.find(params[:id])\n @add_to_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(add_to_groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "38959a4c19bcea0276afe9263d93ca2e", "score": "0.6633991", "text": "def destroy\n Group.rebuild! if nil.|Group.find(:first).rgt\n\t @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "67a5a21b8798debcd46678ab05f65119", "score": "0.66176444", "text": "def destroy\n Group.destroy(params[:id])\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "129f8118335894440462952ab67c9e1e", "score": "0.66031194", "text": "def destroy\n @group.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "d53b0e370533a5ce399d7d587f804c69", "score": "0.658692", "text": "def destroy\n @outgoing_sms_content_group = OutgoingSmsContentGroup.find(params[:id])\n @outgoing_sms_content_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(outgoing_sms_content_groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d455e3c29ef55ebd3fac768863abfafc", "score": "0.6584973", "text": "def destroy\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a5818e0824eabf32a74432345a75e765", "score": "0.656442", "text": "def destroy\n\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a5818e0824eabf32a74432345a75e765", "score": "0.656442", "text": "def destroy\n\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "4303f7302111cbf15bd8dbd7243dd0e8", "score": "0.6552561", "text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n \n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6fd402a2dbdaf2b6e3d28f1fba2da13c", "score": "0.65428144", "text": "def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6fd402a2dbdaf2b6e3d28f1fba2da13c", "score": "0.65428144", "text": "def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6fd402a2dbdaf2b6e3d28f1fba2da13c", "score": "0.65428144", "text": "def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6fd402a2dbdaf2b6e3d28f1fba2da13c", "score": "0.65428144", "text": "def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6fd402a2dbdaf2b6e3d28f1fba2da13c", "score": "0.65428144", "text": "def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6fd402a2dbdaf2b6e3d28f1fba2da13c", "score": "0.65428144", "text": "def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6fd402a2dbdaf2b6e3d28f1fba2da13c", "score": "0.65428144", "text": "def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6fd402a2dbdaf2b6e3d28f1fba2da13c", "score": "0.65428144", "text": "def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e9e6c742ba2b1e908b927613ec60578c", "score": "0.65384924", "text": "def destroy\n @user_group = UserGroup.find(params[:id])\n @user_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d85a5e20b150557e9990ed4004446cac", "score": "0.65252197", "text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d85a5e20b150557e9990ed4004446cac", "score": "0.65252197", "text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d85a5e20b150557e9990ed4004446cac", "score": "0.65252197", "text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d85a5e20b150557e9990ed4004446cac", "score": "0.65252197", "text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d85a5e20b150557e9990ed4004446cac", "score": "0.65252197", "text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d85a5e20b150557e9990ed4004446cac", "score": "0.65252197", "text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d85a5e20b150557e9990ed4004446cac", "score": "0.65252197", "text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d85a5e20b150557e9990ed4004446cac", "score": "0.65252197", "text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "ee12b65740924c55e4955bcbefe948df", "score": "0.6524237", "text": "def destroy\n @group.destroy unless @group.default\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "7c4c1952ce8410be232e0628468bc9cf", "score": "0.65140414", "text": "def destroy\n @attribute_group = AttributeGroup.find(params[:id])\n @attribute_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(attribute_groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "2537867215c4d23b8d400621afb242b1", "score": "0.6499986", "text": "def destroy\n @group_of_task = GroupOfTask.find(params[:id])\n @group_of_task.destroy\n\n respond_to do |format|\n format.html { redirect_to(group_of_tasks_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "7fcc90032bfcb97cd3bb03689f65a47e", "score": "0.6464635", "text": "def destroy\n @forum_group = ForumGroup.find(params[:id])\n @forum_group.destroy\n\n respond_to do |format|\n format.html { redirect_to forum_groups_url }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f0580ad3c1043ade6c7189b242321de5", "score": "0.6461364", "text": "def destroy\n @group = Group.find(params[:id])\n authorize @group, :destroy?\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(browse_groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "dd0043a2a5a20500f4be6c2543a51ffd", "score": "0.6444705", "text": "def destroy\n @ail_group = AilGroup.find(params[:id])\n @ail_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(ail_groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e3ca6c4316568f27b3fb374f0eefe995", "score": "0.6429306", "text": "def destroy\n @contact_group = ContactGroup.find(params[:id])\n @contact_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_contact_groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "7fe9eaa52816b920be20863fd0131f8e", "score": "0.6409237", "text": "def destroy\n\n @user_group = UserGroup.find(params[:id])\n @user_group.destroy\n\n respond_to do |format|\n format.html do\n if request.env['HTTP_REFERER']\n redirect_to :back\n else\n redirect_to :controller => :user_groups, :action => :index\n end\n end\n format.xml do\n head :ok\n end\n end\n end", "title": "" }, { "docid": "5ad8effb793240282f698c286765761f", "score": "0.64055115", "text": "def destroy\n group = Group.find(params[:group_id])\n\n @subgroup = group.subgroups.find(params[:id])\n @subgroup.destroy\n\n respond_to do |format|\n format.html { redirect_to(group_subgroups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "7636ce520bfc924219a0281276ac6103", "score": "0.64035195", "text": "def destroy\n # @group = @hub.groups.get(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to hub_groups_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "51c9dd179c9ecf7a7383d7a4344c80b5", "score": "0.6400034", "text": "def destroy\n @site_attribute = @site.site_attributes.find(params[:id])\n @site_attribute.destroy\n\n respond_to do |format|\n format.html { redirect_to(site_site_attributes_url(@site)) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "3f57db61f4b81e6f1d5bfacccaaf6951", "score": "0.6399945", "text": "def delete(connection)\n r = connection.execute(%(<SiteDeleteRequest session-id=\"#{connection.session_id}\" site-id=\"#{@id}\"/>))\n r.success\n end", "title": "" }, { "docid": "e45800afa903e201ff140eb984870e92", "score": "0.6395189", "text": "def destroy\n @grupo = Grupo.find(params[:id])\n @grupo.destroy\n\n respond_to do |format|\n format.html { redirect_to(grupos_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "327e0bc0cc239925a99b3089aecb399b", "score": "0.63947207", "text": "def del(id, which=:groups)\n resp = self.class.delete(\"/#{which}/#{id}\")\n check_errors resp\n end", "title": "" }, { "docid": "1eb51f0b0896d1676e5af904eb624805", "score": "0.638435", "text": "def destroy\n @selector_site = SelectorSite.find(params[:id])\n @selector_site.destroy\n\n respond_to do |format|\n format.html { redirect_to(selector_sites_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "37695e58ae3402ecd3dfd6f3053505bd", "score": "0.63706464", "text": "def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { \n flash[:notice] = 'Site was successfully removed.'\n if current_user.admin? \n redirect_to admin_path\n else\n redirect_to(sites_url)\n end\n }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "542e6fd380aec4807c920f1178dcb3a8", "score": "0.63403195", "text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "4d29c21edb181d1be19833c596cfa2cf", "score": "0.63326615", "text": "def destroy\n raise UnknownSite, \"Site not existent in Piwik yet, call 'save' first\" if new?\n xml = call('SitesManager.deleteSite', :idSite => id)\n result = XmlSimple.xml_in(xml, {'ForceArray' => false})\n freeze\n result['success'] ? true : false\n end", "title": "" }, { "docid": "1ff1b43bca21092d24d1a376854338c1", "score": "0.6328505", "text": "def destroy\n # retrieve the site thanks to params[:id]\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fcb0cba59e393c4a82a7eb3cd83d6384", "score": "0.6313542", "text": "def destroy\n @site_link = SiteLink.find(params[:id])\n @site_link.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_site_links_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f80b386ae0d6d477527b884d7f42b5c8", "score": "0.63111323", "text": "def group_delete(attribs, dir_info)\n attribs = group_record_name_alternatives(attribs)\n\n check_critical_attribute( attribs, :record_name )\n\n command = {action: 'delete', scope: 'Groups', attribute: nil, value: nil}\n user_attrs = attribs.merge(command)\n\n dscl( user_attrs, dir_info )\n end", "title": "" }, { "docid": "2397e3ccb7e9c2d6df2bb3c55ddee507", "score": "0.6307618", "text": "def destroy\n @site = Site.find(params[:id], :conditions => ['user_id = ?', current_user.id])\n @site.destroy\n\n flash[:notice] = 'Site was successfully removed from your permissions list.'\n\n respond_to do |format|\n format.html { redirect_to(user_sites_url(:user_id => current_user.id)) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "7ed7957072ec78a1d02b5caa6501dd96", "score": "0.62977684", "text": "def destroy\n @expensegroup = Expensegroup.find(params[:id])\n @expensegroup.destroy\n\n respond_to do |format|\n format.html { redirect_to(expensegroups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a57eef2cc850f4c20e04b0bb8a47daf3", "score": "0.62967086", "text": "def delete_group(group)\n\t\t\tend", "title": "" }, { "docid": "a57eef2cc850f4c20e04b0bb8a47daf3", "score": "0.62967086", "text": "def delete_group(group)\n\t\t\tend", "title": "" }, { "docid": "a750bc07fec48f71041fd47e304de4bd", "score": "0.6294265", "text": "def destroy\n @lab_group = LabGroup.find(params[:id])\n @lab_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(lab_groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "dfc2caa6fe708cc20f748c19cfbfaa05", "score": "0.6290216", "text": "def destroy\n @group = Group.find(params[:id])\n\n mbs = Membership.where \"group_id = ?\", @group.id\n\n mbs.each do |m|\n m.destroy\n end\n\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "81d7a808dd141c11aa757805c84b1e3d", "score": "0.6289905", "text": "def destroy\n @contact_group = ContactGroup.find(params[:id])\n @contact_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(contact_groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "2983707bb52956dfd1ca356ba33519ca", "score": "0.6289769", "text": "def destroy\n @site = Site.find(params[:id])\n \n if @site.uninstall(@site) == true \n puts \"\\n\\n\\n----------- DESTROYED -----------\\n\\n\\n\"\n puts \"SITE = #{@site.name}\"\n @site.destroy\n @site.save\n \n respond_to do |format|\n format.html { redirect_to(sites_url, :notice => \"Your site was successfully deleted.\") }\n format.xml { head :ok }\n end\n else\n redirect_to(@site, :warning => \"Remove site incomplete!. Please contact administrator.\")\n end\n end", "title": "" }, { "docid": "68f81c5b30fabe05e82b32fb7f56dc33", "score": "0.6287729", "text": "def destroy\n #@s_group.destroy\n @s_group = SGroup.find(params[:id].to_i)\n @s_group.delete_flg = 1\n @s_group.save!\n\n respond_to do |format|\n format.html { redirect_to s_groups_url, notice: 'S group was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c7ff52902629596401c02be7e51c92fe", "score": "0.62807333", "text": "def destroy\n @record_group = RecordGroup.find(params[:id])\n @record_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(record_groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "3d449cc0307e8a1d61570f53330257e9", "score": "0.6279895", "text": "def destroy\n\n @group_definition = GroupDefinition.find(params[:id])\n @group_definition.destroy\n\n respond_to do |format|\n format.html do\n if request.env['HTTP_REFERER']\n redirect_to(:back)\n else\n redirect_to(group_definitions_url)\n end\n end\n format.xml do\n head :ok\n end\n end\n end", "title": "" }, { "docid": "1652c0fa213623ff25a49e79e26591d9", "score": "0.6278369", "text": "def deleteSite _args\n \"deleteSite _args;\" \n end", "title": "" }, { "docid": "337a62321bca71f9eec7180affacffbd", "score": "0.62595063", "text": "def remove\n @site = Site.find(params[:id])\n @study.sites.delete(@site)\n\n respond_to do |format|\n format.xml { head :ok }\n format.js\n end\n end", "title": "" }, { "docid": "bb53fd7e094a4d63dddc91fbea20ed0f", "score": "0.6257947", "text": "def destroy\n #m_@site.destroy\n m_site = MSite.find(params[:id].to_i)\n m_site.del_flg = 1\n m_site.save\n\n respond_to do |format|\n format.html { redirect_to '/m_sites', notice: 'Site was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ae3a368a746657cbe16df3ec9d5a3f86", "score": "0.625723", "text": "def destroy\r\n @subgroup.destroy\r\n respond_to do |format|\r\n format.html { redirect_to groups_path, notice: 'Apakšgrupa veiksmīgi dzēsta' }\r\n end\r\n end", "title": "" }, { "docid": "90febae64fbfbf890f88e3ff74206057", "score": "0.62554765", "text": "def destroy\n @group = WorkGroup.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e1e066cfc1163cdad887164c1c715bec", "score": "0.6250184", "text": "def destroy\n @routinetoobjectgroup = Routinetoobjectgroup.find(params[:id])\n @routinetoobjectgroup.destroy\n\n respond_to do |format|\n format.html { redirect_to(routinetoobjectgroups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "71d20e81b0a6cf02d6eb689aa0a18c95", "score": "0.6249948", "text": "def delete_related_groups\n \n end", "title": "" }, { "docid": "3b31416ca84e1115454811a88a220ed2", "score": "0.62474155", "text": "def deleteEntityGroup( entity_id, gen_id)\n params = Hash.new\n params['entity_id'] = entity_id\n params['gen_id'] = gen_id\n return doCurl(\"delete\",\"/entity/group\",params)\n end", "title": "" }, { "docid": "645193d5dcd2169e503409858aa7413a", "score": "0.6243855", "text": "def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "2944d176b80fda4046d16046a613ddf0", "score": "0.6238618", "text": "def destroy\n sf = @site.site_files.find params[:id]\n sf.destroy\n\n flash[:notice] = \"#{sf.path} has been deleted.\"\n respond_to do |format|\n format.html { redirect_to(site_site_files_path(@site)) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "017413edcbb5493cc2053c61fd0dbb6e", "score": "0.6236137", "text": "def destroy\n @recycling_site = RecyclingSite.find(params[:id])\n @recycling_site.destroy\n\n respond_to do |format|\n format.html { redirect_to(recycling_sites_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "62a742edda9cde608c8ec19f59c1ce68", "score": "0.6231097", "text": "def destroy\n @polco_group = PolcoGroup.find(params[:id])\n @polco_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(polco_groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "0176aed999416ece9fd9fb364126d9ab", "score": "0.6228904", "text": "def destroy\n @group = Group.find(params[:id])\n\t\t@pages = Page.where(:category => 'group', :owner => @group.id)\n\t\t@pages.each do |p|\n\t\t\tp.destroy\n\t\tend\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "428bdcb2ff20610b71a557b3614b381e", "score": "0.6222032", "text": "def destroy\n GroupPermission.destroy(params[:id])\n\n respond_to do |format|\n format.html { redirect_to(group_permissions_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "aff26a9d115168abd5fe8a4896bec082", "score": "0.6218967", "text": "def destroy\n @esol_group = EsolGroup.find(params[:id])\n @esol_group.destroy\n\n respond_to do |format|\n format.html { redirect_to esol_groups_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d944a6e5bb953e00df463543ecfcdca8", "score": "0.6218246", "text": "def destroy\n @fgroup = Fgroup.find(params[:id])\n @fgroup.destroy\n\n respond_to do |format|\n format.html { redirect_to(fgroups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "0da6bb50d3142c5359b8fa8ba9e3d53e", "score": "0.62127817", "text": "def delete_group(client, options)\n if options[:directory].nil? or options[:group].nil?\n puts \"Missing arguments\"\n return\n end\n\n groups = client.groups\n group = groups.get options[:group]\n group.delete\n puts \"Group deleted.\"\n return\nend", "title": "" }, { "docid": "a6e7312645ccd4d52ff5b8d5b9d9f843", "score": "0.62119746", "text": "def destroy\n @group = Group.find(params[:group_id])\n @survey = Survey.find(params[:id])\n @survey.destroy\n\n respond_to do |format|\n format.html { redirect_to group_surveys_path(@group) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "93725804c06dfd9a4ca213d380c9717f", "score": "0.62017727", "text": "def destroy\n @grouping.destroy\n\n respond_to do |format|\n format.html { redirect_to(groupings_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "564d56c8be9177ec66dbe56edccac792", "score": "0.61994034", "text": "def destroy\n @group.destroy\n msg = [\"Destroyed group.\", rebuild_configs].join(\" \")\n redirect_to groups_url, notice: msg\n end", "title": "" }, { "docid": "a6caaa5b5ccbcc871de74580deb3790b", "score": "0.61990947", "text": "def destroy\n @group = SuperSimpleCms::Group.find(params[:id])\n respond_to do |format| \n if SuperSimpleCms::Group.find(:all).length > 1\n @group.destroy \n format.html { redirect_to(super_simple_groups_url) }\n format.js { head :ok }\n format.xml { head :ok }\n else\n format.html { redirect_to(super_simple_groups_url) }\n format.js { head :failure }\n format.xml { head :failure }\n end\n end\n end", "title": "" }, { "docid": "1523d093eed147e7ee53d375984af5cb", "score": "0.61920214", "text": "def destroy\n onesecgroup('delete', resource[:name])\n @property_hash.clear\n end", "title": "" }, { "docid": "261c98bb32f1ab8c9da75f9b73e7e442", "score": "0.61904997", "text": "def destroy\n @group_activity = GroupActivity.find(params[:id])\n @group_activity.destroy\n\n respond_to do |format|\n format.html { redirect_to(group_activities_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "1cc5e2d357680c30e18ed2e6ec110560", "score": "0.6182665", "text": "def destroy #:nodoc:\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n # format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "38aa6a2355617cd2025f05c02468bd85", "score": "0.6180292", "text": "def destroy\n @image_gallery_group = ImageGalleryGroup.find(params[:id])\n @image_gallery_group.destroy\n\n respond_to do |format|\n format.html { redirect_to( admin_image_gallery_groups_url ) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d0de4af2759eccaf2993ba8bd9b4bf6e", "score": "0.61798817", "text": "def service_group_delete(a10, name)\n a10.send(:axapi, 'slb.service_group.delete', 'post', {name: name, format: 'json'})\nend", "title": "" }, { "docid": "ae4c5b1dafac6eff4d412dab861660e4", "score": "0.61564714", "text": "def deleteGroup( group_id)\n params = Hash.new\n params['group_id'] = group_id\n return doCurl(\"delete\",\"/group\",params)\n end", "title": "" }, { "docid": "2ee05139cb992485e60527fc1bcb787a", "score": "0.61531854", "text": "def destroy\n\n\t\t@group = Group.find(params[:id])\n\t\t@group.destroy\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to(groups_url) }\n\t\t\tformat.xml { head :ok }\n\t\tend\n\tend", "title": "" }, { "docid": "7ca94c7bba0735fe86aa370cb2421a7c", "score": "0.61522526", "text": "def destroy\n @microsites_group.destroy\n respond_to do |format|\n format.html { redirect_to microsites_groups_url, notice: 'Microsites group was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ce0e1d4ff866a36cca756a6fec4d7de5", "score": "0.61476165", "text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :ok }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "5292de219b7672f54223727f0e44d980", "score": "0.6141473", "text": "def destroy\n @reachmailgroup = Reachmailgroup.find(params[:id])\n @reachmailgroup.destroy\n\n respond_to do |format|\n format.html { redirect_to reachmailgroups_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7643fb034202682d3f8fa7bfc670fd95", "score": "0.6140018", "text": "def destroy\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n format.js { render :nothing => true }\n end\n end", "title": "" }, { "docid": "4ba6ad7e201dff13ddceae579a9e42df", "score": "0.61296093", "text": "def destroy\n @blacklisted_site = BlacklistedSite.find(params[:id])\n @blacklisted_site.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_blacklisted_sites_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "7a33b470ee6f7e29ea2276df9ac6bd24", "score": "0.61258644", "text": "def remove_group(name)\n visit 'groups'\n click_link name\n\n page.accept_alert do\n click_button 'group_delete'\n end\n end", "title": "" }, { "docid": "c15d6e5a56cd0d3afcc92d0f38b240fd", "score": "0.6122735", "text": "def destroy\n @size_group = SizeGroup.find(params[:id])\n @size_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_size_groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "ccd0dbcbc58d8b991578aa9dada385f9", "score": "0.6118223", "text": "def destroy\n @team_group.destroy\n respond_to do |format|\n format.html { redirect_to(contact_info_admin_team_groups_url) }\n format.xml { head :ok }\n end\n add_log(user: current_user, action: \"Deleted team_group: #{@team_group.name}\")\n end", "title": "" }, { "docid": "807532cb6487e2a69e1f202f0f0c26c7", "score": "0.61114776", "text": "def destroy\n @microsite = Microsite.find(params[:id])\n @microsite.destroy\n\n respond_to do |format|\n format.html { redirect_to(admins_microsites_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "8f4e48a052dfbdbf5b3a0e84c67be1e8", "score": "0.6106234", "text": "def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.json { head :ok }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "aeda3f6ee58f6696cd62fb2dda88a0f3", "score": "0.61050487", "text": "def destroy\n @group = Group.find_by_param(params[:id])\n @group.tuners.clear\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fd176fa6bbd1def1b5190c3ec8c4ee08", "score": "0.61026317", "text": "def destroy\n @objectgrouptoobjectgroup = Objectgrouptoobjectgroup.find(params[:id])\n @objectgrouptoobjectgroup.destroy\n\n respond_to do |format|\n format.html { redirect_to(objectgrouptoobjectgroups_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
e8b6d8331a1d3d78350b2e3d3501c91b
Retrieve a section of the source path
[ { "docid": "18a9e667aa4c92e71d451bca732c365c", "score": "0.0", "text": "def path_part(part)\n @_path_parts ||= app.blog.drafts.path_matcher.match(path).captures\n\n @_path_parts[app.blog.drafts.matcher_indexes[part]]\n end", "title": "" } ]
[ { "docid": "6dd3f4f10eaa51137ef0906f083b5f01", "score": "0.722931", "text": "def section\n @section || path_section\n end", "title": "" }, { "docid": "59d54c8b729c207b3b8585dc5cae7bf2", "score": "0.70111966", "text": "def path_section\n $1 if @basename.to_s =~ /\\.(\\d\\w*)\\./\n end", "title": "" }, { "docid": "82498856ec85941e4f92d7b241e29566", "score": "0.6726607", "text": "def source_path\n source[:path]\n end", "title": "" }, { "docid": "d899386f4efd227e26e85038e08060b0", "score": "0.6574139", "text": "def section_of(file, section_name) \n File.read(file).split(/^(?==)/).each do |section|\n lines = section.split(\"\\n\")\n return lines[1..-1].join(\"\\n\").strip if lines.first =~ /#{section_name}/i\n end\n nil\n end", "title": "" }, { "docid": "6d57e3b3884a1c731c88f013bfdb8022", "score": "0.648108", "text": "def source_line\n @source_location[1]\n end", "title": "" }, { "docid": "33a3b2ed4fc5f419229b5f5adcc8aa52", "score": "0.6360375", "text": "def source_file\n @source_location[0]\n end", "title": "" }, { "docid": "6881ea8b40a79d1811bf31db36927532", "score": "0.6331258", "text": "def source\n File.read(source_path)\n end", "title": "" }, { "docid": "ce97929952a56707201f69a48232d83b", "score": "0.6286356", "text": "def section_by_name(section_name); end", "title": "" }, { "docid": "c7b48ee7d171f1b6f65cd27277e4d847", "score": "0.62368655", "text": "def section_of( file, section_name )\n re = /^[=#]+ (.*)$/\n sectional = project_path( file )\n parts = sectional.read.split( re )[1..-1]\n parts.map! { |p| p.strip }\n\n sections = Hash.new\n Hash[*parts].each do |k,v|\n sections[k] = v.split(\"\\n\\n\")\n end\n return sections[section_name]\n end", "title": "" }, { "docid": "c4fde90627c37a0f376354c4fb17f67e", "score": "0.62356627", "text": "def section\n section_test.section\n end", "title": "" }, { "docid": "33236bfdbe4596555cc598361ddd01cd", "score": "0.619478", "text": "def source_for(path)\n read(path, false)\n end", "title": "" }, { "docid": "dde015e4feba91eaa5146bc0c7033598", "score": "0.6108201", "text": "def section(comment=\"\")\n eval(SECTION, binding, __FILE__, SECTION_LINE)\n nil\nend", "title": "" }, { "docid": "f4bc391d7ddc17843afa3fb73ffdcff8", "score": "0.6106228", "text": "def section\n return @section if @section\n\n resp = HTTP\n .headers(authorization: \"Bearer #{access_token[:access_token]}\")\n .get(LIST_SECTIONS_ENDPOINT % notebook[:id], params: {\n select: 'id,name',\n filter: \"name eq '#{Config[:section]}'\"\n })\n if resp.code.to_s.start_with? '2'\n json = response_body(resp)\n @section = JSON.parse(json, symbolize_names: true)[:value].first\n end\n return @section\n end", "title": "" }, { "docid": "b49be822d671b6535c2b9ef356ac007f", "score": "0.60805106", "text": "def get_source\n raise 'check this!'\n # _reflector = new ReflectionClass($this);\n # $file = _reflector.filename;\n # if (!file_exists($file)) {\n # return;\n # end\n # $source = file($file, FILE_IGNORE_NEW_LINES);\n # array_splice($source, 0, _reflector.getEndLine());\n # $i = 0;\n # while (isset($source[$i]) && '/* */' == substr_replace($source[$i], '', 3, -2)) {\n # $source[$i] = str_replace('*//* ', '*/', substr($source[$i], 3, -2));\n # ++$i;\n # end\n # array_splice($source, $i);\n # return implode(\"\\n\", $source);\n end", "title": "" }, { "docid": "9c5d11ccbfdd05e917cb47cb9d49cef7", "score": "0.5960745", "text": "def source_path\n File.expand_path source unless source.nil?\n end", "title": "" }, { "docid": "8fcc62a65bc45e47ee355d7ac561967e", "score": "0.5958364", "text": "def section; end", "title": "" }, { "docid": "56bf19dbfd3862c9f52bb6d8d561ef2f", "score": "0.5957925", "text": "def source_path; end", "title": "" }, { "docid": "09da4f11f28d9ebca7e78db25704f8f4", "score": "0.5951008", "text": "def find_section(file, tag)\n # The generator doesn't support generating only one section.\n # We find the line numbers of the section start and stop.\n lines = file.split(\"\\n\")\n start = nil\n stop = lines.length\n in_section = false\n lines.each_with_index do |line, i|\n if $section_header_regex.match?(line)\n if in_section\n stop = i\n break\n elsif /\\[#{tag}\\]/.match?(line)\n start = i\n in_section = true\n end\n end\n end\n\n raise 'Start of section was not found' if start.nil?\n\n # Join the slice together and process the text a bit.\n lines[start...stop]\n .join(\"\\n\")\n .gsub($number_regex, '(#\\1)')\n .sub($ack_regex, '')\n .sub($changelog_regex, '[Diff since \\2](\\1/compare/\\2...\\3)')\n .strip\nend", "title": "" }, { "docid": "d9ce97d2031ed45328e90cf148db3b26", "score": "0.59408015", "text": "def section_d\n \n case @stage\n when \"hgt-com\"\n raise \"not yet implemented\"\n #\"#{AppConfig.hgt_com_dir}/#{calc_section.to_s}\"\n when \"hgt-par\"\n \"#{AppConfig.hgt_par_dir}/#{calc_section.to_s}\"\n end\n \n end", "title": "" }, { "docid": "3e91d0f54da61aa4098b8aaf8410be18", "score": "0.5935312", "text": "def source\n @source ||= raw_source.split(\"---\\n\")[2]\n end", "title": "" }, { "docid": "3e91d0f54da61aa4098b8aaf8410be18", "score": "0.5935312", "text": "def source\n @source ||= raw_source.split(\"---\\n\")[2]\n end", "title": "" }, { "docid": "ac989180c6c6a74ba5c99793320b13d5", "score": "0.5911242", "text": "def source_path\n Pathname.new(self.config[:source_path])\n end", "title": "" }, { "docid": "1fdf39c0c96ea20daadfed42db1d057a", "score": "0.5907724", "text": "def source_path\n sp = []\n\n Tml.session.block_options_queue.each do |opts|\n next unless hash_value(opts, :source)\n sp << hash_value(opts, :source)\n end\n\n sp = sp.reverse\n sp.unshift(Tml.session.current_source)\n\n sp.join(Tml.config.source_separator)\n end", "title": "" }, { "docid": "7755c24f54d8021e708e97364785fa33", "score": "0.5827205", "text": "def source_path\n Pathname.new(config[:source_path])\n end", "title": "" }, { "docid": "7b6364fbbe761c9ed22f23c1ad686484", "score": "0.58128273", "text": "def source\n f = File.open(File.join(root_path, path))\n data = f.read\n f.close\n data\n end", "title": "" }, { "docid": "ddeca7bcf84ad8041cf44486063b637d", "score": "0.57934403", "text": "def get_path( source_node, *path )\n h = source_node.to_hash\n path.inject(h) { |obj, item| obj[item.to_s] || break }\nend", "title": "" }, { "docid": "27c543d303a4974c7260c8082b25e156", "score": "0.5766784", "text": "def source\n @source ||= begin\n file, line_no = source_location\n raise \"no file provided by source_location: #{self}\" if file.nil?\n raise \"no line number provided for source_location: #{self}\" if line_no.nil?\n tokens = Ripper.lex File.read(file)\n tokens_on_line = tokens.select {|pos, lbl, str| pos[0].eql?(line_no) }\n starting_token = tokens_on_line.detect do |pos, lbl, str|\n TOKEN_PAIRS.keys.include?([lbl, str]) &&\n _actually_starting_a_proc?(tokens, [pos, lbl, str])\n end\n starting_token_type = [starting_token[1], starting_token[2]]\n ending_token_type = TOKEN_PAIRS[starting_token_type]\n source_str = \"\"\n remaining_tokens = tokens[tokens.index(starting_token)..-1]\n nesting = -1\n starting_nesting_token_types = if [TLAMBDA, LBRACE].include?(starting_token_type)\n [TLAMBDA, LBRACE]\n else\n [starting_token_type]\n end\n\n while token = remaining_tokens.shift\n token = [token[1], token[2]] # strip position\n source_str << token[1]\n nesting += 1 if starting_nesting_token_types.include? token\n is_ending_token = token.eql?(ending_token_type)\n break if is_ending_token && nesting.eql?(0)\n nesting -= 1 if is_ending_token\n end\n source_str\n end\n end", "title": "" }, { "docid": "d8111bc5b6a549059fa8ebf3ed8b0948", "score": "0.57661253", "text": "def source_location(*); end", "title": "" }, { "docid": "d8111bc5b6a549059fa8ebf3ed8b0948", "score": "0.57661253", "text": "def source_location(*); end", "title": "" }, { "docid": "0124dbb9e4039074c13950e6d3cdab02", "score": "0.57614315", "text": "def read_source_parts\n @source_parts ||= begin\n chunked_source = ChunkedSource.new(@source_path.open(\"r\"))\n metadata_extractor = TinyGem::MetadataExtractor.new(chunked_source, 'name' => gem_name)\n {spec: metadata_extractor.as_gemspec, library: chunked_source.library,\n readme: chunked_source.readme, executable: metadata_extractor.executable_code}\n end\n end", "title": "" }, { "docid": "ec74073eb4023b28242c4cbc39588433", "score": "0.5746982", "text": "def source\n @source ||=\n Dassets.config.sources.select{ |source|\n @file_path =~ /^#{slash_path(source.path)}/\n }.last\n end", "title": "" }, { "docid": "1c44d74dd680b357f19b19f3837e91b2", "score": "0.57462996", "text": "def source_file\n return @source_file\n end", "title": "" }, { "docid": "2bcee62f3aa435b405800b98595275bc", "score": "0.57373583", "text": "def source_location\n [@block.file.to_s, @block.line]\n end", "title": "" }, { "docid": "9b7dcb320eb4abf6736d4f9deeed8e7a", "score": "0.5715724", "text": "def get_section(experiment,section_to_find)\n section = experiment[\"experiment_procedures\"].find(){|ep| ep[\"experiment_procedure\"][\"section_type\"] == section_to_find}\n section[\"experiment_procedure\"] if section\nend", "title": "" }, { "docid": "b10e7f85324e5863cbdaf8c3b3d99ea6", "score": "0.5702988", "text": "def []( section )\n return nil if section.nil?\n @ini[section.to_s]\n end", "title": "" }, { "docid": "767981b4cac91adf3d5e353e7c354ce2", "score": "0.56885713", "text": "def get_section(section_id)\n self.sections.find { |s| s.id == section_id }\n end", "title": "" }, { "docid": "3232b1ac160cd59e383ee91ef8a15999", "score": "0.5676762", "text": "def get_section_header section_name\n\t\t\tsec_idx = @sh_idx_map[section_name]\n\n\t\t\t# No such section\n\t\t\treturn nil if sec_idx.nil?\n\n\t\t\tsec_pos = @e_shoff + (sec_idx * @sh_size)\n\t\t\t@bin[sec_pos, @sh_size]\n\t\tend", "title": "" }, { "docid": "3d8ca9360b418f50f0757f1401012541", "score": "0.5673243", "text": "def source_location; end", "title": "" }, { "docid": "692ec352df2d70491a5be8c5d348513b", "score": "0.5668444", "text": "def source_location\n source_component.source_location\n end", "title": "" }, { "docid": "8d6881bc75698cddd7fc2f1f74de00a9", "score": "0.56638163", "text": "def section_id\n match_in_id /\\/(\\w+)$/\n end", "title": "" }, { "docid": "8f87a73d00da0998b0d222b6adab38df", "score": "0.56449157", "text": "def source_location()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "40f85d6eeca85b7fba32c9786faaae38", "score": "0.56409764", "text": "def section(ident)\n @sections[ident]\n end", "title": "" }, { "docid": "0031fb53cd20266dd6ce1a976c7a4d85", "score": "0.56382215", "text": "def file(path)\n file = opened_crate.dereference(path)\n if file\n file.source\n else\n opened_crate.find_entry(path)\n end\n end", "title": "" }, { "docid": "fa68941ae6d6cf00153b31ca4c2d16cc", "score": "0.5623197", "text": "def source_path\n return @source_path if !@source_path.nil?\n @source_path = Photo.photos_root_list.find{|path| path[self.path]}\n end", "title": "" }, { "docid": "b340820a2cd5d0c9f26e1c8b8417c2db", "score": "0.5608485", "text": "def get_section(data, path, silent: false)\n path.each do |key|\n return [] unless data.key?(key)\n data = data[key]\n end\n\n data\n end", "title": "" }, { "docid": "bcd99bf50ba86b5590c916afd03b48d2", "score": "0.56064683", "text": "def __get_block_source_location(&block)\n return {} unless block_given?\n\n r, l = block.source_location\n { ref: r, line: l }\n rescue MethodSource::SourceNotFoundError\n {}\n end", "title": "" }, { "docid": "a168ff0ea5516658f117b60ce6e6f4c0", "score": "0.55935824", "text": "def determine_path\n if source_line.file == SourceLine::DEFAULT_FILE\n return source_line.file\n end\n\n full_path = File.expand_path(source_line.file)\n pwd = Dir.pwd\n\n if full_path.start_with?(pwd)\n from = Pathname.new(full_path)\n to = Pathname.new(pwd)\n\n return from.relative_path_from(to).to_s\n else\n return full_path\n end\n end", "title": "" }, { "docid": "6d4b3f3e04add63195dc3178620ebc72", "score": "0.5587882", "text": "def path_part(part)\n @_path_parts ||= Blog::UriTemplates.extract_params(blog_data.source_template, path)\n @_path_parts[part.to_s]\n end", "title": "" }, { "docid": "d6c0c2f02c1be0e874050bd4be7056aa", "score": "0.5581236", "text": "def current_section\n \tcurrent_controller.split(\"/\").last\n end", "title": "" }, { "docid": "b5b6bc719e4c284ff44253bef233d166", "score": "0.5569669", "text": "def get_main_section(string)\n string.split(\"[End of section] \\n\")[2]\n end", "title": "" }, { "docid": "c823dfce236c5a205c6a2741fff2d852", "score": "0.55339503", "text": "def parse_source_location(caller)\n case caller\n when Exception\n trace = caller.backtrace #.reject{ |bt| bt =~ INTERNALS }\n caller = trace.first\n when Array\n caller = caller.first\n end\n caller =~ /(.+?):(\\d+(?=:|\\z))/ or return \"\"\n source_file, source_line = $1, $2.to_i\n return source_file, source_line\n end", "title": "" }, { "docid": "09e086deb71fbef7d94129266113f6df", "score": "0.5530204", "text": "def parse_source_location(caller)\n case caller\n when Exception\n trace = caller.backtrace.reject{ |bt| bt =~ INTERNALS }\n caller = trace.first\n when Array\n caller = caller.first\n end\n caller =~ /(.+?):(\\d+(?=:|\\z))/ or return \"\"\n source_file, source_line = $1, $2.to_i\n return source_file, source_line\n end", "title": "" }, { "docid": "89daef1f5689a6ccc81ef6fd476440df", "score": "0.55221295", "text": "def extract_source(chunks)\n chunks[fmt.index('s')]\n rescue TypeError\n options[:source] || Socket.gethostname\n end", "title": "" }, { "docid": "e9759c2a9ae0a742e83d8d12a988e7f6", "score": "0.5520812", "text": "def section\n comment_sections.map(&:section).select { |section| section }.last\n end", "title": "" }, { "docid": "c38cd83ef0a6bae1eb59d5f15a2cd2cb", "score": "0.5509787", "text": "def fetch_path(start_path)\n ['', 'config'].each do |directory|\n ['', '.'].each do |prefix|\n path = File.join(start_path, directory, \"#{prefix}#{@file_name}\")\n return path if File.exist?(path)\n end\n end\n nil\n end", "title": "" }, { "docid": "81b219e55976767e7875efccfb0563ca", "score": "0.5499542", "text": "def parse_source_location(caller)\n case caller\n when Exception\n trace = caller.backtrace.reject{ |bt| bt =~ INTERNALS }\n caller = trace.first\n when Array\n caller = caller.first\n end\n caller =~ /(.+?):(\\d+(?=:|\\z))/ or return \"\"\n source_file, source_line = $1, $2.to_i\n returnf source_file, source_line\n end", "title": "" }, { "docid": "866b5ed1b5784d9079d484e9f089c785", "score": "0.54975265", "text": "def section_by_id(section_id); end", "title": "" }, { "docid": "25e252b49c2c407e0d84313222a1dc5d", "score": "0.5495344", "text": "def file() = pathname.relative_path_from(Cnfs.config.paths.definitions)", "title": "" }, { "docid": "2b7842984ee2dde40a649d97ed72c0da", "score": "0.5491497", "text": "def section\n return @section unless @section.nil?\n\n comment_sections.each do |text|\n if text =~ /Styleguide \\d/i\n cleaned = text.strip.sub(/\\.$/, '') # Kill trailing period\n @section = cleaned.match(/Styleguide (.+)/)[1]\n end\n end\n\n @section\n end", "title": "" }, { "docid": "072651dee040504a4068f9731d839cac", "score": "0.5481989", "text": "def to_partial_path\n 'section'\n end", "title": "" }, { "docid": "709408da2076a49b6e608201de597831", "score": "0.5475992", "text": "def source_access_path\n _access_path(source_annotations)\n end", "title": "" }, { "docid": "9492d034ab6e81d5ad4d511a2c4c8799", "score": "0.54659915", "text": "def get_section_info section_header\n\t\t\tsection_info = {}\n\n\t\t\t# index of name string in .shstrtab\n\t\t\tpos = 0\n\t\t\tsection_info[:name_idx] = section_header[pos, ELF_SIZE_WORD].to_i\n\t\t\tpos += ELF_SIZE_WORD\n\n\t\t\t# section type\n\t\t\tsection_info[:type] = section_header[pos, ELF_SIZE_WORD].to_i\n\t\t\tpos += ELF_SIZE_WORD\n\n\t\t\t# section flags\n\t\t\tsection_info[:flags] = section_header[pos, ELF_SIZE_WORD].to_i\n\t\t\tpos += ELF_SIZE_WORD\n\n\t\t\t# address when section loaded to memory.\n\t\t\tsection_info[:va_address] = section_header[pos, @address_size].to_i\n\t\t\tpos += @address_size\n\n\t\t\t# offset position of this secion in file.\n\t\t\tsection_info[:offset] = section_header[pos, @offset_size].to_i\n\t\t\tpos += @offset_size\n\n\t\t\t# section size\n\t\t\tsection_info[:size] = section_header[pos, ELF_SIZE_WORD].to_i\n\t\t\tpos += ELF_SIZE_WORD\n\n\t\t\t# Index of related section\n\t\t\tsection_info[:related_section_idx] = section_header[pos, ELF_SIZE_WORD].to_i\n\t\t\tpos += ELF_SIZE_WORD\n\n\t\t\t# Depends on section type.\n\t\t\tsection_info[:info] = section_header[pos, ELF_SIZE_WORD].to_i\n\t\t\tpos += ELF_SIZE_WORD\n\n\t\t\t# Allignment size.\n\t\t\tsection_info[:addr_align] = section_header[pos, ELF_SIZE_WORD].to_i\n\t\t\tpos += ELF_SIZE_WORD\n\n\t\t\t# Section entry size (used when section has struct table)\n\t\t\tsection_info[:entry_size] = section_header[pos, ELF_SIZE_WORD].to_i\n\t\t\tsection_info\n\t\tend", "title": "" }, { "docid": "3a699d0f933b97a67ca00760282030fa", "score": "0.545199", "text": "def section\n clean_path(params[:section])\n end", "title": "" }, { "docid": "762889b655ad9f845cc4541112aa1b15", "score": "0.54487777", "text": "def get_section(header, file)\n get_space = false\n found_space = false\n string = ''\n IO.foreach(file) do |line|\n if found_space\n if line =~ /[^\\s]/\n string << line\n else\n break\n end\n elsif get_space\n if line !~ /[^\\s]/\n found_space = true\n get_space = false\n end\n elsif line =~ /^#{header}/ \n get_space = true\n end\n end\n string.gsub!(\"\\n\", ' ')\nend", "title": "" }, { "docid": "02409a91a44688fd951c2e9642ccad80", "score": "0.5441938", "text": "def section_containing(offset)\n sections.select { |s| s.contains? offset }.first\n end", "title": "" }, { "docid": "1dabab5512f16dc5a71552bb2e9085c6", "score": "0.54392695", "text": "def source_location\n self.to_s =~ /@(.*):(\\d+)/\n [$1, $2.to_i]\n end", "title": "" }, { "docid": "963bcb88cb50782c619646bad7e1f144", "score": "0.54362404", "text": "def source_path(arg=nil)\n set_or_return(\n :source_path,\n arg,\n :kind_of => [ String ]\n )\n end", "title": "" }, { "docid": "82140572c849ef643845e8107664b8e7", "score": "0.54311633", "text": "def get_from_source(source_or_content, &block)\n request = Puppet::Indirector::Request.new(:file_content, :find, source_or_content.full_path.sub(/^\\//,''), nil, :environment => resource.catalog.environment)\n request.do_request(:fileserver) do |req|\n connection = Puppet::Network::HttpPool.http_instance(req.server, req.port)\n connection.request_get(indirection2uri(req), add_accept_encoding({\"Accept\" => \"raw\"}), &block)\n end\n end", "title": "" }, { "docid": "9d8cac94180386fb27048e1763d84de4", "score": "0.54190636", "text": "def get\n File.read(path)\n end", "title": "" }, { "docid": "e96ea11a2319c608fce742080cf54aac", "score": "0.541717", "text": "def find_section_by_usage( usage )\n PageLayout.includes(:section=>:section_piece).where([\"#{PageLayout.table_name}.root_id=? and #{SectionPiece.table_name}.usage=?\",self.page_layout_root_id, usage]).first\n end", "title": "" }, { "docid": "ec3329a56aafc4eca2603878202ecd38", "score": "0.5415745", "text": "def parse_information(path, keys)\n sources_config.map do |configuration|\n node = response_body.dig(*configuration[path])\n next if node.blank?\n node.slice(*configuration[keys])\n end.compact[0]\n end", "title": "" }, { "docid": "cf145b4d4384624b98c4f6278114d10a", "score": "0.5414832", "text": "def find source=nil\n source || if first_caller = caller.find {|f| not f.start_with? __FILE__ }\n first_caller.sub(/:\\d+.*$/, '')\n end\n end", "title": "" }, { "docid": "bc6ce789526797d2723637c236668960", "score": "0.5409153", "text": "def section_by_name(section_name)\n section = sections.find do |s|\n s.name == section_name\n end\n if section.nil?\n raise RTrail::NotFound.new(\n \"Section '#{section_name}' not found in Suite '#{data.name}'\")\n end\n return section\n end", "title": "" }, { "docid": "5c9f31f0047dec5079d2bacf1cd77315", "score": "0.5405993", "text": "def get_config_section(section_name)\r\n parse_config unless config_parsed?\r\n JSON.parse exec(\"echo json_encode($config[#{section_name.to_s.inspect}]);\").strip\r\n end", "title": "" }, { "docid": "97bbe8b3ff826d846b3699f399046426", "score": "0.54054356", "text": "def read\n IO.read(full_path)\n end", "title": "" }, { "docid": "475606d158a9990140aa77dc60206c0f", "score": "0.5404082", "text": "def snippet(path)\n File.read(File.join(__dir__, 'snippets', *path.split('/')))\nend", "title": "" }, { "docid": "a7581be4e8567c744d316df086020214", "score": "0.5403948", "text": "def source_location\n if @file.nil?\n args =[*(1..(arity<-1 ? -arity-1 : arity ))]\n\n set_trace_func method(:trace_func).to_proc\n call(*args) rescue nil\n set_trace_func nil\n @file = File.expand_path(@file) if @file && File.exist?(File.expand_path(@file))\n end\n [@file, @line] if @file\n end", "title": "" }, { "docid": "a48fc52b443b0d53d9f9e889d7234ba2", "score": "0.54023516", "text": "def section(name)\n self[section_index(name)]\n end", "title": "" }, { "docid": "0977d24f4c828a1194fea7c5f13f4a32", "score": "0.5401583", "text": "def [](section)\n return nil if section.nil?\n\n @ini[section.to_s]\n end", "title": "" }, { "docid": "560d0286ae6928f64d32ccaf67772cb6", "score": "0.53989166", "text": "def extract_source_from(error)\n extract = []\n \n code = error.backtrace[1]\n md = code.match(%r{:(\\d+):in `(.*)'$})\n line_num = md[1].to_i\n\n if lines = code.split(\"\\n\")[(line_num - RADIUS)..(line_num + RADIUS)]\n lines.each_with_index do |line, idx|\n lidx = line_num - RADIUS + idx \n extract << \"#{lidx}: #{line}\"\n end \n end\n \n return extract\n end", "title": "" }, { "docid": "7a6da5dc83de1f55851c542c083b5eb7", "score": "0.53983426", "text": "def source_line; end", "title": "" }, { "docid": "89b570d6f20e3461da3f61f0a3bfbc06", "score": "0.53869295", "text": "def code\n path\n end", "title": "" }, { "docid": "2b7a3b9469d2b8590f316ac0ccbf455a", "score": "0.5385878", "text": "def raw_source\n @raw ||= File.read source_path\n end", "title": "" }, { "docid": "2b7a3b9469d2b8590f316ac0ccbf455a", "score": "0.5385878", "text": "def raw_source\n @raw ||= File.read source_path\n end", "title": "" }, { "docid": "997a642ec05c688e5d6b088cffcca299", "score": "0.5369916", "text": "def source\n ap get_source\n end", "title": "" }, { "docid": "00d6be8acf93569bd0b41296995b4875", "score": "0.5368962", "text": "def sections_url\n return @sections_url\n end", "title": "" }, { "docid": "8e1d675f323c7c0f6c7186823dc3e932", "score": "0.53651816", "text": "def find_section_by_usage( usage )\n # [\"#{PageLayout.table_name}.root_id=? and #{SectionPiece.table_name}.usage=?\",self.page_layout_root_id, usage]\n PageLayout.includes(:section).where( spree_sections:{usage: usage}, template_theme_id: original_template_theme.id ).first\n end", "title": "" }, { "docid": "258a001b9d9a8f16a84fff477a443fcf", "score": "0.53615713", "text": "def at(path); end", "title": "" }, { "docid": "1b502c3c1df1f10846b7b14ae2d08628", "score": "0.53581053", "text": "def get_info(line, prefix)\n index = line.index(prefix)\n return line.slice(index + prefix.size..-1) if index\n\n nil\n end", "title": "" }, { "docid": "41f40d1498c97e60ce842093c2c223bf", "score": "0.5347337", "text": "def source\n @source ||= begin\n source_opts = {\n :folder => File.join(options(:root), options(:source)),\n :cache => Rack::Sprockets.config.cache? ? cache : nil,\n :compress => Rack::Sprockets.config.compress,\n :secretary => {\n :root => options(:root),\n :load_path => options(:load_path),\n :expand_paths => options(:expand_paths)\n }\n }\n Source.new(path_info_resource, source_opts)\n end\n end", "title": "" }, { "docid": "5dd9a73307d7997ceb805358aa1ded06", "score": "0.5346954", "text": "def find_a_source_file\n # find a file in source dir with the proper file extension.\n end", "title": "" }, { "docid": "6e542ee4b6b5fc7562b5fd013ef5f30d", "score": "0.5342813", "text": "def find(path); end", "title": "" }, { "docid": "6e542ee4b6b5fc7562b5fd013ef5f30d", "score": "0.5342813", "text": "def find(path); end", "title": "" }, { "docid": "396b8851634c3a136878e824c7fd003e", "score": "0.5340475", "text": "def doc_src\n @doc_src ||= unless doc_place\n \"no documentation available\" \n else\n file, line = doc_place\n RubyTools::extract_file_rdoc(file, line, true)\n end\n end", "title": "" }, { "docid": "51eaf4043f611f33257f5e88bf45b70b", "score": "0.5332411", "text": "def get_config\n if @resource[:section]\n return node.get_config(params: \"section #{@resource[:section]}\", as_string: true)\n end\n node.running_config\n end", "title": "" }, { "docid": "11dc3f74d408a6969412e275f681e64e", "score": "0.5323916", "text": "def source_path options={}\n @source_path ||= if options[:relative]\n File.join collection_path, \"#{id}.md\"\n else\n File.join Rails.root, collection_path, \"#{id}.md\"\n end\n end", "title": "" }, { "docid": "c84afd32cd40f322797a5e33b18488ee", "score": "0.5322466", "text": "def relative_to_source(properties, key)\n path = properties[key]\n base = @source_dir ? @source_dir : ''\n\n return nil if path == nil\n return path if Pathname.new(path).absolute?\n return File.expand_path(File.join(base, path))\n end", "title": "" }, { "docid": "0dab8a215e5b5fd2fc3e268c01720b66", "score": "0.53154963", "text": "def file_node(path)\n file_info(path).first[0..19]\n end", "title": "" }, { "docid": "b830dc0bec8049e5f19a65a8ff4318c6", "score": "0.531155", "text": "def documentation_source path\n _, source_name, path = path.split '/', 3\n\n store = @stores[source_name]\n return store, path if store\n\n store = store_for source_name\n\n store.load_all\n\n @stores[source_name] = store\n\n return store, path\n end", "title": "" }, { "docid": "a78a8088c4430243dcc8e16e84bda195", "score": "0.5310824", "text": "def section(value)\n merge(gadrsection: value.to_s)\n end", "title": "" }, { "docid": "61de4dcac50fd07a36bdb38e0f739a2b", "score": "0.5307601", "text": "def line\n location&.line\n end", "title": "" } ]
8cdf9a17bb1726768e682efbd736f1c7
Provide a user friendly representation source://twilioruby//lib/twilioruby/rest/conversations/v1/conversation.rb326
[ { "docid": "84c2aa104b8a70acbe3f11eca76559b3", "score": "0.0", "text": "def to_s; end", "title": "" } ]
[ { "docid": "e0ecd09bbcbcebfc56e0a7dd00df5618", "score": "0.7497514", "text": "def to_s\n '<Twilio::REST::Conversations::V1>';\n end", "title": "" }, { "docid": "9114014ec03e778a04d7682c6e7c8f28", "score": "0.73569745", "text": "def to_s\n '#<Twilio::REST::Conversations>'\n end", "title": "" }, { "docid": "ad0f768e7c56952ca9ac4c6629fb6780", "score": "0.7247325", "text": "def to_s\n '<Twilio::REST::Conversations::V1>'\n end", "title": "" }, { "docid": "d9abd3bf3f9663c69a865e3256a6fdc9", "score": "0.7112732", "text": "def response_msg(conversation_id)\n\t\t{\n \t\"conversation_id\": conversation_id,\n\t\t\t\"text\": \"우리멍냥 응답 메세지\",\n\t\t\t\"blocks\": [\n\t\t\t\t{\n\t\t\t\t \"type\": \"text\",\n\t\t\t\t \"text\": \"*처리되었습니다. 감사합니다.*🐱 🐶\",\n\t\t\t\t \"markdown\": true\n\t\t\t\t}\n\t\t\t]\n\t\t}.to_json\t\n\tend", "title": "" }, { "docid": "ef9e6726c874f3486a2d4f69d837816a", "score": "0.7037671", "text": "def to_s\n \"conversation\"\n end", "title": "" }, { "docid": "4cd1439aaa2823c7cf6c942928108162", "score": "0.6840402", "text": "def to_s\n values = @params.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Conversations.V1.UserConversationInstance #{values}>\"\n end", "title": "" }, { "docid": "5bb8f1c81bd95f707388202ee4f5d2ed", "score": "0.6802139", "text": "def to_s\n context = @solution.map{|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.Conversations.V1.UserConversationContext #{context}>\"\n end", "title": "" }, { "docid": "f6c8095349388afa18515fa5a7275306", "score": "0.6770324", "text": "def to_s\n '<Twilio.Conversations.V1.ParticipantConversationPage>'\n end", "title": "" }, { "docid": "85e4355bb3dcf6a7b7b9e3c60c1dedfa", "score": "0.6762923", "text": "def to_s\n '<Twilio.Conversations.V1.UserConversationPage>'\n end", "title": "" }, { "docid": "c809b7afc1c109fa9baf011fad5d99da", "score": "0.67347574", "text": "def inspect\n context = @solution.map{|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.Conversations.V1.UserConversationContext #{context}>\"\n end", "title": "" }, { "docid": "e519fe2f97fb47645b0b46b0592f85a9", "score": "0.6717939", "text": "def inspect\n values = @properties.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Conversations.V1.UserConversationInstance #{values}>\"\n end", "title": "" }, { "docid": "668f46fec43bde9efeb1fac45bedd8d9", "score": "0.6705304", "text": "def list \n $sender_Id= params.shift.last() \n $receiver_Id = params.shift.last() \n @conv= Messages.get_conversation($sender_Id, $receiver_Id)\n \n end", "title": "" }, { "docid": "242736ad61264bd6417f468078c45bbd", "score": "0.6670349", "text": "def chat_conversations; JSON[Api::get_chat_conversations(self)]; end", "title": "" }, { "docid": "689202b8c570aabcbfb5307dc09210f4", "score": "0.66628957", "text": "def to_s\n '<Twilio::REST::Chat::V3>';\n end", "title": "" }, { "docid": "267adb4cefe7845d805cc99f38b84737", "score": "0.66491234", "text": "def conversation\n\n end", "title": "" }, { "docid": "e2a57b3504fe77bba9a9d5a2f7702df1", "score": "0.6646139", "text": "def conversations; end", "title": "" }, { "docid": "341b76aff355b71a34a900c6e3d5082d", "score": "0.6599471", "text": "def conversation\n \n @conversation ||= mailbox.conversations.find(params[:id])\n end", "title": "" }, { "docid": "9211084ebb663c1b8ef88f3305767ea2", "score": "0.6580444", "text": "def to_s\n '<Twilio.Conversations.V1.WebhookPage>'\n end", "title": "" }, { "docid": "ab4dda79bb53e3ea13206371f7b0a5e0", "score": "0.651835", "text": "def to_s\n '#<Twilio.Conversations.V1.ParticipantConversationList>'\n end", "title": "" }, { "docid": "74018ee60a8c3e9b2f6cd48cc091fd2b", "score": "0.64943594", "text": "def to_s\n \"<Twilio.Conversations.V1.ParticipantConversationInstance>\"\n end", "title": "" }, { "docid": "6e25776a977830193c583a8930dc4983", "score": "0.6481741", "text": "def conversation( organization_id, conversation_id, options={} )\n get \"organizations/#{organization_id}/conversations/#{conversation_id}.json\", extra_query: options, response_container: %w( conversation ), transform: SignalCloud::Conversation\n end", "title": "" }, { "docid": "3b088f2e1f22f4a70d073720e44dd172", "score": "0.6479328", "text": "def conversation_type\n self[:type]\n end", "title": "" }, { "docid": "080f7839cf692e80f391ec57cb7d9b25", "score": "0.6459431", "text": "def to_s\n '#<Twilio.Conversations.V1.UserConversationList>'\n end", "title": "" }, { "docid": "6aa6bd4cd29dbdb3dd000fe8c2131bd5", "score": "0.64350706", "text": "def conversation\n\t\t\n \t \t@conversation ||= mailbox.conversations.find(params[:id])\n \tend", "title": "" }, { "docid": "1aff81cf140b8d7116186b6ec2f3637e", "score": "0.6419351", "text": "def get_conversation(id)\n get(\"conversations/#{id}\")\n end", "title": "" }, { "docid": "1aff81cf140b8d7116186b6ec2f3637e", "score": "0.6419351", "text": "def get_conversation(id)\n get(\"conversations/#{id}\")\n end", "title": "" }, { "docid": "3ab3bb40f62b633f13d1ab20b7f7a7f5", "score": "0.64065164", "text": "def to_s\n '<Twilio.FlexApi.V1.InsightsConversationsPage>'\n end", "title": "" }, { "docid": "2f1f121c481a49f24026198a9478fc9e", "score": "0.6402131", "text": "def to_s\n '<Twilio::REST::Chat::V3>'\n end", "title": "" }, { "docid": "712eb953ca1ccbf949b2f2c0b5e3f56c", "score": "0.63965917", "text": "def to_s\n context = @solution.map{|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.Conversations.V1.UserContext #{context}>\"\n end", "title": "" }, { "docid": "57a8227be05873919cd7ec532d6c3638", "score": "0.63721645", "text": "def to_s\n context = @solution.map{|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.Conversations.V1.WebhookContext #{context}>\"\n end", "title": "" }, { "docid": "9987d11b6403c80d5929e53209b80cb9", "score": "0.63695705", "text": "def conversation\n @conversation ||= mailbox.conversations.find(params[:id])\n end", "title": "" }, { "docid": "7fcf70ea63e7d3efc3303835fd18785d", "score": "0.6366204", "text": "def show\n @conversation = Conversation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @conversation }\n end\n end", "title": "" }, { "docid": "7fcf70ea63e7d3efc3303835fd18785d", "score": "0.6366204", "text": "def show\n @conversation = Conversation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @conversation }\n end\n end", "title": "" }, { "docid": "7fcf70ea63e7d3efc3303835fd18785d", "score": "0.6366204", "text": "def show\n @conversation = Conversation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @conversation }\n end\n end", "title": "" }, { "docid": "7fcf70ea63e7d3efc3303835fd18785d", "score": "0.6366204", "text": "def show\n @conversation = Conversation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @conversation }\n end\n end", "title": "" }, { "docid": "756636f3054c6c459633cf883c1e2214", "score": "0.6343095", "text": "def convo_name\n self.conversation.name\n end", "title": "" }, { "docid": "17bf4e2f43482b003b86c257a15c19d2", "score": "0.6341719", "text": "def to_s\n \"<Twilio.FlexApi.V1.InsightsConversationsInstance>\"\n end", "title": "" }, { "docid": "062094d10802ec4d5bc543e7ca17644f", "score": "0.6332196", "text": "def to_s\n '<Twilio.Conversations.V1.WebhookPage>'\n end", "title": "" }, { "docid": "6940f99b945a9da6f304cc473b50e26c", "score": "0.6306165", "text": "def conversation(username)\n creds_not_found if @username.nil? == true && @username.nil? == true\n params = {\n 'username' => @username,\n 'auth_token' => @auth_token,\n 'endpoint' => '/loq/conversation'\n }\n jwt = sign_token(params)\n response = endpoint_auth(jwt)\n sc_data = {\n 'conversation_id' => @username + '~' + username\n }\n json_data = post_sc_request(response, sc_data)\n json_data\n end", "title": "" }, { "docid": "9935dad80351be3a64b155cd9258aed7", "score": "0.6296824", "text": "def inspect\n \"<Twilio.Conversations.V1.ParticipantConversationInstance>\"\n end", "title": "" }, { "docid": "45efa842699124a2abeb14c3b63317a1", "score": "0.6290041", "text": "def to_s\n '#<Twilio.FlexApi.V1.InsightsConversationsList>'\n end", "title": "" }, { "docid": "d69602b61735356c1e6c3168fd1d0cba", "score": "0.62895566", "text": "def to_s\n '<Twilio.Conversations.V1.UserPage>'\n end", "title": "" }, { "docid": "f9fdf7154d81625476077c5a1c39ea73", "score": "0.6270325", "text": "def create_conversation(data)\n post(\"conversations\", { body: data })\n\n # Extract ID of created conversation from the Location header\n conversation_uri = last_response.headers[\"location\"]\n conversation_uri.match(/(\\d+)$/)[0]\n end", "title": "" }, { "docid": "10e71c2a72e48db48ac1f8e362467ba5", "score": "0.62555873", "text": "def create_conversation(data)\n post(\"conversations\", { body: data })\n\n # Extract ID of created conversation from the Location header\n conversation_uri = last_response.headers[\"location\"]\n conversation_uri.match(/(\\d+)$/)[1]\n end", "title": "" }, { "docid": "0670eaba02f242bee8a8d638ff01f3f9", "score": "0.6233682", "text": "def inspect\n context = @solution.map{|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.Conversations.V1.UserContext #{context}>\"\n end", "title": "" }, { "docid": "3b0e324eb4bf8502596d86479afd8866", "score": "0.6227513", "text": "def show\n @conversation = Conversation.find(params[:id])\n render :json => {:conversation => @conversation }\n end", "title": "" }, { "docid": "dedf8cf2af95d6d098b90a579bb6341d", "score": "0.62127775", "text": "def conversation(conversation)\n get(\"inbox/conversations/#{conversation}\").pop\n end", "title": "" }, { "docid": "25feff5fc58886fefc9d3f57a4e296a2", "score": "0.6197017", "text": "def conversation(tweet)\n conv = if tweet.in_reply_to_status_id?\n @conversations[tweet.in_reply_to_status_id]\n end\n\n if conv.nil?\n conv = @conversations[tweet.id] || Conversation.new(self)\n end\n\n if tweet.in_reply_to_status_id?\n @conversations[tweet.in_reply_to_status_id] = conv\n end\n @conversations[tweet.id] = conv\n\n # Expire any old conversations to prevent memory growth\n @conversations.each do |k,v|\n if v != conv && Time.now - v.last_update > 3600\n @conversations.delete(k)\n end\n end\n\n conv\n end", "title": "" }, { "docid": "f00cfe8a65dc753640180850ea6c0cf7", "score": "0.6180732", "text": "def to_s\n context = @solution.map {|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.Conversations.V1.WebhookContext #{context}>\"\n end", "title": "" }, { "docid": "bad42237f091ac2f8df97bc27908bdfa", "score": "0.61725426", "text": "def show\n StatsManager::StatsD.time(Settings::StatsConstants.api['conversation']['show']) do\n if @conversation = Conversation.find(params[:id])\n @status = 200\n else\n render_error(404, \"could not find conversation for id #{params[:id]}\")\n end\n end\n end", "title": "" }, { "docid": "c29011de1ab7ba9feffe8b715118c0a6", "score": "0.6171496", "text": "def api_json\n {\n 'id' => self.id,\n 'conversation_id' => self.conversation.id,\n 'conversation_message_count' => self.conversation.messages.count,\n 'from_phone' => self.from,\n 'to_phone' => self.to,\n 'sent_by' => self.sent_by,\n 'body' => CGI::escape_html(self.body || ''),\n 'created_at' => self.created_at.to_i,\n }\n end", "title": "" }, { "docid": "a76ae7f2f37f33be4d203540ecee7005", "score": "0.6155092", "text": "def show\r\n @conversation = current_user.mailbox.conversations.find(params[:id])\r\n render json: @conversation\r\n end", "title": "" }, { "docid": "1ec2b76455a32ba7781a37a96a01c76f", "score": "0.6153935", "text": "def conversation_list\n Conversation.user_conversation(self.id)\n end", "title": "" }, { "docid": "87e29fa0537686f6c59133ff2d7d7b98", "score": "0.61497855", "text": "def inspect\n context = @solution.map{|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.Conversations.V1.WebhookContext #{context}>\"\n end", "title": "" }, { "docid": "d4bf84add4dc482602f55bf4a92aed46", "score": "0.6145516", "text": "def conversation\n @conversation = Conversation.between(params[:sender_id], params[:recipient_id]).first\n end", "title": "" }, { "docid": "5424309524919e21ec1eb7b0d2c7958a", "score": "0.61356866", "text": "def index\n @messages = @conversation.messages\n render json: @messages\n end", "title": "" }, { "docid": "e7112d71e3f834d6c2f212a88a6984f9", "score": "0.61256856", "text": "def dump_conversations\n new_conversations.map{|c| \"#{c['timestamp']} :: #{c['conversation_id']} :: #{c['from']}: #{c['content']}\"}\n end", "title": "" }, { "docid": "d5970d4e6ea984b75fbf79b5e3da3eb3", "score": "0.61147416", "text": "def show\n @conversation = Conversation.find(params[:id])\n @message = Message.new\n @count = @conversation.messages.size\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @conversation }\n format.mobile\n end\n end", "title": "" }, { "docid": "3c746f1533412f127ac32e10245b5764", "score": "0.611314", "text": "def conversations\n # GET /messages\n # Array of MessageRef objects but due to GROUP BY they only have attributes otherparty_id, newest_message_date, cnt, unseen_cnt.\n # sent_anything is boolean and says whether any message ref exists that is sent to otherparty. This info is used when showing whether recipient has seen messages.\n @conversations = MessageRef.select(\"otherparty_id, max(created_at) newest_message_date, count(1) as cnt, sum(unseen) as unseen_cnt, bool_or(direction = 'sent') sent_anything\").\n group('otherparty_id').\n where(user: current_user).\n order('unseen_cnt desc, newest_message_date desc') # Primary sort groups with unread messages so they appear at top.\n end", "title": "" }, { "docid": "6ec3e03606e60692fe51eac09a018d14", "score": "0.60908246", "text": "def show\n # #respond_with Conversation.find(params[:id])\n # render json: Conversation.all\n end", "title": "" }, { "docid": "a610efdc46ed601f27f6d3e2aa04a322", "score": "0.60838807", "text": "def get_conversation(conversation_id)\n get(\"conversations/#{conversation_id}\")\n end", "title": "" }, { "docid": "3bfd43f2bd0972bb567178149bcfdf05", "score": "0.6074001", "text": "def showprivatechat \n @messages = Message.find_all_by_user_id_to(params[:to]) \n \n @messages.each do |m| \n @conversation = \"#{@conversation}\\n#{m.created_at.localtime}:#{m.user_id_from}:#{m.message}\"\n end\n \n respond_to do |format|\n format.html # showprivatechat.html.erb\n format.xml { render :xml => @message }\n end\n end", "title": "" }, { "docid": "e0a6ea6afbc316986f409b5347aa50c0", "score": "0.60661125", "text": "def conversation\n message.conversation if message.is_a? MessageCenter::Message\n end", "title": "" }, { "docid": "42b9bb919badb2ff8993ce003cf1b233", "score": "0.6064686", "text": "def conversation\n Conversation\n .where(\"creator_id = ? or member_id = ?\", user_id, user_id)\n .order(\"latest_message_id DESC\").first\n end", "title": "" }, { "docid": "e56672af2e5a7f1264c0089b97ff3df8", "score": "0.6063353", "text": "def show\n @conversation = Conversation.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @conversation.to_xml }\n end\n end", "title": "" }, { "docid": "bb1b91b82cb929493e47a5822c81ee5f", "score": "0.60617614", "text": "def to_s\n values = @params.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Conversations.V1.WebhookInstance #{values}>\"\n end", "title": "" }, { "docid": "2ab746064388c01651ebed57540db161", "score": "0.6057249", "text": "def to_s\n '#<Twilio.Conversations.V1.UserList>'\n end", "title": "" }, { "docid": "a82dc021fb23c5597c756873af12f31a", "score": "0.6049168", "text": "def show\n @conversation_id = params[:id]\n @current_conversation= Conversation.find(@conversation_id )\n @messages= Message.all\n @conversations = conversations_allowed\n #@content = if Message.where(conversation_id:@conversation.id).last.content != nil\n #@time_ago = Message.where(conversation_id:@conversation.id).last.updated_at.strftime( \"%H:%M\")\n \n end", "title": "" }, { "docid": "fc014038a41ea6e1800d440fa425ca02", "score": "0.6047458", "text": "def rendered_conversation\n if @conversation.is_group_conversation?\n render 'list', locals:{groups: [@conversation.decorate], is_mine: true}, layout: false\n else\n render 'recent_messages', locals:{messages: [@conversation.decorate]}, layout: false\n end\n end", "title": "" }, { "docid": "4b45f7ea48d0e11edf05f225b6c1cb97", "score": "0.601474", "text": "def conversation_id\n return @conversation_id\n end", "title": "" }, { "docid": "916ba67a1ef80754bc7ed43debeab7c3", "score": "0.60043925", "text": "def get_conversation_with_http_info(conversation_uuid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ConversationApi.get_conversation ...'\n end\n # verify the required parameter 'conversation_uuid' is set\n if @api_client.config.client_side_validation && conversation_uuid.nil?\n fail ArgumentError, \"Missing the required parameter 'conversation_uuid' when calling ConversationApi.get_conversation\"\n end\n # resource path\n local_var_path = '/conversation/conversations/{conversation_uuid}'.sub('{' + 'conversation_uuid' + '}', conversation_uuid.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n\n # header parameters\n header_params = {}\n header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()\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 = ['ultraCartOauth', 'ultraCartSimpleApiKey']\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 => 'ConversationResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConversationApi#get_conversation\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "c8b9c288331eee6186520f015a2e3df1", "score": "0.59960985", "text": "def list_messages\n\t messages = []\n if Conversation.between(current_user.id, params[:recipient_id]).present?\n conversation = Conversation.between(current_user.id, params[:recipient_id]).first\n \t messages = conversation.messages\n end\n render json: {conversation: messages}\n end", "title": "" }, { "docid": "08ae171500c008605445d3c34ff7192f", "score": "0.5994093", "text": "def inspect\n \"<Twilio.FlexApi.V1.InsightsConversationsInstance>\"\n end", "title": "" }, { "docid": "695016e36bf99446200577ae96fdb60c", "score": "0.5992903", "text": "def to_s\n context = @solution.map{|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.Api.V2010.MessageContext #{context}>\"\n end", "title": "" }, { "docid": "762058d063d8b6f95da8042263fe4f42", "score": "0.5987726", "text": "def fetch_conversation\n @conversation = conversations.find(params[:id])\n end", "title": "" }, { "docid": "c0bc43e54e119befe087c83f06803c59", "score": "0.59817463", "text": "def index\n @messages = @conversation.messages\n end", "title": "" }, { "docid": "c39b22ee4bd97fde4a79f03b08d02e54", "score": "0.5973652", "text": "def conversation_params\n params.fetch(:conversation, {})\n end", "title": "" }, { "docid": "d34d09c0153c64a88dcbbd47f671f2a6", "score": "0.59732175", "text": "def inspect\n context = @solution.map {|k, v| \"#{k}: #{v}\"}.join(',')\n \"#<Twilio.Conversations.V1.WebhookContext #{context}>\"\n end", "title": "" }, { "docid": "babebf14cbed719319888760ca34900a", "score": "0.5955208", "text": "def show\n conversations = Conversation.where(user_1: params[:id]).or(Conversation.where(user_2: params[:id]))\n\n structured_conversations = []\n conversations.each do | conversation |\n full_convo = {\n id: conversation.id,\n title: conversation.title,\n created_at: conversation.created_at,\n user_1: User.select(:id, :name, :avatar_url).where({id: conversation.user_1_id}),\n user_2: User.select(:id, :name, :avatar_url).where({id: conversation.user_2_id}),\n messages: conversation.messages\n }\n structured_conversations.push(full_convo);\n end\n \n render json: structured_conversations\n end", "title": "" }, { "docid": "096454a1969ca11c63ad9095c4225640", "score": "0.5933634", "text": "def to_s\n values = @params.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Conversations.V1.WebhookInstance #{values}>\"\n end", "title": "" }, { "docid": "f6fff751cc13157d48cd3db66be461e1", "score": "0.59092504", "text": "def show\n @conversation = Conversation.find(params[:id])\n load_board\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @conversation }\n end\n end", "title": "" }, { "docid": "7146907b0ff263cca99e06dc63a02d2d", "score": "0.59081644", "text": "def list_conversations\n call(:get, '/conversations')\n end", "title": "" }, { "docid": "cb1344466d3741a46f7b57f957669061", "score": "0.5893245", "text": "def recipient\n conversation = Api::V1::Conversation.between(@current_user.id, params[:user_id]).first\n\n unless conversation.nil?\n messages = conversation.messages.order('created_at DESC')\n\n paginate json: messages\n else\n paginate json: []\n end\n end", "title": "" }, { "docid": "d5e9e5f961e40f213192db1d1851199b", "score": "0.58730334", "text": "def to_s\n values = @params.map{|k, v| \"#{k}: #{v}\"}.join(\" \")\n \"<Twilio.Conversations.V1.UserInstance #{values}>\"\n end", "title": "" }, { "docid": "7235a57a52901a719bc8cb34326afd9e", "score": "0.5864379", "text": "def show\n @user = User.find(params[:id])\n @messages=conversation(current_user,user)\n\n end", "title": "" }, { "docid": "3cbce25a497c658575f9b6d803aaa040", "score": "0.583061", "text": "def to_s\n '#<Twilio.Conversations.V1.WebhookList>'\n end", "title": "" }, { "docid": "ad0c69d112115bfdb37bbcbcdfea1a22", "score": "0.5819222", "text": "def conversations\n creds_not_found if @username.nil? == true && @username.nil? == true\n params = {\n 'username' => @username,\n 'auth_token' => @auth_token,\n 'endpoint' => '/loq/conversations'\n }\n jwt = sign_token(params)\n response = endpoint_auth(jwt)\n json_data = post_sc_request(response)\n json_data\n end", "title": "" }, { "docid": "d7b2d91e98340cc314987d4543e5d2b4", "score": "0.5818542", "text": "def conversations_get_conversations_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ConversationsApi.conversations_get_conversations ...'\n end\n # resource path\n local_var_path = '/v3/conversations'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'continuationToken'] = opts[:'continuation_token'] if !opts[:'continuation_token'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json', 'application/xml', 'text/xml'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n return_type = opts[:return_type] || 'ConversationsResult' \n\n auth_names = opts[: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 => return_type)\n\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConversationsApi#conversations_get_conversations\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "3765ed8b1b5695a23fbe7ff9351cd5b3", "score": "0.58175945", "text": "def conversation_params\n params.permit(:responder_id, :user_id, :message, :unreaded)\n end", "title": "" }, { "docid": "3051476fbabc6e0ebe4e32cdde4b0ecc", "score": "0.5816585", "text": "def index\n conversations = Api::V1::Conversation.where('sender_id = ? OR recipient_id = ?', @current_user.id, @current_user.id).order('updated_at DESC').all\n \n paginate json: conversations\n end", "title": "" }, { "docid": "f9552de535b479e805a7724745c66202", "score": "0.58151937", "text": "def set_conversation\n @conversation = Conversation.friendly.find(params[:id])\n end", "title": "" }, { "docid": "62c91ae8213e0526307a3ac4a00b94d0", "score": "0.58144295", "text": "def to_s\n '<Twilio::REST::Messaging::V1>';\n end", "title": "" }, { "docid": "8d431584785ec9a35977e789e1e45bde", "score": "0.58130246", "text": "def conversations\n Conversation.where(\"sender_id = ? OR recipient_id = ?\", id, id)\n end", "title": "" }, { "docid": "13b5e28fcecdf814d491ac35bf37449e", "score": "0.5808709", "text": "def conversation_params\n params.require(:conversation).permit(:user_id_creator, :user_id_recipient, :title, :content, :created_at)\n end", "title": "" }, { "docid": "b0e9665c486d1507516e98da0c134ffa", "score": "0.58069676", "text": "def set_conversation\n @conversation = Conversation.includes(:user, :group, :replies, :conversation_likes).friendly.find(params[:id])\n end", "title": "" }, { "docid": "318ff699d88e650077d7eef34008b43e", "score": "0.580515", "text": "def conversation_params\n\t params.require(:conversation).permit(:text).merge(user_name: current_user.name, user_id: current_user._id)\n\tend", "title": "" }, { "docid": "2e0745c60c7aebd88633ee0b55e1e3a8", "score": "0.579954", "text": "def new\n @conversation = Conversation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @conversation }\n end\n end", "title": "" }, { "docid": "2e0745c60c7aebd88633ee0b55e1e3a8", "score": "0.579954", "text": "def new\n @conversation = Conversation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @conversation }\n end\n end", "title": "" }, { "docid": "2e0745c60c7aebd88633ee0b55e1e3a8", "score": "0.579954", "text": "def new\n @conversation = Conversation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @conversation }\n end\n end", "title": "" }, { "docid": "2e0745c60c7aebd88633ee0b55e1e3a8", "score": "0.579954", "text": "def new\n @conversation = Conversation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @conversation }\n end\n end", "title": "" }, { "docid": "c47b4d726abe53057577afcc85bd8188", "score": "0.57987666", "text": "def find_conversation \n @conversation = Conversation.find(params[:conversation_id])\n end", "title": "" } ]
b7c5a9c8615ba5f1c6a75012efc27fcb
Returns each element of the header joined with table tags.
[ { "docid": "56defd1b9bc1752c00f21ea16c9ef183", "score": "0.688262", "text": "def generate_header_row\n \"<table>\\n<tr>#{(@header.map {|x| \"<th>#{generate_header_item(x)}</th>\"}).join}</tr>\\n\"\n end", "title": "" } ]
[ { "docid": "c89ac6ea7c71df91ec2657a357ff5418", "score": "0.7299083", "text": "def header_items\n get_row_items(quip_sheet.at_css(\"tr\").children)\n end", "title": "" }, { "docid": "5c41bc56b0738599d36c359793375030", "score": "0.72535044", "text": "def generate_header_row\n \"<tr>#{(@header.map {|x| generate_header_item(x)}).join}</tr>\\n\"\n end", "title": "" }, { "docid": "7159fba03399720a31688f4c3b9e3c80", "score": "0.7252297", "text": "def headers\n rows.slurped![0]\n end", "title": "" }, { "docid": "651a9629517bc00ba1dbeb92fbd7265e", "score": "0.71938187", "text": "def generate_header_row\n (@header.map {|x| generate_header_item(x)}).join\n end", "title": "" }, { "docid": "651a9629517bc00ba1dbeb92fbd7265e", "score": "0.71938187", "text": "def generate_header_row\n (@header.map {|x| generate_header_item(x)}).join\n end", "title": "" }, { "docid": "651a9629517bc00ba1dbeb92fbd7265e", "score": "0.71938187", "text": "def generate_header_row\n (@header.map {|x| generate_header_item(x)}).join\n end", "title": "" }, { "docid": "651a9629517bc00ba1dbeb92fbd7265e", "score": "0.71938187", "text": "def generate_header_row\n (@header.map {|x| generate_header_item(x)}).join\n end", "title": "" }, { "docid": "651a9629517bc00ba1dbeb92fbd7265e", "score": "0.71938187", "text": "def generate_header_row\n (@header.map {|x| generate_header_item(x)}).join\n end", "title": "" }, { "docid": "fda884507c58cc69ca122cc2388d4251", "score": "0.71874416", "text": "def headers\n @row.map(&:first)\n end", "title": "" }, { "docid": "585fb5a58ec5931902831da4aca4b446", "score": "0.71563953", "text": "def headers\n if @table.empty?\n Array.new\n else\n @table.first.headers\n end\n end", "title": "" }, { "docid": "af92b3a92376f8155e9ee0836843f77e", "score": "0.71377105", "text": "def get_table_headers(header)\n header.map { |name| escape(name.to_s.humanize) }.join('</th><th>')\n end", "title": "" }, { "docid": "0735a9c300ca9a87c712ede10c8bc627", "score": "0.7101447", "text": "def generate_header_row\n \"<tr>#{(@header.map {|x| '<th>'+generate_item(x)}).join(\"</th>\")}</th></tr>\\n\"\n end", "title": "" }, { "docid": "c5da901e2d3b5bcf6797eede4532fcb0", "score": "0.7069842", "text": "def headers\n @row.map { |pair| pair.first }\n end", "title": "" }, { "docid": "c41d601e6d60ddd473fa64e26f3ec948", "score": "0.70684105", "text": "def generate_header_row\n \"<tr>#{(@header.map {|x| '<th>'+generate_item(x)}).join(\"</th>\")}</th></tr>\\n\" \n end", "title": "" }, { "docid": "9329e38f4742171acb8326c95bb5f0a3", "score": "0.706709", "text": "def generate_header_row\n \"<table>\" + \"\\n<tr>\"+ (@header.map { |x| generate_header_item(x) }).join('</th>') + \"</th></tr>\" + \"\\n\"\n end", "title": "" }, { "docid": "019579ab00142ea7dba9726d1c11bc61", "score": "0.7056923", "text": "def table_header\n header = [\"<tr>\"]\n m = @class_name.new\n m.display_fields.each do |field|\n header << \n \"<th class='first-color center first-color-border padding-all'>\n #{field.humanize}\n </th>\"\n end\n header << \"</tr>\"\n header.join\n end", "title": "" }, { "docid": "7120b00f994898303775567406caf5a9", "score": "0.7056832", "text": "def headers\n @headers ||= data_table.xpath(\"tr[1]/th\").map(&:text)\n end", "title": "" }, { "docid": "fa7177070fbb2df9135833b836346984", "score": "0.7042732", "text": "def price_table_headers\n price_table.all(:xpath, \"./thead/tr/th\").map { |cell| cell.text }\n end", "title": "" }, { "docid": "14fae9af56f9b208bc83dc3dbb253761", "score": "0.70046353", "text": "def header_cells\n header = ''\n (1..@game.frame_number).each{|frame| header += \"<td>##{frame}</td>\"}\n header\n end", "title": "" }, { "docid": "4b7bdd44ecc23f5bbdc3782c2e762fe3", "score": "0.69792557", "text": "def html_header\n content_tag_nested(:tr, cols) { |c| c.html_header }\n end", "title": "" }, { "docid": "ab31cdca17388d31ebed67c1e52c4b30", "score": "0.69476646", "text": "def html_header\n content_tag_nested(:tr, cols, &:html_header)\n end", "title": "" }, { "docid": "d3b874cf5d63e91cdb1d924639f3918f", "score": "0.6891068", "text": "def headers\n first_rows(1).first || []\n end", "title": "" }, { "docid": "83a5bd4ba1fde98058c4477a63744393", "score": "0.6878731", "text": "def headers\n if @table.empty?\n @headers.dup\n else\n @table.first.headers\n end\n end", "title": "" }, { "docid": "454d2790a368b363c240a22e0cde4035", "score": "0.6861038", "text": "def thead\n content_tag :thead do\n fields.collect do |field|\n concat content_tag(:th, field.capitalize)\n end.join.html_safe\n end\n end", "title": "" }, { "docid": "ffd664593e50dc3f288198d7f17910a6", "score": "0.6845425", "text": "def header\n content_tag :tr do\n HEADER.map { |day| content_tag :th, day }.join.html_safe\n end\n end", "title": "" }, { "docid": "d4b51461174654660268d28f64394dbe", "score": "0.6787802", "text": "def header_table(header)\n return '' if header.empty?\n\n cols = header.each_pair.collect {|k,v| \"#{k} & #{v} \\\\\\\\\" }\n\n \"\\\\begin{tabular}{ | r | l | } \\\\hline %s \\\\hline \\\\end{tabular}\\n\\n\" % cols.join(\"\\\\hline\\n\")\n end", "title": "" }, { "docid": "dea4709fac604ed9dbc33bcf709f52cd", "score": "0.6787248", "text": "def header\n temp = \"\"\n result = \"SpecId\\tLabel\\tCharge\\t\"\n \n nokogiriDoc(@target).xpath(\"//#{@xmlns}search_hit\").each do |hit|\n temp = hit.xpath(\".//#{@xmlns}search_score\")\n break\n end\n \n temp.each do |score|\n result += score.xpath(\"./@name\").to_s + \"\\t\"\n end\n \n result += \"Peptide\\t\" + \"Proteins\"\n end", "title": "" }, { "docid": "5d0c7ea184c26864b777a402cad965d8", "score": "0.6782877", "text": "def headings_with_rows\n [@headings] + rows\n end", "title": "" }, { "docid": "85dea654f409a14dbe75fe82cc2f3751", "score": "0.67809343", "text": "def header_cells; end", "title": "" }, { "docid": "85dea654f409a14dbe75fe82cc2f3751", "score": "0.67809343", "text": "def header_cells; end", "title": "" }, { "docid": "b52c25fde83841c00c81c1fea59c88a0", "score": "0.67440623", "text": "def table_header(options)\n str = ''\n str << '<thead>' if create_tbody?(options) || options[:footers]\n str << '<tr>'\n\n options[:headers].each_with_index do |header, index|\n if (options[:order] && options[:order][:values] &&\n options[:order][:values][index])\n order_by = options[:order][:values][index]\n\n asc_val = if options[:order][:asc_pic]\n %|<img src=\"#{options[:order][:asc_pic]}\" alt=\"asc\" />|\n else\n '^'\n end\n desc_val = if options[:order][:desc_pic]\n %|<img src=\"#{options[:order][:desc_pic]}\" alt=\"desc\" />|\n else\n 'v'\n end\n\n order_asc = \"<a href='#{target_uri(order_by, 'ASC')}'>#{asc_val}</a>\"\n order_desc = \"<a href='#{target_uri(order_by, 'DESC')}'>#{desc_val}</a>\"\n\n str << '<th><table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tr>'\n\n if options[:order][:left] || !options[:order][:right]\n str << \"<th>#{order_asc}<br />#{order_desc}</th>\"\n end\n\n str << %|<th>#{header}</th>|\n\n if options[:order][:right]\n str << \"<th>#{order_asc}<br />#{order_desc}</th>\"\n end\n\n str << '</tr></table></th>'\n else\n str << %|<th>#{header}</th>|\n end\n end\n\n str << '</tr>'\n str << '</thead>' if create_tbody?(options) || options[:footers]\n\n return str\n end", "title": "" }, { "docid": "f1ad7fc329802024ed598502689c162a", "score": "0.6736248", "text": "def get_table_headers(doc)\n\t\theaders = []\n\t\tdoc.xpath('//table/tbody/tr/th').each do |th|\n\t\t headers << th.text\n\t\tend\n\t\theaders\n\tend", "title": "" }, { "docid": "0aacfb4f86e215fb28f3508bb151ed91", "score": "0.6708776", "text": "def header\n output = %(<tr class=\"calendar_header\">).tab(2)\n Date::DAYNAMES.each do |day_name|\n output.then_add ['<th>', day_name[0..0], '</th>'].join.tab(4)\n end\n output.then_add %(</tr>).tab(2)\n end", "title": "" }, { "docid": "ae9a3537a61d25c629f2681341ab6421", "score": "0.66828203", "text": "def header\n row\n end", "title": "" }, { "docid": "d9e85070fc47e102130a56d0ee8ed90a", "score": "0.66445816", "text": "def header_pairs\n @head.header_pairs\n end", "title": "" }, { "docid": "72729948f9553823456090d3a6620861", "score": "0.6631681", "text": "def tableify header_and_rows_ary, padding = 0\n table = Text::Table.new(:horizontal_padding => 1,\n :vertical_boundary => '-',\n :horizontal_boundary => '|',\n :boundary_intersection => '+',\n # :boundary_intersection => '-',\n # :boundary_intersection => ' ',\n :first_row_is_head => true,\n # :rows => header_and_rows_ary # works only for to_table\n )\n table.head = header_and_rows_ary[0]\n table.rows = header_and_rows_ary[1..-1]\n\n # table.to_s\n # table.rows = header_and_rows_ary\n #\n # table = header_and_rows_ary.to_table(:first_row_is_head => true)\n\n res = table.to_s.split(\"\\n\")\n res.map {|row_str| ' ' * padding + row_str}\n end", "title": "" }, { "docid": "a67c1cdcf86bdc451080ffae031640e3", "score": "0.6630941", "text": "def table_header; end", "title": "" }, { "docid": "8800c095ff528468fdaab785da8769c4", "score": "0.6590816", "text": "def table_header\n first_day_of_week = Date.today.beginning_of_week + (@options[:start_week])\n content_tag(:thead) do\n content_tag(:tr) do\n (0..6).collect do |i|\n classes = 'day_name'\n if @options[:start_week] == 0\n classes << ' weekend' if [5,6].include?(i)\n classes << ' sunday' if i == 6\n elsif @options[:start_week] == -1\n classes << ' weekend' if [0,6].include?(i)\n classes << ' sunday' if i == 0\n end\n content_tag(:th, l(first_day_of_week + i, :format => @options[:header_format]), :class => classes)\n end.to_s\n end\n end\n end", "title": "" }, { "docid": "8cdfb197cdd7ac08f7e22fda8dd197d9", "score": "0.65782154", "text": "def headers\n all_columns = []\n columns.each do |header|\n all_columns << TableFu::Header.new(header, header, nil, self)\n end\n all_columns\n end", "title": "" }, { "docid": "44ad48f487309eb7c56df7190da0f014", "score": "0.6571274", "text": "def table_header(title)\n table_array = []\n puts title\n table_array << ['No.',\"Type\", \"Description\", \"Information\", \"Priority\"]\n table_array << :separator\n table_array\n end", "title": "" }, { "docid": "f75f60f1f775757dd8016f450fd3c85d", "score": "0.6542996", "text": "def table_headers\n raise NotImplementedError\n end", "title": "" }, { "docid": "4e05da40141cb0cecc210ff460867642", "score": "0.65306807", "text": "def search_results_table_headers\n search_results_table.headers_text\n end", "title": "" }, { "docid": "474aa5d2a23ec7343629965ac24be8c6", "score": "0.6516352", "text": "def generate_header_row\n \"[options=\\\"header\\\"]\\n|==========\\n#{(@header.map {|x| generate_header_item(x)}).join}\\n\"\n end", "title": "" }, { "docid": "024f70f33d11b87d5709ff1281f76b9d", "score": "0.6502373", "text": "def show_thead_tr\n %{<tr><th>Field</th><th>Details</th></tr>}.html_safe\n end", "title": "" }, { "docid": "7860c2fba41471f33a979486a30298cb", "score": "0.6495391", "text": "def header_rows\n @dimension_header_rows.label_columns(@labeller)\n @banner_header_rows.label_columns(@labeller)\n\n @banner_header_rows.to_a + @dimension_header_rows.to_a\n end", "title": "" }, { "docid": "5c372f38c682d6cbdd1db19d3cc09de1", "score": "0.6483469", "text": "def headers( node )\n node.xpath( 'table/tbody/tr/th' ).map( &:text ).map( &:strip )\n end", "title": "" }, { "docid": "40a66a8563ca2bcceb2f7c5ed9b6ac07", "score": "0.6471269", "text": "def header\n temp = \"\"\n result = \"SpecId\\tLabel\\tCharge\\t\"\n \n nokogiriDoc(@target).xpath(\"//xmlns:SpectrumIdentificationItem\").each do |hit|\n temp = hit.xpath(\".//xmlns:cvParam\")\n break\n end\n \n temp.each do |score|\n result += score.xpath(\"./@name\").to_s + \"\\t\"\n end\n \n result += \"Peptide\\t\" + \"Proteins\"\n end", "title": "" }, { "docid": "1d8b583446b28c0b8c16ec11ac9f04e8", "score": "0.6471151", "text": "def render_header\n thead.tr.empty\n Date.this_week.each do |day|\n thead.tr << DOM::Element.new(\"th #{day.strftime('%a')}\")\n end\n end", "title": "" }, { "docid": "fe31295ddf5e78d599cb5c02149a27ba", "score": "0.64694446", "text": "def table( node )\n rows( node ).map { |row| Hash[ headers( node ).zip( row ).sort ] }\n end", "title": "" }, { "docid": "15fed7cb454f661d60effc722d26b828", "score": "0.6460739", "text": "def headers(row = nil)\n row ||= rows.first\n header_type = row.th.exist? ? 'th' : 'td'\n row.send(\"#{header_type}s\")\n end", "title": "" }, { "docid": "3603636a38f5c0c83aba7c55ae709e8f", "score": "0.6454302", "text": "def render_table_header(&block)\n make_tag(:tr, @table_options[:header_html]) do\n yield(header_row_builder)\n end # </tr>\"\n end", "title": "" }, { "docid": "3603636a38f5c0c83aba7c55ae709e8f", "score": "0.6454302", "text": "def render_table_header(&block)\n make_tag(:tr, @table_options[:header_html]) do\n yield(header_row_builder)\n end # </tr>\"\n end", "title": "" }, { "docid": "6c8f13c2f0d9cd8259770536e46c18f2", "score": "0.64317226", "text": "def flat_table(h)\n if h.keys.length == 2 && h.keys.last == 'total'\n data_name = h.keys.first\n # I do not know anything about the system so I use defensive programming\n data_keys = h[data_name].collect(&:keys).flatten.uniq\n\n content_tag(:table, {class: ['table', 'table-striped', 'table-bordered', 'table-hover'] }) do\n concat table_head(data_keys)\n concat table_data(h)\n concat table_foot(h, data_keys)\n end\n else\n raise 'unexpected table data'\n end\n end", "title": "" }, { "docid": "f7ee936243777f267709eecdcad5ca80", "score": "0.6428258", "text": "def rows\n uniq_headers.map{ |hdr| row(hdr) }\n end", "title": "" }, { "docid": "ebd9de4bbb189677eb21d2893110a5c0", "score": "0.6405179", "text": "def generate_header_row\n \"[options=\\\"header\\\"]\" + \"\\n|==========\\n\" + \"|#{(@header.map { |x| generate_header_item(x) }).join('|')}\\n\"\n end", "title": "" }, { "docid": "6d83896431cd84de7d00fb75bc45e910", "score": "0.640367", "text": "def header_names\n @head.header_names\n end", "title": "" }, { "docid": "7cbe629f5a015f9cfe7b4a557e468c75", "score": "0.6380266", "text": "def generate_header_row\n \"[options=\\\"header\\\"]\\n|==========\\n#{(@header.map {|x| \"|#{generate_header_item(x)}\"}).join}\\n\"\n end", "title": "" }, { "docid": "7d83d62811be77bcad75fe8c0a1cef8b", "score": "0.63755435", "text": "def output_table_headings(options)\n # Table heading\n html.colgroup do\n table_columns.each {|column| html.col :class => column[:name] }\n end\n \n # Column groups\n html.thead do\n html.tr(options[:heading], :colspan => columns.length) if options[:heading]\n html.tr do\n table_columns.each do |column| \n html_options = {}\n html_options[:class] = column[:class] if column[:class]\n html.th(column[:label], html_options)\n end\n end\n end\n end", "title": "" }, { "docid": "f6eb4241b58781b7f48c50501661bf38", "score": "0.63710546", "text": "def table(header, body)\n \"<div class=\\\"table-wrapper\\\">\n <table>\n#{header}#{body}\n </table>\n</div>\\n\"\n end", "title": "" }, { "docid": "b731e19109e67aa231631caea40ab60c", "score": "0.63660824", "text": "def summary_table_headers(args={})\n\t\t'''\n\t\t\t<thead>\n\t \t<tr>\n\t \t<th>Name</th>\n\t\t\t <th>User Id</th>\n\t\t\t <th>Patient Id</th>\n\t\t\t <th>Phone Numbers</th>\n\t\t\t <th>Email Ids</th>\n\t\t\t <th>Options</th>\n\t \t</tr>\n\t </thead>\n\t\t'''\n\tend", "title": "" }, { "docid": "659150988822fe37aa70ce27d85ee9b5", "score": "0.636332", "text": "def output_table_headings(options)\n # Table heading\n html.colgroup do\n table_columns.each {|column| html.col :class => column[:name] }\n end\n \n # Column groups\n html.thead do\n html.tr(options[:heading], :colspan => columns.length) if options[:heading]\n html.tr do\n table_columns.each {|column| html.th(column[:label]) }\n end\n end\n end", "title": "" }, { "docid": "76148f3460aa866aaaf6c44aee5d3239", "score": "0.6358592", "text": "def output_table_headings(options)\n # Table heading\n html.colgroup do\n table_columns.each {|column| html.col :class => column[:name] }\n end\n \n # Column groups\n html.thead do\n html.tr(options[:heading], :colspan => columns.length) if options[:heading]\n html.tr do\n table_columns.each do |column| \n html_options = {}\n html_options[:class] = column[:class] if column[:class]\n html.th(column[:label], html_options)\n end\n end\n end\n end", "title": "" }, { "docid": "763e41c5114f7b7ae88c01ede3266c97", "score": "0.63506174", "text": "def headers\n Row.headers + original_headers[6..original_headers.length]\n end", "title": "" }, { "docid": "f90b5f5b97cbbf36b5a6a868495432c4", "score": "0.63322276", "text": "def summary_table_headers(args={})\n\t\t'''\n\t\t\t<thead>\n\t <tr>\n\t <th>Name</th>\n\t <th>Total Categories</th>\n\t <th>Options</th>\n\t </tr>\n\t </thead>\n\t\t'''\n\tend", "title": "" }, { "docid": "a718f452374634cd2536bd3cc761789b", "score": "0.6319517", "text": "def generate_header_item(item)\n \"<th>#{item}\"\n end", "title": "" }, { "docid": "e6001e4713609074476f684b64c51028", "score": "0.63123643", "text": "def summary_table_headers(args={})\n\t\t'''\n\t\t\t<thead>\n\t <tr>\n\t <th>Name</th>\n\t <th>Qunatity</th>\n\t <th>Total Items</th>\n\t <th>Options</th>\n\t </tr>\n\t </thead>\n\t\t'''\n\tend", "title": "" }, { "docid": "93f36cf0b18c4edde792939913efa85f", "score": "0.6306247", "text": "def summary_table_headers(args={})\n\t\t'''\n\t\t\t<thead>\n\t <tr>\n\t <th>Name</th>\n\t <th>Expiry Date</th>\n\t <th>Options</th>\n\t </tr>\n\t </thead>\n\t\t'''\n\tend", "title": "" }, { "docid": "9bf22fe1a1692bf45a0b1cdaa9663097", "score": "0.6291891", "text": "def summary_table_headers(args={})\n\t\t\"\n\t\t\t<thead>\n\t <tr>\n\t <th>For Organization Id</th>\n\t <th>Rate</th>\n\t <th>Options</th>\n\t </tr>\n\t </thead>\n\t\t\"\n\tend", "title": "" }, { "docid": "e40f0d76104c63b7e6ea85f355dbef4f", "score": "0.6289822", "text": "def head(options = {}, &block)\n return \"\" if @collection.empty? and not @force\n reset_cell_count\n open_tag(start_tag(:thead, options))\n @inside_head = true\n tr(:class => \"thead\", :object_html => nil) do\n yield\n end\n @inside_head = false\n close_tag(\"</thead>\")\n end", "title": "" }, { "docid": "e7f9403f5a681e72092d35b35d45dee9", "score": "0.6282304", "text": "def table_heading(obj = nil, &block)\n return tag_do('th', obj) unless obj.nil?\n return tag_do('th', block)\n end", "title": "" }, { "docid": "3015c1cf9262e26c4bc3e00a6e8d7f29", "score": "0.62762487", "text": "def get_array_of_headers\n\t\t\tarray = []\n\t\t\t@data_to_render.each do |s|\n\t\t\t\tarray << convert_symbol_to_header(s)\n\t\t\tend\n\t\t\tarray\n\t\tend", "title": "" }, { "docid": "9ffc49cb97ba73af379f2fa777ace2bb", "score": "0.62755513", "text": "def header\n result = TABLE_HEADER.dup\n result << LINE_SEPARATOR\n result << TABLE_SEPARATOR\n result << LINE_SEPARATOR\n end", "title": "" }, { "docid": "d02b23d494c7979a6f2585996dacf251", "score": "0.6274923", "text": "def create_header\n order = options[:order].split(' ')\n table_columns.map do |column|\n if column.sortable\n if order[0] == column.sortable.to_s\n url = TableMe::UrlBuilder.url_for(options, order: \"#{column.sortable.to_s} #{order[1].downcase == 'asc' ? 'desc' : 'asc'}\")\n klass = order[1]\n else\n url = TableMe::UrlBuilder.url_for(options, order: \"#{column.sortable.to_s} asc\")\n klass = nil\n end\n \"<th><a #{\"class='#{klass}'\" if klass} href='#{url}'>#{column.name.to_s.split('_').join(' ').titleize}</a></th>\"\n else\n \"<th>#{column.name.to_s.split('_').join(' ').titleize}</th>\"\n end\n end.join.html_safe\n end", "title": "" }, { "docid": "f95a5bb1f4ea7e3e24e366d55054fdcb", "score": "0.62723166", "text": "def users_list_table_headers\n user_group_tables[0].headers_text\n end", "title": "" }, { "docid": "bf601cd58b2c16a794cb566c1d217908", "score": "0.62657195", "text": "def meter_header(range)\n content_tag(:tr) do\n concat content_tag(:th)\n range.to_a.reverse.each { |date| concat content_tag(:th, date.strftime('%-m/%-d/%y')) }\n end\n end", "title": "" }, { "docid": "e8bd04a0c3d222b0c23d9de7cf3da614", "score": "0.6264292", "text": "def build_table_header\n output << \"[\\n\"\n end", "title": "" }, { "docid": "2ae21d9ac6807446cdf03dae0c88b966", "score": "0.62629795", "text": "def summary_table_headers(args={})\n\t\t'''\n\t\t\t<thead>\n\t \t<tr>\n\t \t<th>Name</th>\n\t\t\t <th>Options</th>\n\t \t</tr>\n\t </thead>\n\t\t'''\n\tend", "title": "" }, { "docid": "bfb79d4b4ce03e4f81e49c78abae39be", "score": "0.6259842", "text": "def summary_table_headers(args={})\n\t\t\"\n\t\t\t<thead>\n\t <tr>\n\t \t <th>Id</th>\n\t <th>For Organization Id</th>\n\t <th>For Patient Id</th>\n\t <th>Payment Policy</th>\n\t <th>Accept Orders</th>\n\t </tr>\n\t </thead>\n\t\t\"\n\tend", "title": "" }, { "docid": "21dab610c583cb3016acacbd5308424f", "score": "0.62477964", "text": "def get_ordered_headers\n headers = get_headers\n template_headers = get_template_headers\n ordered_headers = ['druid', 'sourceId']\n # Select only headers with values somewhere in the data\n template_headers.each {|th| ordered_headers << th if headers.include?(th)}\n ordered_headers\n end", "title": "" }, { "docid": "ee822c9fd9d40d075598fb4f2fd7b4f2", "score": "0.6240488", "text": "def header_code(table)\n return \"'<thead><tr>' + \"+columns_to_cells(table, :header, :id=>table.name)+\" + '</tr></thead>'\"\n end", "title": "" }, { "docid": "597c96f591d19c4934b05741c9cc5c8e", "score": "0.62399244", "text": "def extract_heads(name_table)\n headers = CSV.read(name_table, { :headers => true, :skip_blanks => true, encoding:'iso-8859-1:utf-8',:row_sep => :auto, :col_sep => \";\"}).headers\n @heads = headers\n end", "title": "" }, { "docid": "f748315b42286c555b88b1cb384944f8", "score": "0.62396365", "text": "def table(header, body)\n \"<div class='table-wrap'>\" \\\n \"<table class='table'>\" \\\n \"<thead>#{header}</thead>\" \\\n \"<tbody>#{body}</tbody>\" \\\n \"</table>\" \\\n \"</div>\"\n end", "title": "" }, { "docid": "0ccc4f3bbd2b3d20a07cdc7d9513c60a", "score": "0.62380415", "text": "def indices_table_header( query_command )\n preferences = query_command.preferences\n if preferences.compare_areas?\n colspan = query_command.data_columns_count\n label_0 = preferences.selected_location_name( preferences.search_id( 0 ) )\n label_1 = preferences.selected_location_name( preferences.search_id( 1 ) )\n end\n\n capture do\n if preferences.compare_areas?\n concat content_tag( :colgroup, \"\", span: 1, class: \"column-date\" )\n concat content_tag( :colgroup, \"\", span: colspan, class: \"column-location column-location-1\" )\n concat content_tag( :colgroup, \"\", span: colspan, class: \"column-location column-location-2\" )\n end\n\n concat(\n content_tag( :thead ) do\n\n # location headings\n if preferences.compare_areas?\n concat(\n content_tag( :tr ) do\n content_tag( :th ) +\n content_tag( :th, label_0, colspan: colspan, class: \"text-center\" ) +\n content_tag( :th, label_1, colspan: colspan, class: \"text-center\" )\n end\n )\n end\n\n # column headings\n concat(\n content_tag( :tr ) do\n query_command.columns.each_with_index do |col, i|\n concat(\n content_tag( :th, class: (i > 0) ? \"text-right\" : \"text-center\",\n \"data-location\" => col[:location],\n \"data-type\" => col[:sType],\n \"data-aspect\" => col[:aspect]\n ) do\n col[:label]\n end\n )\n end\n end\n )\n end\n )\n end #/capture\n end", "title": "" }, { "docid": "e75612c85e8fe45387941786895c4c34", "score": "0.62356365", "text": "def to_s\n result = @headers.join(\"\\t\") << \"\\n\"\n \n @table[@headers.first].each_index do |index|\n @headers.each do |col|\n result << @table[col][index].to_s\n unless col == @headers.last\n result << \"\\t\"\n else\n result << \"\\n\"\n end\n end\n end\n result\n end", "title": "" }, { "docid": "9a7156ef50ed33c7556d2389ac809ce0", "score": "0.6235219", "text": "def table(header, body)\n \"<table class=\\\"content-table\\\"><thead>\\n#{header}</thead><tbody>\\n#{body}</tbody></table>\\n\"\n end", "title": "" }, { "docid": "9a7156ef50ed33c7556d2389ac809ce0", "score": "0.6235219", "text": "def table(header, body)\n \"<table class=\\\"content-table\\\"><thead>\\n#{header}</thead><tbody>\\n#{body}</tbody></table>\\n\"\n end", "title": "" }, { "docid": "32300db86eb9817a499c8c6c0ed04329", "score": "0.6233605", "text": "def index_table_header(model_class, column_set)\n content_tag(:thead) do\n content_tag(:tr) do\n column_set.map do |column|\n \t\t\t\t\t# sortable column\n if column[:sortable] && Ponteggio::USE_SEARCHLOGIC\n content_tag(\n :th,\n order(\n @search,\n :by => column[:key].to_s,\n :as => column[:name] \n )\n ) \n \t\t\t\t\t# this isn't a sortable column\n else\n content_tag(:th, column[:name])\n end \n \t\t\t\t# add column for buttons in the index list\n end * \"\\n\" + tag(:th)\n end\n end\n end", "title": "" }, { "docid": "fd9f7a0cc849109d5afa1970e59fe4b4", "score": "0.6232391", "text": "def header\n temp = \"\"\n result = \"SpecId\\tLabel\\tCharge\\t\"\n \n nokogiriDoc(@target).xpath(\"//xmlns:SpectrumIdentificationItem\").each do |hit|\n temp = hit.xpath(\".//xmlns:cvParam\")\n break\n end\n \n temp.each do |score|\n result += score.xpath(\"./@name\").to_s + \"\\t\"\n end\n \n result += \"Peptide\\t\" + \"Proteins\"\n end", "title": "" }, { "docid": "c58afead609995499df47ecaec14a452", "score": "0.6228462", "text": "def charge_summary_table_headers\n charge_summary_table.headers_text\n end", "title": "" }, { "docid": "e0cf1b3f8b3dc7ba0b84b2f0bd796841", "score": "0.62281746", "text": "def results_head(arr, count)\n temp = Array.new\n arr.map do |x|\n # add <span class='glyphicon glyphicon-sort'></span> in th for arrows\n # for sort\n temp.push(\"<th class= 'col#{ count }'>#{ name_modifier(x) }</th>\")\n count += 1\n end\n temp.join\n end", "title": "" }, { "docid": "03335f99e41032131bcec6d3782a9ec6", "score": "0.6214102", "text": "def render_header(h)\n unless @no_headers \n h.thead {\n h.tr {\n @column_order.each { |c| h.th(@labels[c] || c.to_s.humanize) }\n }\n }\n end\n end", "title": "" }, { "docid": "996489c2e988854f568ece73a987690a", "score": "0.62073654", "text": "def tr_head(params, table, url, headings)\n\tif not headings.is_a? Array then return self end\n\n\tappend({\n\t\t'tag' => \"TR\", \n\t\t'attributes' => {\n\t\t\t'class' => \"head\",\n\t\t}\n\t})\n\n\theadings.each do |p|\n\t\tdowns = p.downcase\n\t\theading = Dynamo.new.append(p)\n\t\torder = 'asc'\n\t\tif (downs == params[\"#{table}_sortby\"]) then\n\t\t\theading.wrap(\"STRONG\")\n\t\t\tif params[\"#{table}_order\"] == \"asc\" then order = \"des\" end\n\t\tend\n\n\t\tcontent = Dynamo.new.a_href(heading.to_s, \"#{url}\", {\n\t\t\t\"#{table}_sortby\" => downs,\n\t\t\t\"#{table}_order\" => order,\n\t\t\t\"#{table}\" => true,\n\t\t})\n\n\t\tappend({\n\t\t\t'tag' => \"TD\",\n\t\t\t'content' => content.to_s,\n\t\t\t'attributes' => {\n\t\t\t\t'class' => p,\n\t\t\t},\n\t\t})\n\tend\n\tappend(\"</TR>\\n\")\n\n\tself\nend", "title": "" }, { "docid": "0560dbceb9da4f516ce07d21f7157fe5", "score": "0.6202293", "text": "def merge_headers(head1, head2, sepr=\"\", open=\"\", close=\"\")\n merged_arr = head1.zip(head2) #merges 2 headers (arrays) together into a \"2D\" array\n\n merged_str = []\n #converts merged array into a string (with optional seperator and opening/closeing containers)\n merged_arr.each do |h1,h2|\n if (h1.empty? and h2.empty?)\n h3 = '\"\"' #empty double header cells should stay empty\n else\n h3 = h1 + sepr + open + h2 + close\n end\n merged_str << h3\n end\n return merged_str\nend", "title": "" }, { "docid": "d95570a62b8d47d6e54d012871fab1e0", "score": "0.6201605", "text": "def meter_header( range )\n content_tag( :tr ) do\n concat content_tag( :th )\n range.to_a.reverse.each { |date| concat content_tag( :th, date.strftime( '%-m/%-d/%y' ) ) }\n end\n end", "title": "" }, { "docid": "a1f73d3c8b30b966ffb26ed1e6dbe22b", "score": "0.62009734", "text": "def headings\n headings_row.css('th').map { |th| th.text.scan(/\\w|\\s|#/).join }\n end", "title": "" }, { "docid": "ae9c324f191580ff7f67bb7667855120", "score": "0.61996526", "text": "def summary_table_headers(args={})\n\t\t'''\n\t\t\t<thead>\n\t <tr>\n\t <th>Created At</th>\n\t <th>Amount</th>\n\t <th>For Report Id</th>\n\t <th>For Report Name</th>\n\t <th>Payment Type</th>\n\t <th>Payment Mode</th>\n\t <th>Options</th>\n\t </tr>\n\t </thead>\n\t\t'''\n\tend", "title": "" }, { "docid": "6009f3d493a77ee3bf5d997991ccfe68", "score": "0.6197476", "text": "def summary_table_headers(args={})\n\t\t'''\n\t\t\t<thead>\n\t <tr>\n\t <th>Min Age</th>\n\t <th>Max Age</th>\n\t <th>Sex</th>\n\t <th>Min Value</th>\n\t <th>Max Value</th>\n\t <th>Text Value</th>\n\t <th>Options</th>\n\t </tr>\n\t </thead>\n\t\t'''\n\tend", "title": "" }, { "docid": "09183828e36c4ab0af21c03bdb022291", "score": "0.61903656", "text": "def table\n table_helper(\"\", @head)\n return @table\n end", "title": "" }, { "docid": "f18352313390040391079e613480939d", "score": "0.618858", "text": "def data\n (header && !header.empty?) ? [header] + rows : rows\n end", "title": "" }, { "docid": "aa3ef32809e36886baaffbd410c66f12", "score": "0.61867946", "text": "def headers\n fields.map(&:name).map(&:to_sym)\n end", "title": "" } ]
55b95891a387082e2e525e5533ba3593
Parse any other arguments used by agent
[ { "docid": "0c36b7a23d61eec6f0fd6bb77105c3e1", "score": "0.7149949", "text": "def parse_other_args(opts, options)\n end", "title": "" } ]
[ { "docid": "9a4708b3fb6165f5109a98d693196748", "score": "0.7965469", "text": "def parse_args(args); end", "title": "" }, { "docid": "3467c2a830c3cc1b5cc0027c98e7273e", "score": "0.72011936", "text": "def parse_arguments\n @parser.parse\n @cmd = @parser.command\n end", "title": "" }, { "docid": "b5b61ef4df09ae8ab3563648759dd6c3", "score": "0.7112902", "text": "def parse_args\n parser = Trollop::Parser.new do\n opt :username, \"\", :type => :string\n opt :email, \"\", :type => :string\n opt :uuid, \"\", :type => :string, :short => \"-i\"\n opt :superuser\n opt :profile, \"\", :type => :string\n opt :force\n version \"\"\n end\n\n parse do\n parser.parse\n end\n end", "title": "" }, { "docid": "b5113158d1685fa468b6cec8968eaebe", "score": "0.70973516", "text": "def parse_arguments(args)\n args = expand_multi_flags(args)\n args = extract_options(args)\n extract_args(args)\n end", "title": "" }, { "docid": "568b32dcf697438aa0fac40e342515a9", "score": "0.7088671", "text": "def parse(*args); end", "title": "" }, { "docid": "5a7e96d7254358509a238283a7f32ff1", "score": "0.7086484", "text": "def parse! args\n get_options args, true\n end", "title": "" }, { "docid": "85c6e331f7d5fb5073ad093cfe784f48", "score": "0.70680296", "text": "def parse(args)\n bypass_parsing(args)\n end", "title": "" }, { "docid": "771b251a03bdf36232c6c24528fd0e2e", "score": "0.705932", "text": "def parse_args\n options = { :agent_name => 'instance', :verbose => false }\n\n parser = Trollop::Parser.new do\n opt :level, \"\", :type => String, :long => \"--log-level\", :short => \"-l\"\n opt :verbose\n version \"\"\n end\n\n begin\n options.merge!(parser.parse)\n if options[:level]\n fail(\"Invalig log level '#{options[:level]}'\") unless AgentManager::LEVELS.include?(options[:level].to_sym)\n end\n options\n rescue Trollop::HelpNeeded\n write_output(Usage.scan(__FILE__))\n exit\n rescue Trollop::VersionNeeded\n write_output(version)\n succeed\n rescue SystemExit => e\n raise e\n rescue Exception => e\n write_output(e.message + \"\\nUse --help for additional information\")\n exit(1)\n end\n end", "title": "" }, { "docid": "6486b8733ac5e3617f80d203df4c7aeb", "score": "0.70428437", "text": "def parse_args\n parser = Trollop::Parser.new do\n opt :action, \"\", :type => :string\n opt :boot, \"\"\n end\n\n parse do\n parser.parse\n end\n end", "title": "" }, { "docid": "6486b8733ac5e3617f80d203df4c7aeb", "score": "0.70428437", "text": "def parse_args\n parser = Trollop::Parser.new do\n opt :action, \"\", :type => :string\n opt :boot, \"\"\n end\n\n parse do\n parser.parse\n end\n end", "title": "" }, { "docid": "9417b62b0a1c260539b1cb0803d6f65a", "score": "0.70214003", "text": "def parse_args\n options = {}\n options[:agent] = ARGV[0]\n options[:options] = {}\n options[:quiet] = false\n fail('No agent specified on the command line.', print_usage=true) if options[:agent].nil?\n\n opts = OptionParser.new do |opts|\n parse_common(opts, options)\n parse_other_args(opts, options)\n\n opts.on('-a', '--actors-dir DIR') do |d|\n options[:actors_dir] = d\n end\n\n opts.on('-q', '--shared-queue QUEUE') do |q|\n options[:shared_queue] = q\n end\n\n opts.on('-z', '--pid-dir DIR') do |d|\n options[:pid_dir] = d\n end\n\n opts.on('-w', '--monit') do\n options[:monit] = true\n end\n\n opts.on('-P', '--http-proxy PROXY') do |proxy|\n options[:http_proxy] = proxy\n end\n\n opts.on('--no-http-proxy NOPROXY') do |no_proxy|\n options[:no_http_proxy] = no_proxy\n end\n\n opts.on('-o', '--options OPT') do |e|\n fail(\"Invalid option definition '#{e}' (use '=' to separate name and value)\") unless e.include?('=')\n key, val = e.split(/=/)\n options[:options][key.gsub('-', '_').to_sym] = val\n end\n\n opts.on('-Q', '--quiet') do\n options[:quiet] = true\n end\n\n opts.on_tail('--help') do\n RDoc::usage_from_file(__FILE__)\n exit\n end\n end\n begin\n opts.parse!(ARGV)\n rescue Exception => e\n puts e.message + \"\\nUse rad --help for additional information\"\n end\n resolve_identity(options)\n options\n end", "title": "" }, { "docid": "ef4c4b3e610769aa55243ac93b8e2b9f", "score": "0.7006517", "text": "def parse_arguments\n expect_exactly(0, \"arguments\")\n end", "title": "" }, { "docid": "a7cda539ced3178c59d5f4eec31a4ac0", "score": "0.6991863", "text": "def parse_args\n options = { :agent_name => 'instance', :verbose => false }\n\n opts = OptionParser.new do |opts|\n\n opts.on('-l', '--log-level LEVEL') do |l|\n fail(\"Invalid log level '#{l}'\") unless AgentManager::LEVELS.include?(l.to_sym)\n options[:level] = l\n end\n\n opts.on('-v', '--verbose') do\n options[:verbose] = true\n end\n\n end\n\n opts.on_tail('--help') do\n puts Usage.scan(__FILE__)\n exit\n end\n\n begin\n opts.parse!(ARGV)\n rescue Exception => e\n puts e.message + \"\\nUse --help for additional information\"\n exit(1)\n end\n options\n end", "title": "" }, { "docid": "b0d8c7354cc35f742bbb5ee90d1bc47e", "score": "0.696756", "text": "def parse_arguments arguments\n Parser::parse_arguments(arguments)\n end", "title": "" }, { "docid": "58272dd725358ef851e0b5bca0092e0f", "score": "0.6891479", "text": "def parse_args\n @node_name = @name_args[0]\n @attr_path = @name_args[1]\n option_assert(@node_name, 'You must specify a node name')\n option_assert(\n @attr_path, 'You must specify an encrypted attribute name'\n )\n @attr_ary = attribute_path_to_ary(@attr_path)\n\n assert_valid_args\n end", "title": "" }, { "docid": "b2a49ba0793c885f3e9585c9dd6e2f9e", "score": "0.686985", "text": "def parse_arguments(*args)\n assert_presence_of *args\n required.each_with_index do |req, indx|\n api.set req, args[indx]\n end\n check_requirement!(*args)\n end", "title": "" }, { "docid": "b8f681e7bbefc4c96f430b2b4a4a3868", "score": "0.68586046", "text": "def parse_arguments()\n ARGV << '-h' if ARGV.empty?\n\n options = {}\n\n OptionParser.new do |opt|\n opt.on('--automation-assume-role AUTOMATION_ASSUME_ROLE') {\n |o| options[:automation_assume_role] = o\n }\n opt.on('--instance-iam-role INSTANCE_IAM_ROLE') {\n |o| options[:instance_iam_role] = o\n }\n opt.on('--source-ami-id SOURCE_AMI_ID') {\n |o| options[:source_ami_id] = o\n }\n end.parse!\n\n for item in ['automation_assume_role', 'instance_iam_role', 'source_ami_id']\n if not options.key?(item.to_sym)\n raise OptionParser::MissingArgument.new(item)\n end\n end\n\n return options\nend", "title": "" }, { "docid": "621a0446894d8d5e3796ce50dcff7243", "score": "0.6823095", "text": "def parse_arguments(args)\n ret = {}\n ret[\"timeout\"] = 15\n op = OptionParser.new do |opts|\n opts.banner = \"Usage: #{__FILE__} [options]\"\n opts.separator \"\"\n opts.separator \"Specific options:\"\n\n opts.on(\"-a\", \"--argument=[JSON]\",\n \"Pass the supplied JSON data over the bridge\") do |v|\n ret[\"argument\"] = v\n end\n\n opts.on(\"-b\", \"--b64argument=[B64-JSON]\",\n \"Pass the base64-encoded JSON data over the bridge\") do |v|\n ret[\"b64argument\"] = v\n end\n\n opts.on(\"-s\", \"--selector=SELECTOR\",\n \"Call the given function (selector) via the bridge\") do |v|\n ret[\"selector\"] = v\n end\n\n opts.on(\"-c\", \"--callUID=UID\",\n \"Use the given UID to properly identify the return value of this call\") do |v|\n ret[\"callUID\"] = v\n end\n\n opts.on(\"-r\", \"--hardwareID=[HARDWAREID]\",\n \"If provided, connect to the physical iOS device with this hardware ID instead of a simulator\") do |v|\n ret[\"hardwareID\"] = v\n end\n\n opts.on(\"-t\", \"--timeout=[TIMEOUT]\",\n \"The timeout in seconds for reading a response from the bridge (default 15)\") do |v|\n ret[\"timeout\"] = v.to_i\n end\n\n opts.on(\"-p\", \"--plaintext\",\n \"Whether to print the output in plain (JSON) text, instead of base-64\") do |v|\n ret[\"plaintext\"] = v\n end\n\n opts.on_tail(\"-h\", \"--help\", \"Show this message\") do\n puts opts\n exit\n end\n\n end\n op.parse!(args)\n return ret\nend", "title": "" }, { "docid": "3dd83873242a30dba058d0243a68dd67", "score": "0.68119824", "text": "def args\n parsed_args = {}\n\n parser = OptionParser.new do |option|\n option.on('--program PROGRAM_NAME') { |value| parsed_args[:program_name] = value }\n option.on('--type REPORT_TYPE') { |value| parsed_args[:report_type] = value }\n option.on('--start-date DATE') { |value| parsed_args[:start_date] = value }\n option.on('--end-date DATE') { |value| parsed_args[:end_date] = value }\n end\n\n parser.parse!\n parsed_args\nend", "title": "" }, { "docid": "f4dc37bcf59ae41535b0d337d843eb45", "score": "0.6800801", "text": "def parse_args\r\n if (cmd.args =~ /=/)\r\n args = cmd.parse_args(ArgParser.arg1_equals_arg2)\r\n self.name = titlecase_arg(args.arg1)\r\n self.stance = titlecase_arg(args.arg2)\r\n else\r\n self.name = enactor.name\r\n self.stance = titlecase_arg(cmd.ars)\r\n end\r\n\r\n if (self.stance)\r\n self.stance = Battle.stances.keys.select { |s| s.start_with? self.stance }.first\r\n end\r\n end", "title": "" }, { "docid": "d9be80d4a2c98d33b355c63678df473f", "score": "0.67884284", "text": "def parse(args)\n raise NotImplementedError\n end", "title": "" }, { "docid": "5e666714e163643abb384be093269eaf", "score": "0.67881674", "text": "def parse(args)\n @opt_parser.parse(args)\n end", "title": "" }, { "docid": "5e666714e163643abb384be093269eaf", "score": "0.67881674", "text": "def parse(args)\n @opt_parser.parse(args)\n end", "title": "" }, { "docid": "5e666714e163643abb384be093269eaf", "score": "0.67881674", "text": "def parse(args)\n @opt_parser.parse(args)\n end", "title": "" }, { "docid": "f37ff4ded2460734618a056f6ebc024e", "score": "0.6785927", "text": "def parse_args(args, receiver)\n invalid_args!(args) if args.size > (1+arguments.size)\n\n # Merge default and provided options\n optargs = default_options\n if args.size == (1+arguments.size)\n invalid_args!(args) unless args.last.is_a?(Hash)\n optargs = optargs.merge(args.pop)\n end\n\n # Set options\n optargs.each_pair do |name,val|\n receiver.send(:\"#{name}=\", val)\n end\n \n # Parse other arguments now\n parse_xxx(args, :coerce) do |name,val|\n receiver.send(:\"#{name}=\", val)\n end\n end", "title": "" }, { "docid": "606568c029ddaf90860d1546d26027bc", "score": "0.676554", "text": "def parse_other_args(opts, options)\n opts.on(\"-d\", \"--decommission [AGENT]\") do |a|\n options[:action] = 'decommission'\n options[:agent_name] = a || 'instance'\n options[:thin_command_client] = true\n end\n\n opts.on(\"-S\", \"--shutdown [AGENT]\") do |a|\n options[:action] = 'shutdown'\n options[:agent_name] = a || 'instance'\n options[:thin_command_client] = true\n end\n end", "title": "" }, { "docid": "e0666876515c0daeab89a6ad70638bfe", "score": "0.6754024", "text": "def parse_yardopts_options(*args); end", "title": "" }, { "docid": "b4b70449cb3037ec9220aa1c17595066", "score": "0.67460406", "text": "def parse_args\n require 'optimist'\n opts = Optimist.options do\n opt :source, \"Inventory Source UID\", :type => :string, :required => ENV[\"SOURCE_UID\"].nil?, :default => ENV[\"SOURCE_UID\"]\n opt :ingress_api, \"Hostname of the ingress-api route\", :type => :string, :default => ENV[\"INGRESS_API\"] || \"http://localhost:9292\"\n opt :config, \"Configuration file name\", :type => :string, :default => ENV[\"CONFIG\"] || \"default\"\n end\n\n opts\nend", "title": "" }, { "docid": "54e3e782598bb474c69b52a7b88e473c", "score": "0.672929", "text": "def parse_arguments\n\n\t\tif parsed_options? && arguments_valid? \n\n\t\t\tprocess_arguments \n\n\t\telse\n\t\t\toutput_usage\n\t\tend\n\n\tend", "title": "" }, { "docid": "6e1a2b5673be272a8afea9575fbd17dd", "score": "0.67205435", "text": "def parse_args\n options = { :verbose => false }\n\n opts = OptionParser.new do |opts|\n\n opts.on('-l', '--log-level LEVEL') do |l|\n fail(\"Invalid log level '#{l}'\") unless AgentManager::LEVELS.include?(l.to_sym)\n options[:level] = l\n end\n\n opts.on('-v', '--verbose') do\n options[:verbose] = true\n end\n\n end\n\n opts.on_tail('--version') do\n puts version\n exit\n end\n\n opts.on_tail('--help') do\n RDoc::usage_from_file(__FILE__)\n exit\n end\n\n begin\n opts.parse!(ARGV)\n rescue Exception => e\n puts e.message + \"\\nUse --help for additional information\"\n end\n options\n end", "title": "" }, { "docid": "595f73ffba080146c350c8b7bb36d407", "score": "0.671498", "text": "def parse_args(args)\n case args\n when String\n args\n when Hash\n args[:url]\n when Array\n args.first\n end\n end", "title": "" }, { "docid": "8fcd692f7336fb06f117db1093d61a53", "score": "0.6700911", "text": "def parse_args\r\n self.type = cmd.args ? titlecase_arg(cmd.args) : \"Real\"\r\n end", "title": "" }, { "docid": "a0f1267129073a5b905c399d0c4039be", "score": "0.67002684", "text": "def parse_options(opts, args); end", "title": "" }, { "docid": "e25e045bf3275c06c22b8d4252f58e3e", "score": "0.6698238", "text": "def parse_args\n defaults = {\n :scheme => 'https',\n :host => 'dev-ansibletower-3-2.cloudforms.lab.eng.rdu2.redhat.com',\n :port => 443,\n :user => 'admin',\n :password => 'smartvm',\n :ingress_api => 'http://localhost:9292'\n }\n\n require 'optimist'\n opts = Optimist.options do\n opt :source, \"Inventory Source UID\", :type => :string, :required => ENV[\"SOURCE_UID\"].nil?, :default => ENV[\"SOURCE_UID\"]\n opt :scheme, \"Protocol scheme for connecting to the AnsibleTower REST API, default: https\", :type => :string, :required => ENV[\"ENDPOINT_SCHEME\"].nil?, :default => ENV[\"ENDPOINT_SCHEME\"] || defaults[:scheme]\n opt :host, \"IP address or hostname of the Ansible Tower REST API\", :type => :string, :required => ENV[\"ENDPOINT_HOST\"].nil?, :default => ENV[\"ENDPOINT_HOST\"] || defaults[:host]\n opt :user, \"Username to AnsibleTower\", :type => :string, :required => ENV[\"ENDPOINT_USER\"].nil?, :default => ENV[\"ENDPOINT_USER\"] || defaults[:user]\n opt :password, \"Password to Ansible Tower\", :type => :string, :required => ENV[\"ENDPOINT_PASSWORD\"].nil?, :default => ENV[\"ENDPOINT_PASSWORD\"] || defaults[:password]\n opt :ingress_api, \"Hostname of the ingress-api route\", :type => :string, :default => ENV[\"INGRESS_API\"] || defaults[:ingress_api]\n end\n\n opts\nend", "title": "" }, { "docid": "2844aac811dc23bd0ed54b8e089d1dc8", "score": "0.66892874", "text": "def parse_args\r\n args = Args.new\r\n args.server_host_override = ''\r\n OptionParser.new do |opts|\r\n opts.on('--oauth_scope scope',\r\n 'Scope for OAuth tokens') { |v| args['oauth_scope'] = v }\r\n opts.on('--server_host SERVER_HOST', 'server hostname') do |v|\r\n args['server_host'] = v\r\n end\r\n opts.on('--default_service_account email_address',\r\n 'email address of the default service account') do |v|\r\n args['default_service_account'] = v\r\n end\r\n opts.on('--server_host_override HOST_OVERRIDE',\r\n 'override host via a HTTP header') do |v|\r\n args['server_host_override'] = v\r\n end\r\n opts.on('--server_port SERVER_PORT', 'server port') do |v|\r\n args['server_port'] = v\r\n end\r\n # instance_methods(false) gives only the methods defined in that class\r\n test_cases = NamedTests.instance_methods(false).map(&:to_s)\r\n test_case_list = test_cases.join(',')\r\n opts.on('--test_case CODE', test_cases, {}, 'select a test_case',\r\n \" (#{test_case_list})\") { |v| args['test_case'] = v }\r\n opts.on('--use_tls USE_TLS', ['false', 'true'],\r\n 'require a secure connection?') do |v|\r\n args['secure'] = v == 'true'\r\n end\r\n opts.on('--use_test_ca USE_TEST_CA', ['false', 'true'],\r\n 'if secure, use the test certificate?') do |v|\r\n args['use_test_ca'] = v == 'true'\r\n end\r\n end.parse!\r\n _check_args(args)\r\nend", "title": "" }, { "docid": "0c49d9af35f5085e81c3d7bd2e88073e", "score": "0.66789144", "text": "def parse_args\r\n self.scene_id = integer_arg(cmd.args)\r\n end", "title": "" }, { "docid": "4311c05d89addf742d2504aad62bd1c4", "score": "0.6676531", "text": "def parse_args\n args = Args.new\n args['fail_on_failed_rpcs'] = false\n args['num_channels'] = 1\n args['rpc'] = 'UnaryCall'\n args['metadata'] = ''\n OptionParser.new do |opts|\n opts.on('--fail_on_failed_rpcs BOOL', ['false', 'true']) do |v|\n args['fail_on_failed_rpcs'] = v == 'true'\n end\n opts.on('--num_channels CHANNELS', 'number of channels') do |v|\n args['num_channels'] = v.to_i\n end\n opts.on('--rpc RPCS_TO_SEND', 'list of RPCs to send') do |v|\n args['rpc'] = v\n end\n opts.on('--metadata METADATA_TO_SEND', 'metadata to send per RPC') do |v|\n args['metadata'] = v\n end\n opts.on('--server SERVER_HOST', 'server hostname') do |v|\n GRPC.logger.info(\"ruby xds: server address is #{v}\")\n args['server'] = v\n end\n opts.on('--stats_port STATS_PORT', 'stats port') do |v|\n GRPC.logger.info(\"ruby xds: stats port is #{v}\")\n args['stats_port'] = v\n end\n opts.on('--qps QPS', 'qps') do |v|\n GRPC.logger.info(\"ruby xds: qps is #{v}\")\n args['qps'] = v\n end\n end.parse!\n args\nend", "title": "" }, { "docid": "47accc405dae65724d59352b4df1ba06", "score": "0.66706526", "text": "def parse_cli_arguments( args )\n # Parse run_id\n run_id = parse_run_id_from args\n # Extract parameters\n params = parse_cli_parameters args\n # Check that we are not using 'with' and 'without' options at the same time\n unless params[:with].empty? || params[:without].empty?\n raise StandardError.new 'You can\\'t use both --with and --without at the same time'\n end\n return run_id, params\n end", "title": "" }, { "docid": "1abdeeb632d4a844bd5d93a01b362ab7", "score": "0.66605806", "text": "def parse(args)\n if args.size == 1 && args[0].is_a?(String)\n global_opt, parsed_options, args = parse_options Shellwords.shellwords(args[0])\n # last string argument interpreted as args + options\n elsif args.size > 1 && args[-1].is_a?(String)\n temp_args = Runner.in_shell? ? args : Shellwords.shellwords(args.pop)\n global_opt, parsed_options, new_args = parse_options temp_args\n Runner.in_shell? ? args = new_args : args += new_args\n # add default options\n elsif @command.options.to_s.empty? || (!@command.has_splat_args? &&\n args.size <= (@command.arg_size - 1).abs) || (@command.has_splat_args? && !args[-1].is_a?(Hash))\n global_opt, parsed_options = parse_options([])[0,2]\n # merge default options with given hash of options\n elsif (@command.has_splat_args? || (args.size == @command.arg_size)) && args[-1].is_a?(Hash)\n global_opt, parsed_options = parse_options([])[0,2]\n parsed_options.merge!(args.pop)\n end\n [global_opt || {}, parsed_options, args]\n end", "title": "" }, { "docid": "23a5a5e6395b0708182574cad9acf65e", "score": "0.66601455", "text": "def parse_arguments(args)\n args.select { |a| a != 'and' }\n end", "title": "" }, { "docid": "55b5326ae8527706b1edb7596c985993", "score": "0.6658868", "text": "def parse_parameters\n @action = param(:action)\n @alias = param(:alias)\n @command = param(:command).join(\" \")\n end", "title": "" }, { "docid": "1c0b12f8f20311af47bc44c855bb4b82", "score": "0.66530156", "text": "def parse_args(args)\r\n opt_parser = OptionParser.new do |opts|\r\n opts.banner = 'Usage: provision.rb [options]'\r\n opts.on('--action [TYPE]', Provisioner.actions(),\r\n 'Select action type (deploy, delete)') do |a|\r\n @options.action = a\r\n end\r\n opts.on('-g', '--github Project/REPO', 'The project/REPO from GitHub you want to build') do |github|\r\n @options.github = github\r\n end\r\n opts.on('-v', '--version VERSION', 'The branch or commit hash to build') do |version|\r\n @options.version = version\r\n end\r\n opts.on(\"--[no-]proxy\", \"boolean for setting up the reverse proxy\", \"true or false.\") do |proxy|\r\n @options.proxy = proxy\r\n end\r\n end\r\n\r\n opt_parser.parse!(args)\r\n missing_args()\r\nend", "title": "" }, { "docid": "a815d131b1ed6244d021a40d0922bd00", "score": "0.6633879", "text": "def parse_args\n parser = Trollop::Parser.new do\n opt :max_attempts, \"\", :default => DEFAULT_MAX_ATTEMPTS, :long => \"--attempts\", :short => \"-a\"\n opt :retry_interval, \"\", :default => DEFAULT_RETRY_INTERVAL\n opt :time_limit, \"\", :type => :int\n opt :daemon, \"\", :long => \"--start\"\n opt :stop\n opt :ping\n opt :verbose\n opt :state_path, \"\", :type => String\n version \"\"\n end\n \n parse do\n options = parser.parse\n options.delete(:max_attempts) unless options[:max_attempts] > 0\n if options[:delete]\n options.delete(:time_limit) unless options[:time_limit] > 0\n end\n options.delete(:retry_interval) unless options[:retry_interval] > 0\n options\n end\n end", "title": "" }, { "docid": "962ade8ef92127d19ade0d2b5bf3463a", "score": "0.6611533", "text": "def parse_args\n args = Args.new('pubsub-staging.googleapis.com',\n 443, 'list_some_topics', 'stoked-keyword-656')\n OptionParser.new do |opts|\n opts.on('--server_host SERVER_HOST', 'server hostname') do |v|\n args.host = v\n end\n opts.on('--server_port SERVER_PORT', 'server port') do |v|\n args.port = v\n end\n\n # instance_methods(false) gives only the methods defined in that class.\n scenes = NamedActions.instance_methods(false).map { |t| t.to_s }\n scene_list = scenes.join(',')\n opts.on(\"--action CODE\", scenes, {}, 'pick a demo action',\n \" (#{scene_list})\") do |v|\n args.action = v\n end\n\n # Set the remaining values.\n %w(project_id topic_name sub_name).each do |o|\n opts.on(\"--#{o} VALUE\", \"#{o}\") do |v|\n args[o] = v\n end\n end\n end.parse!\n _check_args(args)\nend", "title": "" }, { "docid": "2ceab810a3b3a59f8086f727a2af6c7a", "score": "0.6603269", "text": "def parse_args(given_args)\n args, opts = Thor::Options.split(given_args)\n thor_opts = Thor::Options.new(self.class_options)\n parsed_opts = thor_opts.parse(opts)\n\n [ args, parsed_opts ]\n end", "title": "" }, { "docid": "2d01775a9266cc9526ab66d136fcafc1", "score": "0.6590258", "text": "def parse_args\n args = Args.new\n args.server_host_override = ''\n OptionParser.new do |opts|\n opts.on('--oauth_scope scope',\n 'Scope for OAuth tokens') { |v| args['oauth_scope'] = v }\n opts.on('--server_host SERVER_HOST', 'server hostname') do |v|\n args['server_host'] = v\n end\n opts.on('--default_service_account email_address',\n 'email address of the default service account') do |v|\n args['default_service_account'] = v\n end\n opts.on('--server_host_override HOST_OVERRIDE',\n 'override host via a HTTP header') do |v|\n args['server_host_override'] = v\n end\n opts.on('--server_port SERVER_PORT', 'server port') do |v|\n args['server_port'] = v\n end\n # instance_methods(false) gives only the methods defined in that class\n test_cases = NamedTests.instance_methods(false).map(&:to_s)\n test_case_list = test_cases.join(',')\n opts.on('--test_case CODE', test_cases, {}, 'select a test_case',\n \" (#{test_case_list})\") { |v| args['test_case'] = v }\n opts.on('--use_tls USE_TLS', ['false', 'true'],\n 'require a secure connection?') do |v|\n args['secure'] = v == 'true'\n end\n opts.on('--use_test_ca USE_TEST_CA', ['false', 'true'],\n 'if secure, use the test certificate?') do |v|\n args['use_test_ca'] = v == 'true'\n end\n end.parse!\n _check_args(args)\nend", "title": "" }, { "docid": "2e20542dbc3353450e4954dc9f306c38", "score": "0.65780467", "text": "def parse_arguments\n begin\n command ||= ARGV.shift\n argument ||= ARGV.shift\n # puts \"#{command} #{argument} in ARGV\"\n raise InitialArgumentsError, \"Incorrect Number of Arguments:\" unless command || ARGV.empty?\n case command.downcase\n when \"help\"\n help\n when \"list\"\n list_contacts\n when \"show\"\n show_contact(argument) unless argument.nil?\n when \"find\"\n find_contact(argument) unless argument.nil?\n when \"new\"\n new_contact\n else\n raise InitialArgumentsError, \"That command is not available:\"\n end\n rescue InitialArgumentsError, DuplicateEntryError => e\n puts e\n help\n exit\n end\n end", "title": "" }, { "docid": "510e8e5b868c21d9ccb5e631ebb3f032", "score": "0.6550143", "text": "def arguments\n @arguments ||= line.split(/\\s+/, -1)[1..-1]\n end", "title": "" }, { "docid": "6f5bf7cb6dc5f5501e8e72d4ba0652a7", "score": "0.65352815", "text": "def parse_arguments\n @mastermind_arguments = @initial_arguments.take_while { |arg| arg != '--' }\n @plan_arguments = @initial_arguments[(@mastermind_arguments.size + 1)..-1] || []\n\n unless @mastermind_arguments.empty?\n @mastermind_arguments = parser.parse *@mastermind_arguments\n end\n end", "title": "" }, { "docid": "0947194bd55d9faaa025ad49342e2d69", "score": "0.65347", "text": "def parse(args)\n if args.size == 1 && args[0].is_a?(String)\n args = Shellwords.shellwords(args[0]) if !Boson.in_shell\n global_opt, parsed_options, args = parse_options args\n # last string argument interpreted as args + options\n elsif args.size > 1 && args[-1].is_a?(String)\n temp_args = Boson.in_shell ? args : Shellwords.shellwords(args.pop)\n global_opt, parsed_options, new_args = parse_options temp_args\n Boson.in_shell ? args = new_args : args += new_args\n # add default options\n elsif @command.options.nil? || @command.options.empty? ||\n (@command.numerical_arg_size? && args.size <= (@command.arg_size - 1).abs) ||\n (@command.has_splat_args? && !args[-1].is_a?(Hash))\n global_opt, parsed_options = parse_options([])[0,2]\n # merge default options with given hash of options\n elsif (@command.has_splat_args? || (args.size == @command.arg_size)) &&\n args[-1].is_a?(Hash)\n global_opt, parsed_options = parse_options([])[0,2]\n parsed_options.merge!(args.pop)\n end\n [global_opt || {}, parsed_options, args]\n end", "title": "" }, { "docid": "89c6937b83c1d40f01d5d65c9af3af68", "score": "0.6533719", "text": "def parse_args(args)\n [args.shift, args.shift]\n end", "title": "" }, { "docid": "a9ce9bbb42f2de82d431839a1006837a", "score": "0.6519177", "text": "def parse!\n begin\n result = Slop::Parser.new(@opts).parse(@args).to_hash\n ensure_one_option(result)\n result\n rescue Exception => e\n raise\n end\n end", "title": "" }, { "docid": "a5c9fc6c30d5a2ddba266ff49f444ba4", "score": "0.6507842", "text": "def parse_args(args, receiver)\n\n # 1) Check and set operands, passed as an array as first argument\n invalid_args!(args) unless args.first.is_a?(Array)\n receiver.send(:operands=, args.shift.map{|op| Operand.coerce(op)})\n\n # 2) Extract options if provided\n optargs = default_options\n if args.size == (1+arguments.size)\n # options are passed as last argument\n invalid_args!(args) unless args.last.is_a?(Hash)\n optargs = optargs.merge(args.pop)\n elsif args.size > arguments.size\n # too many arguments here\n invalid_args!(args)\n end\n\n # 3) Set options now, including default ones\n optargs.each_pair do |name,val|\n receiver.send(:\"#{name}=\", val)\n end\n\n # 4) Parse other arguments now\n with_each_arg(args) do |name,dom,value|\n invalid_args!(args) if value.nil?\n receiver.send(:\"#{name}=\", value)\n end\n\n receiver\n end", "title": "" }, { "docid": "71d00b519e60d74a746da07e7f9299e6", "score": "0.6497879", "text": "def parse_extra_args(extra={})\n ''\n end", "title": "" }, { "docid": "e1659b33abd83e7b128e160cb4d72044", "score": "0.6497153", "text": "def parse_args(*args)\n [ args.first || {}, args.size > 1 ? args[1] : {} ]\n end", "title": "" }, { "docid": "e1659b33abd83e7b128e160cb4d72044", "score": "0.6497153", "text": "def parse_args(*args)\n [ args.first || {}, args.size > 1 ? args[1] : {} ]\n end", "title": "" }, { "docid": "4320d9cc68c7f2420dc63bea80a69ce6", "score": "0.64938813", "text": "def parse_args(args)\n opts = {}\n args.each do |(k, v)|\n if v.index(\"name=\") == 0\n parts = v.split(\"=\")\n opts[:names] ||= []\n opts[:names] << parts.last\n elsif v.include?(\"=\")\n parts = v.split(\"=\")\n opts[parts.first.to_sym] = parts.last\n elsif k != :suite\n opts[v.to_sym] = true\n end\n end\n opts\n end", "title": "" }, { "docid": "8702c195776654d43fef08af81455677", "score": "0.6493707", "text": "def parse(args)\n @options = args\n end", "title": "" }, { "docid": "cb16797ad28918e1b40f4b6929a05b30", "score": "0.64914995", "text": "def parse_args argv # rubocop:disable Metrics/MethodLength,Metrics/AbcSize\n @option_parser = ::OptionParser.new do |op| # rubocop:disable Metrics/BlockLength\n op.on \"-t\", \"--target TARGET\",\n \"Set the name of the function to execute (defaults to #{DEFAULT_TARGET})\" do |val|\n @target = val\n end\n op.on \"-s\", \"--source SOURCE\",\n \"Set the source file to load (defaults to #{DEFAULT_SOURCE})\" do |val|\n @source = val\n end\n op.on \"--signature-type TYPE\",\n \"Asserts that the function has the given signature type. \" \\\n \"Supported values are 'http' and 'cloudevent'.\" do |val|\n @signature_type = val\n end\n op.on \"-p\", \"--port PORT\", \"Set the port to listen to (defaults to 8080)\" do |val|\n @port = val.to_i\n end\n op.on \"-b\", \"--bind BIND\", \"Set the address to bind to (defaults to 0.0.0.0)\" do |val|\n @bind = val\n end\n op.on \"-e\", \"--environment ENV\", \"Set the Rack environment\" do |val|\n @env = val\n end\n op.on \"--min-threads NUM\", \"Set the minimum threead pool size\" do |val|\n @min_threads = val\n end\n op.on \"--max-threads NUM\", \"Set the maximum threead pool size\" do |val|\n @max_threads = val\n end\n op.on \"--[no-]detailed-errors\", \"Set whether to show error details\" do |val|\n @detailed_errors = val\n end\n op.on \"--verify\", \"Verify the app only, but do not run the server.\" do\n @what_to_do ||= :verify\n end\n op.on \"-v\", \"--verbose\", \"Increase log verbosity\" do\n @logging_level -= 1\n end\n op.on \"-q\", \"--quiet\", \"Decrease log verbosity\" do\n @logging_level += 1\n end\n op.on \"--version\", \"Display the framework version\" do\n @what_to_do ||= :version\n end\n op.on \"--help\", \"Display help\" do\n @what_to_do ||= :help\n end\n end\n begin\n @option_parser.parse! argv\n error! \"Unrecognized arguments: #{argv}\\n#{@option_parser}\", 2 unless argv.empty?\n rescue ::OptionParser::ParseError => e\n error! \"#{e.message}\\n#{@option_parser}\", 2\n end\n self\n end", "title": "" }, { "docid": "a8d347460502669305c39bc9fd97c1d6", "score": "0.6482763", "text": "def parse(args)\n raise \"Parser has finished\" if @finished\n Array(args).each do |arg|\n @parsed_args << arg\n unless @tool.argument_parsing_disabled?\n check_flag_value(arg) || check_flag(arg) || handle_positional(arg)\n end\n end\n self\n end", "title": "" }, { "docid": "c39f96a8abecfd7029042806828fa14c", "score": "0.6473851", "text": "def parse_args(args = [ ])\n ret = {\n :infile => nil,\n :printer => :to_json,\n :query => nil\n }\n\n n = 0\n while (n < args.length)\n arg = args[n]\n\n if (arg[0] == '-')\n if (arg[1] == '-') # Long-form args.\n check = self.check_long_arg(arg[2, (arg.length - 2)].downcase)\n else # Short-form args.\n check = self.check_short_arg(arg[1, (arg.length - 1)].downcase)\n end\n\n if (check.is_a?(Hash))\n if (check.has_key?(:query))\n if (check[:query] == :next)\n # For now, just collect the rest of the args. @TODO\n ret[:query] = Query.new(args.slice((n + 1), (args.length - (n + 1))).join(' '))\n n = args.length\n else\n ret = ret.merge(check)\n end\n else\n ret = ret.merge(check)\n end\n else\n raise RuntimeError.new(\"Weird return from argument scan: `#{check.to_s}`.\")\n end\n else\n ret[:infile] = arg\n end\n\n n += 1\n end\n\n return ret\n end", "title": "" }, { "docid": "e40b71ec6c73b651ce79cf362fef304e", "score": "0.6470907", "text": "def parse_args(*args)\n if args.length == 1 && args.first.is_a?(String)\n args = {url: args.first}\n elsif args.length == 1\n args = args.first\n else\n raise \"Invalid arguments: '#{args.class.name}'\"\n end\n\n raise \"Invalid URL: '#{args[:url]}'\" if args[:url] != \"\" && args[:url].to_s.split(\"\\n\").length != 1\n\n args\n end", "title": "" }, { "docid": "b8f0c965067f9147d2eeeff1a951327d", "score": "0.6470462", "text": "def parse(args)\n @valid = true\n args = Shellwords::shellwords(args) unless args.kind_of?(Array)\n consumed = []\n option = nil\n \n args.each do |token|\n case token\n when /--help/\n puts help\n exit 0\n\n when /\\A--\\z/\n consumed << token\n break\n\n when /^-(-)?\\w/\n consumed << token\n param = token.sub(/^-(-)?/, '').gsub('-', '_').to_sym\n option = options[param]\n unless option\n @errors[param] = \"Unrecognized parameter\"\n @valid = false\n next\n end\n\n if option.kind_of?(Flag)\n option.process(self, nil)\n option = nil\n end\n else\n if option\n consumed << token\n option.process(self, token)\n option = nil\n end\n end\n end\n\n @remainder = args - consumed\n\n # Find required options that are missing arguments\n options.each do |param, opt|\n if opt.kind_of?(Option) and self.send(opt.long).nil?\n if opt.required?\n @valid = false\n @errors[opt.long.to_sym] = \"Missing required parameter: #{opt.long}\"\n elsif opt.has_default?\n opt.process(self, opt.default)\n end\n end\n end\n end", "title": "" }, { "docid": "598c6af7eeda3cae36298fc10bb45b79", "score": "0.6468557", "text": "def parse\n # @opts = OptionParser.new(&method(:set_opts))\n OptionParser.new do |opts|\n set_opts(opts)\n end.parse!(@args)\n\n process_args\n\n @options\n end", "title": "" }, { "docid": "598c6af7eeda3cae36298fc10bb45b79", "score": "0.6468557", "text": "def parse\n # @opts = OptionParser.new(&method(:set_opts))\n OptionParser.new do |opts|\n set_opts(opts)\n end.parse!(@args)\n\n process_args\n\n @options\n end", "title": "" }, { "docid": "ea281b1ee37cebd54290653ed761b98e", "score": "0.6464282", "text": "def parse_args\n bool_flags = build_bool_flags\n input_flags = build_input_flags\n\n OptionParser.new do |opt|\n\n # Customized usage message\n opt.banner = \"Usage: c_list_script.rb [options] [<website>]\\n\\n\"\n\n print ' .'\n\n opt.on('-h', '--help', 'Show this help message') {\n puts ''\n puts opt\n exit\n }\n\n bool_flags.each do |key, lower_hash|\n long = lower_hash[:long]\n desc = lower_hash[:desc]\n hash = lower_hash[:hash]\n array = lower_hash[:sym_hash]\n\n if lower_hash[:short]\n short = lower_hash[:short]\n opt.on(\"#{short}\", \"#{long}\", \"#{desc}\") { |b|\n choose_hash(hash, key, b)\n }\n else\n opt.on(\"#{long}\", \"#{desc}\") { |b|\n\n value = {}\n value[:input] = b\n value[:array] = array if array\n choose_hash(hash, key, value.clone)\n }\n\n end\n end\n\n print ' .'\n\n input_flags.each do |key, lower_hash|\n tag = lower_hash[:tag]\n desc = lower_hash[:desc]\n var = lower_hash[:var]\n hash = lower_hash[:hash]\n\n opt.on(\"#{tag}\", \"#{desc}\") { |o|\n unless /\\A[+-]?\\d+\\z/.match(o)\n puts \"#{var} must be a integer.\"\n puts ''\n puts opt\n exit\n end\n\n o = Integer(o)\n\n if (lower_hash[:range_low] && lower_hash[:range_high])\n range_low = Integer(lower_hash[:range_low])\n range_high = Integer(lower_hash[:range_high])\n if (o < range_low || o > range_high)\n puts \"#{var} must be between #{range_low} and #{range_high} (inclusive).\"\n puts ''\n puts opt\n exit\n end\n elsif (lower_hash[:range_low])\n range_low = Integer(lower_hash[:range_low])\n if (o < range_low)\n puts \"#{var} must be less than #{range_low}.\"\n puts ''\n puts opt\n exit\n end\n elsif (lower_hash[:range_high])\n range_high = Integer(lower_hash[:range_high])\n if (o > range_high)\n puts \"#{var} must be less than #{range_high}.\"\n puts ''\n puts opt\n exit\n end\n end\n\n choose_hash(hash, key, o)\n }\n end\n\n print ' .'\n\n # Special options\n opt.on('--open-house YYYY-MM-DD', 'Filter results by open house date') { |o|\n sale_date = o\n\n if sale_date =~ /(\\d{4})-(\\d{1,2})-(\\d{1,2})/\n year = Integer($1)\n month = Integer($2)\n day = Integer($3)\n else\n puts 'Incorrect Date format.'\n puts ''\n puts opt\n exit\n end\n\n date = Date.new(year, month, day)\n current = Date.today\n sale_date = (date - current).to_i\n\n if sale_date < 0 || sale_date >= 28\n puts 'Date outside valid range.'\n puts ''\n puts opt\n exit\n end\n\n choose_hash(:fill, :sale_date, sale_date)\n }\n\n end.parse!\n\n print \" DONE!\\n\"\n\n ARGV.each do |arg|\n if arg =~ /\\A#{URI::regexp}\\z/\n @website = arg\n end\n end\n\n unless @website\n puts 'URL invalid or not provided. Reverting to default address'\n @website = ADDRESS\n end\n end", "title": "" }, { "docid": "ae9fb767bfc37bd8c6900a3544d8fc73", "score": "0.6460933", "text": "def parse_args\n require 'optimist'\n Optimist.options do\n opt :config, \"Sources configuration YAML file\",\n :type => :string, :default => ENV[\"CONFIG\"]\n opt :source, \"Inventory Source UID\",\n :type => :string, :default => ENV[\"SOURCE_UID\"]\n opt :scheme, \"Protocol scheme for connecting to the AnsibleTower REST API, default: https\",\n :type => :string, :default => ENV[\"ENDPOINT_SCHEME\"] || 'https'\n opt :host, \"IP address or hostname of the Ansible Tower REST API\",\n :type => :string, :default => ENV[\"ENDPOINT_HOST\"]\n opt :user, \"Username to AnsibleTower\",\n :type => :string, :default => ENV[\"AUTH_USERNAME\"]\n opt :password, \"Password to Ansible Tower\",\n :type => :string, :default => ENV[\"AUTH_PASSWORD\"]\n opt :ingress_api, \"Hostname of the ingress-api route\",\n :type => :string, :default => ENV[\"INGRESS_API\"] || \"http://localhost:9292\"\n opt :metrics_port, \"Port to expose the metrics endpoint on, 0 to disable metrics\",\n :type => :integer, :default => (ENV[\"METRICS_PORT\"] || 9394).to_i\n end\nend", "title": "" }, { "docid": "c5fbe40218c16280b60972dc7c3cf01a", "score": "0.64587885", "text": "def cli_arguments; end", "title": "" }, { "docid": "d4a0e8356889f9393e4d2493939177fa", "score": "0.64565474", "text": "def process_arguments\n @r_name = @options.run_name\n @action = @options.action\n end", "title": "" }, { "docid": "78a8f51aaac33e560e0ecaff4126af23", "score": "0.6449671", "text": "def get_args(arguments)\n OptionParser.new do |opts|\n if arguments # Allow users to add their own arguments by passing a hash of arrays\n arguments.each do |var_name,flags|\n opts.on(*flags) do |value|\n if flags[1] and flags[1] =~ /THRESHOLD/i\n instance_variable_set(\"@#{var_name}\", Nagios::Plugin::Threshold.new(value)) unless value.nil?\n else\n instance_variable_set(\"@#{var_name}\", value) unless value.nil?\n end\n end\n end\n end\n\n opts.on('-h', '--help', 'Display this help.') do\n puts \"#{opts}\"\n exit(3)\n end\n\n begin\n opts.parse!\n rescue => e\n puts \"#{e}\\n\\n#{opts}\"\n exit(3)\n end\n end\n end", "title": "" }, { "docid": "9a5fbb955bd29e9a1c75d7196d776bc7", "score": "0.6440985", "text": "def Args(parts); end", "title": "" }, { "docid": "08e88ad759f207d92037776b0ee619ee", "score": "0.6434999", "text": "def parse_arguments\n option_parser.parse! @args\n rescue OptionParser::InvalidOption => e\n output e\n output_and_exit \"\\n#{self.class.help}\", 1\n end", "title": "" }, { "docid": "d3d3e54be80df5bb48c8f44546c97ee6", "score": "0.64337265", "text": "def parse_arguments\n expect_exactly(1, \"files to split\")\n end", "title": "" }, { "docid": "09670cac2646b383af6ff7ae218e0aa3", "score": "0.64291227", "text": "def parse(args)\n die(\"empty argument array\") if args.size == 0\n\n self.program_name = args.shift\n\n while args.size > 0\n arg = args.first\n\n if arg == \"--\"\n args.shift\n break\n end\n\n is_short = arg.size == 2 && arg[0] == \"-\" && arg[1] != \"-\"\n is_long = arg.size > 2 && arg[0,2] == \"--\"\n\n if is_short || is_long\n key = if is_short\n arg[1,2]\n else\n arg[2..]\n end\n\n opt = self.options[key]\n die(\"unknown option \\\"%s\\\"\", key) if opt.nil?\n\n opt.set = true\n\n if opt.value_string.empty?\n args = args[1..]\n else\n die(\"missing value for option \\\"%s\\\"\", key) if args.size < 2\n opt.value = args[1]\n args = args[2..]\n end\n else\n break\n end\n end\n\n if self.arguments.size > 0 && !is_option_set(\"help\")\n last = self.arguments.last\n\n min = self.arguments.size\n min -= 1 if last.trailing\n\n die(\"missing argument(s)\") if args.size < min\n\n min.times do |i|\n self.arguments[i].value = args[i]\n end\n args = args[min..]\n\n if last.trailing\n last.trailing_values = args\n args = args[args.size..]\n end\n end\n\n if self.commands.size > 0\n self.command = self.arguments.first.value\n self.command_arguments = args\n end\n\n if !is_option_set(\"help\")\n if self.commands.size > 0\n cmd = self.commands[self.command]\n if cmd.nil?\n die(\"unknown command \\\"%s\\\"\", self.command)\n end\n elsif args.size > 0\n die(\"invalid extra argument(s)\")\n end\n end\n\n if is_option_set(\"help\")\n print_usage\n exit(0)\n end\n end", "title": "" }, { "docid": "d9d34f9501de71796c4fd95b80cac3ce", "score": "0.64253455", "text": "def parse_args argv # rubocop:disable Metrics/MethodLength\n option_parser = ::OptionParser.new do |op| # rubocop:disable Metrics/BlockLength\n op.on \"-t\", \"--target TARGET\",\n \"Set the name of the function to execute (defaults to #{DEFAULT_TARGET})\" do |val|\n @target = val\n end\n op.on \"-s\", \"--source SOURCE\",\n \"Set the source file to load (defaults to #{DEFAULT_SOURCE})\" do |val|\n @source = val\n end\n op.on \"--signature-type TYPE\",\n \"Asserts that the function has the given signature type.\" \\\n \" Supported values are 'http' and 'cloudevent'.\" do |val|\n @signature_type = val\n end\n op.on \"-p\", \"--port PORT\", \"Set the port to listen to (defaults to 8080)\" do |val|\n @port = val.to_i\n end\n op.on \"-b\", \"--bind BIND\", \"Set the address to bind to (defaults to 0.0.0.0)\" do |val|\n @bind = val\n end\n op.on \"-e\", \"--environment ENV\", \"Set the Rack environment\" do |val|\n @env = val\n end\n op.on \"--min-threads NUM\", \"Set the minimum threead pool size\" do |val|\n @min_threads = val\n end\n op.on \"--max-threads NUM\", \"Set the maximum threead pool size\" do |val|\n @max_threads = val\n end\n op.on \"--[no-]detailed-errors\", \"Set whether to show error details\" do |val|\n @detailed_errors = val\n end\n op.on \"-v\", \"--verbose\", \"Increase log verbosity\" do\n @logging_level -= 1\n end\n op.on \"-q\", \"--quiet\", \"Decrease log verbosity\" do\n @logging_level += 1\n end\n op.on \"--help\", \"Display help\" do\n puts op\n exit\n end\n end\n option_parser.parse! argv\n error \"Unrecognized arguments: #{argv}\\n#{op}\" unless argv.empty?\n self\n end", "title": "" }, { "docid": "b682dce22f03758bbf1b326e1380de09", "score": "0.6424996", "text": "def parse_args\r\n self.name = titlecase_arg(cmd.args)\r\n end", "title": "" }, { "docid": "53695e6e66e4bb3def514861fb9b5a6c", "score": "0.64118385", "text": "def parse_args(args)\n case args.first\n when /^-f|--full$/\n [:full, args[1 .. -1]]\n when /^-b|--brief$/\n [:brief, args[1 .. -1]]\n else\n [:brief, args]\n end\n end", "title": "" }, { "docid": "0732e9e1d35f8658c89658b552eec7b9", "score": "0.6407896", "text": "def parse_arguments\n expect_at_least(2, \"fake arguments\")\n expect_at_most(3, \"fake arguments\")\n end", "title": "" }, { "docid": "9f053e81961f5936a7771d551c1c832b", "score": "0.6403652", "text": "def parse_args\n OptionParser.new do |opts|\n #parse the only argument - file name for cleaning\n opts.on('', '--file FILE', String, 'Specify the file name for cleaning' ) do |file|\n @file = file\n end\n end.parse!\n end", "title": "" }, { "docid": "1434016acf95aec6ce2d6e8c81c3019d", "score": "0.64007604", "text": "def parse_args(args)\n args = [args] if args.is_a?(String)\n usage(\"Invalid arguments.\") unless args.present?\n\n options = OpenStruct.new(process: nil, group: nil, chapter_list: nil)\n options.chapter_list = args.find {|thing| thing.is_a?(Chapters)}\n args.delete(options.chapter_list)\n\n args = args.map(&:to_s).map(&:downcase)\n\n process_arg = get_arg(args, '-p', '--process', nil) || get_unguarded_arg(args)\n if process_arg\n process_sym = process_arg.to_s.downcase.strip.to_sym\n options.process = PROCESSES.detect do |_, match_list|\n match_list.index(process_sym)\n end.try(:first)\n end\n\n\n group_arg = get_arg(args, '-g', '--group', nil) || get_unguarded_arg(args)\n if group_arg\n group_sym = group_arg.to_s.downcase.strip.to_sym\n options.group = FIC_NAME_MAPPING.detect do |_, match_list|\n match_list.index(group_sym)\n end.try(:first)\n end\n\n\n options.extras = args\n\n usage(\"You must provide both a process and a group.\") unless options.process && options.group\n options\nend", "title": "" }, { "docid": "1afdb1b3db0aeae951b0959f1687f6d7", "score": "0.6397578", "text": "def parse_arguments\n @options = OptionParser.new do |opts|\n opts.on('-u', '--graphite-url URL', 'Graphite url') do |graphite_url|\n @graphite_url = graphite_url\n end\n\n opts.on('-t', '--target NAME', Array, 'Target to check') do |targets|\n @targets += targets\n end\n\n opts.on('--empty-ok', 'Empty data from graphite is ok') do\n @empty_ok = true\n end\n\n opts.on('--from TIME', 'set from', 'default: ' + @from) do |from|\n @from = from\n end\n\n opts.on('--until TIME', 'set until', 'default: ' + @until) do |opt_until|\n @until = opt_until\n end\n\n opts.on('-c', '--critical VALUE', Integer, 'Critical if datapoints are lower/higher then threshold') do |critical|\n @critical_level = critical\n end\n\n opts.on('-w', '--warning VALUE', Integer, 'Warning if datapoints are lower/higher then threshold') do |warning|\n @warning_level = warning\n end\n\n opts.on('-p', '--percentage', 'calculate percentage and check against thresholds, requires two targets') do\n @percentage = true\n end\n\n opts.on('-s', '--summarize', 'summarize all targets') do\n @summarize = true\n end\n\n opts.on('--[no-]perfdata', 'add perfdata') do\n @with_perfdata = true\n end\n\n opts.on('--target-name NAME', 'set name of target') do |target_name|\n @target_name = target_name\n end\n\n opts.on('--target-regexp REGEXP', 'slice name of target with regexp to get shorter names') do |regexp|\n @target_regexp = regexp\n end\n\n opts.on('-d', '--debug', 'debug mode') do\n @debug = true\n end\n\n opts.separator \"\nexamples:\n # check target againts thresholds\n #{@script_name} -u http://localhost:8080 -t collectd.host1.memory.percent-used -c 60 -w 40\n\n # calculate percentage from first and second target and check percentage againts thresholds\n #{@script_name} -u http://localhost:8080 -t collectd.host1.GenericJMX-lisu_memory-heap.memory-used,collectd.host1.GenericJMX-lisu_memory-heap.memory-max -p -c 90 -w 80\n\n # check sum of targets against thresholds\n #{@script_name} -u http://localhost:8080 --target=collectd.host1.aggregation-cpu-average.cpu-{system,user} -w 70 -c 90 -s --target-name cpu-usage\n\"\n end\n @options.parse!\n end", "title": "" }, { "docid": "320f9e6eae86c4b47e66379165968cd3", "score": "0.6379962", "text": "def parse!(args=ARGV)\n parser.parse!(args)\n end", "title": "" }, { "docid": "4ad2cecdb18887d3182585993d5318a0", "score": "0.6379902", "text": "def parser=(_arg0); end", "title": "" }, { "docid": "4ad2cecdb18887d3182585993d5318a0", "score": "0.6379902", "text": "def parser=(_arg0); end", "title": "" }, { "docid": "0f7defd703498de0a82eed46bb341297", "score": "0.637873", "text": "def parse_args()\n args = []\n @doc.xpath('/Response/header:Header/Args/Arg', @namespaces).each do |a|\n args << Arg.new(a['key'],\n a['value'],\n a.content)\n end\n\n @result_item.args = args\n end", "title": "" }, { "docid": "08f947e2374e53395a0a903088961b2f", "score": "0.63773745", "text": "def parse_args(*args)\n [args.first || {}, args.size > 1 ? args[1] : {}]\n end", "title": "" }, { "docid": "b82fdd1c5fdcae622ded04bb02846d22", "score": "0.63760793", "text": "def cli_arguments=(_arg0); end", "title": "" }, { "docid": "35b00d2c627343b299fd1fb7808c2f1e", "score": "0.6370138", "text": "def parse(args)\n\t\t# default args\n\t\toptions = OpenStruct.new\n\t\t\n\t\topt_parser = OptionParser.new do |opts|\n\t\t\t\n\t\t\topts.banner = \"Usage #{@name} <URL> [options]\"\n\t\t\topts.separator \"\"\n\t\t\t\n\t\t\t# Mandatory settings\n\t\t\topts.separator \"Mandatory settings:\"\n\t\t\topts.on(\"-w\", \"--wordlist </path/to/file>\", \"Wordlist file (mandatory)\") do |file|\n\t\t\t\toptions.wordlist = file\n\t\t\tend\n\t\t\topts.on(\"-u\", \"--userlist </path/to/file>\", \"User list file (mandatory)\") do |file|\n\t\t\t\toptions.users = file\n\t\t\tend\n\t\t\t\n\t\t\t# Program options\n\t\t\topts.separator \"\"\n\t\t\topts.separator \"Specific options:\"\n\t\t\topts.on(\"-P\", \"--proxy http(s)://<host>:<port>\", \"HTTP proxy to use for requests (Burp Suite?)\") do |proxy|\n\t\t\t\turi = URI.parse(proxy)\n\t\t\t\toptions.proxy_addr = uri.host\n\t\t\t\toptions.proxy_port = uri.port\n\t\t\tend\n\t\t\topts.on(\"-v\", \"--[no-]verbose\", \"Run verbosely\") do |v|\n\t\t\t\tv = true ? $VERBOSE = true : $VERBOSE\n\t\t\tend\n\t\t\t\n\t\t\t# Common options\n\t\t\topts.separator \"\"\n\t\t\topts.separator \"Common options:\"\n\t\t\topts.on_tail(\"-h\", \"--help\", \"Show usage\") do\n\t\t\t\tputs opts\n\t\t\t\texit\n\t\t\tend\n\t\t\topts.on_tail(\"--version\", \"Show version\") do\n\t\t\t\tputs Version\n\t\t\t\texit\n\t\t\tend\n\t\tend\n\t\t\n\t\topt_parser.parse!(args)\n\t\t# Check for mandatory options\n if not options.wordlist and not options.users\n puts opt_parser\n exit\n end\n\t\tif not options.wordlist\n\t\t\tputs \"[!] Missing Wordlist setting, see help (-h)\"\n\t\t\texit\n\t\tend\n\t\tif not options.users\n\t\t\tputs \"[!] Missing User list setting, see help (-h)\"\n\t\t\texit\n\t\tend\n\t\t# return\n\t\toptions\n\tend", "title": "" }, { "docid": "6c2ce2d3a60ad54a2eb5854c47053a88", "score": "0.6340841", "text": "def parse_args(args)\n begin\n [JSON.parse(strip_quotes(args.clone)).symbolize_keys!]\n rescue\n # \"\"| match an empty argument: \"\" OR...\n # (?:(?:\".*[^\\\\]\"|[^\\s\"]*|[^\\s]+)*),*[^\\s]*| Match an application argument string: foo,\"bar bar\",baz OR...\n # \".*?[^\\\\]\" Match all characters in a string (non-greedy) until you see an unescaped quote: \"foo\\\"bar\\\"baz\"\n # [^\\s]+ Match all non-whitespace characters: foo\n # One last note: we can not strip quotes at this stage because it may interfere with application arguments\n # that will be parsed later.\n args.scan(/\"\"|(?:(?:\".*?[^\\\\]\"|[^\\s\"]*|[^\\s]+)*),*[^\\s]*|\".*?[^\\\\]\"|[^\\s]+/).reject{|e| e.empty?}\n end\n end", "title": "" }, { "docid": "18b16e972c1bd84aa1ac18f5c5b8f433", "score": "0.6335145", "text": "def parse!(args)\n do_parse(args)\n rescue OptionParser::InvalidOption => ex\n @exception_handler.call(\"Unknown option #{ex.args.join(' ')}\",@extra_error_context)\n rescue OptionParser::InvalidArgument => ex\n @exception_handler.call(\"#{ex.reason}: #{ex.args.join(' ')}\",@extra_error_context)\n end", "title": "" }, { "docid": "5a9bad820205bb658fd56cbd0de89e64", "score": "0.63306344", "text": "def parse(args)\n @valid = true\n args = Shellwords::shellwords(args) unless args.kind_of?(Array)\n consumed = []\n option = nil\n\n args.each do |token|\n case token\n when @help_long, @help_short\n puts help\n exit 0\n\n when /\\A--\\z/\n consumed << token\n break\n\n when /^-(-)?\\w/\n consumed << token\n param = token.sub(/^-(-)?/, '').gsub('-', '_').to_sym\n option = options[param]\n if option.nil?\n @errors[param] = \"Unrecognized parameter\"\n @valid = false\n next\n end\n\n if option.kind_of?(Flag)\n option.process(self, nil)\n option = nil\n end\n else\n if option\n consumed << token\n option.process(self, token)\n option = nil\n end\n end\n end\n\n @remainder = args - consumed\n\n # Find required options that are missing arguments\n options.each do |param, opt|\n if opt.kind_of?(Option) and self.send(opt.long).nil?\n if opt.required?\n @valid = false\n @errors[opt.long.to_sym] = \"Missing required parameter: #{opt.long}\"\n elsif opt.has_default?\n opt.process(self, opt.default)\n end\n end\n end\n end", "title": "" }, { "docid": "7e0f0e1f4bf795b72a4369c334322c18", "score": "0.63215214", "text": "def parseOptions(args)\n require 'optparse'\n\n cfgFile = nil\n @interactive = false\n @logConfigFile = ENV['NODE_AGENT_LOG'] || \"/etc/omf-resctl/nodeagent_log.xml\"\n\n # --listen-addr --listen-port --handler-addr --handler-port\n opts = OptionParser.new\n opts.banner = \"Usage: nodeAgent [options]\"\n @config = {'comm' => {}}\n\n # This option is relevant only when using a TCP Server Communicator\n opts.on(\"--server-port PORT\",\n \"Port to wait for handler to connect on\") {|port|\n @config['comm']['server_port'] = port.to_i\n }\n\n # The following options are relevant only when using a Multicast Communicator or a TCPClient (broken?) one\n opts.on(\"--handler-addr ADDR\",\n \"Address of handler [#{@handlerAddr}]\") {|addr|\n @config['comm']['handler_addr'] = addr\n }\n opts.on(\"--handler-port PORT\",\n \"Port handler is listening [#{@handlerPort}]\") {|port|\n @config['comm']['handler_port'] = port.to_i\n }\n opts.on(\"--local-addr ADDR\",\n \"Address of local interface to use for multicast sockets\") {|addr|\n @config['comm']['local_addr'] = addr\n }\n\n # The following options are relevant only when using a Multicast Communicator\n opts.on(\"--listen-addr ADDR\",\n \"Address to listen for handler commands [#{@listenAddr}]\") {|addr|\n @config['comm']['listen_addr'] = addr\n }\n opts.on(\"--listen-port PORT\",\n \"Port to listen for handler commands [#{@listenPort}]\") {|port|\n @config['comm']['listen_port'] = port.to_i\n }\n opts.on(\"--local-if IF\",\n \"Name of local interface to use for multicast sockets [#{@localIF}]\") {|name|\n @config['comm']['local_if'] = name\n }\n\n # General options\n opts.on(\"--xmpp-server HOST\",\n \"Hostname or IP address of the XMPP server to connect to\") {|name|\n @config['comm']['xmpp_server'] = name\n }\n \n opts.on(\"-i\", \"--interactive\",\n \"Run the agent in interactive mode\") {\n @interactive = true\n }\n opts.on(\"-l\", \"--libraries LIST\",\n \"Comma separated list of additional files to load [#{@extraLibs}]\") {|list|\n @extraLibs = list\n }\n opts.on(\"--log FILE\",\n \"File containing logging configuration information\") {|file|\n @logConfigFile = file\n }\n opts.on('--name NAME',\n \"Initial checkin name of agent\") {|name|\n @defAgentName = name\n }\n opts.on(\"-n\", \"--just-print\",\n \"Print the commands that would be executed, but do not execute them\") {\n NodeAgent.JUST_PRINT = true\n }\n opts.on_tail(\"-h\", \"--help\", \"Show this message\") { puts opts; exit }\n opts.on_tail(\"-v\", \"--version\", \"Show the version\") {\n puts VERSION_STRING\n exit\n }\n\n rest = opts.parse(args)\n\n # Make sure log exists ...\n @logConfigFile = File.exists?(@logConfigFile) ? @logConfigFile : nil\n MObject.initLog('nodeAgent', nil, {:configFile => @logConfigFile})\n\n # read optional config file\n if cfgFile.nil?\n name = \"nodeagent.yaml\"\n path = [\"../etc/omf-resctl/#{name}\", \"/etc/omf-resctl/#{name}\"]\n cfgFile = path.detect {|f|\n File.readable?(f)\n }\n else\n if (!File.readable?(cfgFile))\n raise \"Can't find configuration file '#{cfgFile}'\"\n end\n end\n if (cfgFile.nil?)\n raise 'Can\\'t find a configuration file'\n else\n require 'yaml'\n h = YAML::load_file(cfgFile)\n if ((p = h['nodeagent']) == nil)\n raise \"Missing 'nodeagent' root in '#{cfgFile}'\"\n end\n @config = p.merge_deep!(@config)\n end\n end", "title": "" }, { "docid": "01805060e2af47f911ff07fa1b700b41", "score": "0.6320033", "text": "def parse_args(arr=nil)\n \tusage if ARGV.length == 0\n \t\n \t# only parse flags if first arg is not a number\n \tparse_flags() if !(is_number(ARGV[0]))\n\n \t# use ARG or array from user later on in the program\n arr = ARGV if arr.nil?\n arr.each do |a|\n \tputs a\n case \n when (a == a[/[a-zA-Z]*/])\n if a.upcase == \"ANS\"\n \tif (@x == nil) ? @x = @ans: @y = @ans\n \tend\n \tnext\n\t\t\t\tend\n @ops.each do |elem|\n if (a.upcase == elem)\n @operation = elem\n end\n end\n when (is_number(a))\n if (@x == nil) ? @x = a.to_f: @y = a.to_f\n end\n end\n end\n execute_operation() if !arr.nil? \n end", "title": "" }, { "docid": "cebdbf3cc40ca114925df3a1e284e874", "score": "0.63199925", "text": "def autogen_parse(parameters); end", "title": "" }, { "docid": "329c9ea85119bdc68ff0ec1fd51dcd87", "score": "0.6313321", "text": "def read_args\n ARGV.each_with_index do |arg, i|\n if arg[0] == '-'\n if arg == '-v'\n puts \"#{$0} version 2014-02-01\"\n else\n $stderr.puts \"unknown option #{arg}\"\n end\n elsif @path.nil?\n @path = arg\n elsif @commit_sha1.nil?\n @commit_sha1 = arg\n else\n $stderr.puts \"warning: ignoring argument '#{arg}'\"\n end\n end\n end", "title": "" }, { "docid": "7357f5972b74e1c51f2885eabf2d69c2", "score": "0.6305308", "text": "def parse_cmdline(args)\n\tcmdline_arg\t= {};\n\t# define the default values\n\tcmdline_arg['apps_detect_uri']\t= \"http://localhost:4570\";\n\tcmdline_arg['httpi_mod']\t= \"raw\";\n\tcmdline_arg['loop_delay']\t= 1;\n \n\t# initialize the option parser\n\topts = OptionParser.new do |opts|\n\t\topts.banner = \"Usage: #{File.basename($0)} [options] playlist_id track_pool_name\"\n\t\topts.separator \"\"\n\t\topts.separator \"Specific options:\" \n\n\t\t# 'cast_name' option\n\t\topts.on(\"-c\", \"--cast_name name\", \"specify the cast_name\") do |val|\n\t\t\tcmdline_arg['cast_name']\t= val;\n\t\tend\n\n\t\t# 'cast_privtext' option\n\t\topts.on(\"-p\", \"--cast_privtext value\", \"specify the cast_privtext\") do |val|\n\t\t\tcmdline_arg['cast_privtext']\t= val;\n\t\tend\n\t\t\n\t\t# 'mdata_srv_uri' option\n\t\topts.on(\"\", \"--mdata_srv_uri uri\", \"specify the mdata_srv_uri\") do |val|\n\t\t\tcmdline_arg['mdata_srv_uri']\t= val;\n\t\tend\n\n\t\t# 'httpi_uri' option\n\t\topts.on(\"\", \"--httpi_uri uri\", \"specify the httpi_uri\") do |val|\n\t\t\tcmdline_arg['httpi_uri']\t= val;\n\t\tend\n\n\t\t# 'httpi_mod' option\n\t\topts.on(\"\", \"--httpi_mod string\", \"specify the httpi_mod [raw|flv]\") do |val|\n\t\t\tcmdline_arg['httpi_mod']\t= val;\n\t\tend\n\t\t\n\t\t# 'http_peersrc_uri' option\n\t\topts.on(\"\", \"--http_peersrc_uri uri\", \"specify the http_peersrc_uri\") do |val|\n\t\t\tcmdline_arg['http_peersrc_uri']\t= val;\n\t\tend\n\n\t\t# 'loop_delay' option\n\t\topts.on(\"-d\", \"--loop_delay nb_second\",\n\t\t\t\"specify how long to wait between 2 iterations of the loop\") do |val|\n\t\t\tcmdline_arg['loop_delay']\t= val;\n\t\tend\n\n\t\topts.separator \"\"\n\t\topts.separator \"Common options:\"\n\t\t# No argument, shows at tail. This will print an options summary.\n\t\t# Try it and see!\n\t\topts.on_tail(\"-h\", \"--help\", \"Show this message\") do\n\t\t\tputs opts\n\t\t\texit\n\t\tend\n\tend\n\t# parse the args\n\topts.parse!(args)\n\t\n\t# NOTE: from the remaining arguments, extract them from the remaining args\n\t# - example: cmdline_arg['track_pool_name']\t= args[0]\n\n\t# return the result\n\treturn cmdline_arg;\nend", "title": "" }, { "docid": "003cb49b631c2aefd4477ed682bb23c3", "score": "0.63031775", "text": "def parse_args(splat)\n @atts = nil\n @opts = {}\n\n # strip any trailing hash-like thingy (Ruby 1.8 style)\n if splat.sub!(/\\s+:([a-z]\\w+\\s*=>.*)/,'')\n $1.to_s.split(/\\s*,\\s*/).each do |r|\n k, v = r.split(/\\s*=>\\s*/)\n @opts[k.sub(/^:/,'')] = strip_quotes(v)\n end\n end\n\n @args = splat.split(/\\s*,\\s*/).map{|x| strip_quotes(x) }\n @image = @args.shift\n @title = @args.shift\n @caption = @args.shift\n end", "title": "" }, { "docid": "c0266845779591229918ba76e019d052", "score": "0.63019353", "text": "def arguments\n args = @text.split(\" \")\n args.shift\n args\n end", "title": "" }, { "docid": "d65a3449e909dd74daf16081ef49003a", "score": "0.6301075", "text": "def parse_extension_args(args)\n @request_token = args['request_token']\n @verifier = args['verifier']\n @scope = args['scope']\n end", "title": "" } ]
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "db0129448cee0ac5b898c1f83f80824f", "score": "0.0", "text": "def location_params\n params.require(:location).permit(:name)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74959", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6957448", "text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end", "title": "" }, { "docid": "c72da3a0192ce226285be9c2a583d24a", "score": "0.69232017", "text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end", "title": "" }, { "docid": "3d346c1d1b79565bee6df41a22a6f28d", "score": "0.6894128", "text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end", "title": "" }, { "docid": "aa06a193f057b6be7c0713a5bd30d5fb", "score": "0.67854404", "text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.67449695", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "fad8fcf4e70bf3589fbcbd40db4df5e2", "score": "0.6683308", "text": "def allowed_params\n # Only this one attribute will be allowed, no hacking\n params.require(:user).permit(:username)\n end", "title": "" }, { "docid": "b453d9a67af21a3c28a62e1848094a41", "score": "0.6637557", "text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end", "title": "" }, { "docid": "2c8e2be272a55477bfc4c0dfc6baa7a7", "score": "0.662948", "text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "1685d76d665d2c26af736aa987ac8b51", "score": "0.662788", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f", "score": "0.65641665", "text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "title": "" }, { "docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18", "score": "0.649092", "text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.64797956", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "2d2af8e22689ac0c0408bf4cb340d8c8", "score": "0.64552915", "text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end", "title": "" }, { "docid": "236e1766ee20eef4883ed724b83e4176", "score": "0.6400582", "text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "title": "" }, { "docid": "b29cf4bc4a27d4b199de5b6034f9f8a0", "score": "0.63838357", "text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end", "title": "" }, { "docid": "bfb292096090145a067e31d8fef10853", "score": "0.6364724", "text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end", "title": "" }, { "docid": "6bf3ed161b62498559a064aea569250a", "score": "0.63412917", "text": "def require_params\n return nil\n end", "title": "" }, { "docid": "b4c9587164188c64f14b71403f80ca7c", "score": "0.6337844", "text": "def sanitize_params!\n request.sanitize_params!\n end", "title": "" }, { "docid": "b63e6e97815a8745ab85cd8f7dd5b4fb", "score": "0.6326744", "text": "def excluded_from_filter_parameters; end", "title": "" }, { "docid": "38bec0546a7e4cbf4c337edbee67d769", "score": "0.6322144", "text": "def user_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password)\n end", "title": "" }, { "docid": "5ec018b4a193bf3bf8902c9419279607", "score": "0.63172126", "text": "def user_params # contains strong parameters\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n # strong parameters disallows any post information that is not permitted (admin security) when signing_up\n # so not all users will get admin access by hacking params using curl\n end", "title": "" }, { "docid": "37d1c971f6495de3cdd63a3ef049674e", "score": "0.6315604", "text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "91bfe6d464d263aa01e776f24583d1d9", "score": "0.6308472", "text": "def permitir_parametros\n params.permit!\n end", "title": "" }, { "docid": "e012d7306b402a37012f98bfd4ffdb10", "score": "0.63023496", "text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end", "title": "" }, { "docid": "157e773497f78353899720ad034a906a", "score": "0.62986314", "text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end", "title": "" }, { "docid": "8c384af787342792f0efc7911c3b2469", "score": "0.6296104", "text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.629288", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.629288", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "9b76b3149ac8b2743f041d1af6b768b5", "score": "0.62788945", "text": "def filter_params\n params.permit(\n\t\t\t\t:name,\n\t\t\t\t:sitedefault,\n\t\t\t\t:opinions,\n\t\t\t\t:contested,\n\t\t\t\t:uncontested,\n\t\t\t\t:initiators,\n\t\t\t\t:comments,\n\t\t\t\t:following,\n\t\t\t\t:bookmarks,\n\t\t\t\t:lone_wolf,\n\t\t\t\t:level_zero,\n\t\t\t\t:level_nonzero,\n\t\t\t\t:private,\n\t\t\t\t:public_viewing,\n\t\t\t\t:public_comments,\n\t\t\t\t:has_parent,\n\t\t\t\t:has_no_parent,\n\t\t\t\t:today,\n\t\t\t\t:last_week,\n\t\t\t\t:last_month,\n\t\t\t\t:last_year,\n\t\t\t\t:sort_by_created_at,\n\t\t\t\t:sort_by_updated_at,\n\t\t\t\t:sort_by_views,\n\t\t\t\t:sort_by_votes,\n\t\t\t\t:sort_by_scores,\n\t\t\t\t:who_id)\n end", "title": "" }, { "docid": "603f4a45e5efa778afca5372ae8a96dc", "score": "0.6274474", "text": "def param_whitelist\n [:role]\n end", "title": "" }, { "docid": "f6399952b4623e5a23ce75ef1bf2af5a", "score": "0.6267891", "text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend", "title": "" }, { "docid": "505e334c1850c398069b6fb3948ce481", "score": "0.62570876", "text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end", "title": "" }, { "docid": "37c5d0a9ebc5049d7333af81696608a0", "score": "0.6255739", "text": "def safe_params\n\t\tparams.require(:event).permit(:title, :event_date, :begti, :endti, :comments, :has_length, :is_private)\n\tend", "title": "" }, { "docid": "6c4620f5d8fd3fe3641e0474aa7014b2", "score": "0.6252448", "text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end", "title": "" }, { "docid": "d14bb69d2a7d0f302032a22bb9373a16", "score": "0.6237188", "text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend", "title": "" }, { "docid": "d370098b1b3289dbd04bf1c073f2645b", "score": "0.62297666", "text": "def allow_params\n params.permit(:id, :email, :password)\n end", "title": "" }, { "docid": "5629f00db37bf403d0c58b524d4c3c37", "score": "0.6229325", "text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "78cbf68c3936c666f1edf5f65e422b6f", "score": "0.6229133", "text": "def whitelisted_user_params\n if params[:user]\n params.require(:user).permit(:email, :username, :password)\n else\n { :email => params[:email],\n :username => params[:username],\n :password => params[:password] }\n end\nend", "title": "" }, { "docid": "fde8b208c08c509fe9f617229dfa1a68", "score": "0.62262005", "text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end", "title": "" }, { "docid": "d38efafa6be65b2f7da3a6d0c9b7eaf5", "score": "0.6201686", "text": "def roaster_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password_digest, :address, :website, :phone, :latitude, :longitutde, :description)\n end", "title": "" }, { "docid": "d724124948bde3f2512c5542b9cdea74", "score": "0.6192431", "text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end", "title": "" }, { "docid": "d18a36785daed9387fd6d0042fafcd03", "score": "0.61840314", "text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.61792326", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end", "title": "" }, { "docid": "07bc0e43e1cec1a821fb2598d6489bde", "score": "0.61643475", "text": "def accept_no_params\n accept_params {}\n end", "title": "" }, { "docid": "fc4b1364974ea591f32a99898cb0078d", "score": "0.6162127", "text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end", "title": "" }, { "docid": "84bd386d5b2a0d586dca327046a81a63", "score": "0.61570275", "text": "def good_params\n permit_params\n end", "title": "" }, { "docid": "13e3cfbfe510f765b5944667d772f453", "score": "0.61560357", "text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end", "title": "" }, { "docid": "b9432eac2fc04860bb585f9af0d932bc", "score": "0.6136865", "text": "def wall_params\n params.permit(:public_view, :guest)\n end", "title": "" }, { "docid": "f2342adbf71ecbb79f87f58ff29c51ba", "score": "0.6134677", "text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end", "title": "" }, { "docid": "8fa507ebc4288c14857ace21acf54c26", "score": "0.6121851", "text": "def strong_params\n # to dooo\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.61188513", "text": "def check_params; true; end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.61188513", "text": "def check_params; true; end", "title": "" }, { "docid": "9292c51af27231dfd9f6478a027d419e", "score": "0.6114514", "text": "def domain_params\n params[:domain].permit!\n end", "title": "" }, { "docid": "a3aee889e493e2b235619affa62f39c3", "score": "0.61120224", "text": "def user_params\n params.permit(:full_name, :email, :job, :about, :max_search_distance,\n :website_url, :linkedin_url,\n :behance_url, :github_url, :stackoverflow_url)\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.6105032", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.6105032", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.609908", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.609908", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "677293afd31e8916c0aee52a787b75d8", "score": "0.6086652", "text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end", "title": "" }, { "docid": "e50ea3adc222a8db489f0ed3d1dce35b", "score": "0.60864824", "text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end", "title": "" }, { "docid": "b7ab5b72771a4a2eaa77904bb0356a48", "score": "0.6085158", "text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end", "title": "" }, { "docid": "b2841e384487f587427c4b35498c133f", "score": "0.6079272", "text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end", "title": "" }, { "docid": "3f5347ed890eed5ea86b70281803d375", "score": "0.6076499", "text": "def user_params\n params.permit!\n end", "title": "" }, { "docid": "a3dc8b6db1e6584a8305a96ebb06ad21", "score": "0.60698277", "text": "def need_params\n end", "title": "" }, { "docid": "0c8779b5d7fc10083824e36bfab170de", "score": "0.6069387", "text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end", "title": "" }, { "docid": "fa0608a79e8d27c2a070862e616c8c58", "score": "0.6067486", "text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end", "title": "" }, { "docid": "7646659415933bf751273d76b1d11b40", "score": "0.60662013", "text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.6064436", "text": "def filtered_parameters; end", "title": "" }, { "docid": "4f8205e45790aaf4521cdc5f872c2752", "score": "0.6063694", "text": "def search_params\n params.permit(:looking_for, :utf8, :authenticity_token, :min_age,\n :max_age, :sort_by, likes:[])\n end", "title": "" }, { "docid": "e39a8613efaf5c6ecf8ebd58f1ac0a06", "score": "0.60630244", "text": "def permitted_params\n params.permit :utf8, :_method, :authenticity_token, :commit, :id,\n :encrypted_text, :key_size\n end", "title": "" }, { "docid": "d6886c65f0ba5ebad9a2fe5976b70049", "score": "0.60587263", "text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end", "title": "" }, { "docid": "f78d6fd9154d00691c34980d7656b3fa", "score": "0.6049716", "text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "title": "" }, { "docid": "f78d6fd9154d00691c34980d7656b3fa", "score": "0.6049716", "text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "title": "" }, { "docid": "96ddf2d48ead6ef7a904c961c284d036", "score": "0.6049526", "text": "def user_params\n permit = [\n :email, :password, :password_confirmation,\n :image, :name, :nickname, :oauth_token,\n :oauth_expires_at, :provider, :birthday\n ]\n params.permit(permit)\n end", "title": "" }, { "docid": "75b7084f97e908d1548a1d23c68a6c4c", "score": "0.60474473", "text": "def allowed_params\n params.require(:sea).permit(:name, :temperature, :bio, :mood, :image_url, :favorite_color, :scariest_creature, :has_mermaids)\n end", "title": "" }, { "docid": "080d2fb67f69228501429ad29d14eb29", "score": "0.60418373", "text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff", "score": "0.60359657", "text": "def parameters\n params.permit(permitted_params)\n end", "title": "" }, { "docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8", "score": "0.60314584", "text": "def filter_params\n end", "title": "" }, { "docid": "cf73c42e01765dd1c09630007357379c", "score": "0.6027105", "text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end", "title": "" }, { "docid": "793abf19d555fb6aa75265abdbac23a3", "score": "0.60229325", "text": "def user_params\n if admin_user?\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter, :active, :admin, :receive_customer_inquiry)\n else\n # Don't allow non-admin users to hack the parameters and give themselves admin security; self created records automatically set to active\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter)\n end\n end", "title": "" }, { "docid": "2e70947f467cb6b1fda5cddcd6dc6304", "score": "0.6021557", "text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend", "title": "" }, { "docid": "2a11104d8397f6fb79f9a57f6d6151c7", "score": "0.60177565", "text": "def user_params\n sanitize params.require(:user).permit(:username, :password, :password_confirmation, :display_name, :about_me, :avatar, :current_password, :banned, :ban_message)\n end", "title": "" }, { "docid": "a83bc4d11697ba3c866a5eaae3be7e05", "score": "0.6016767", "text": "def user_params\n\t params.permit(\n\t :name,\n\t :email,\n\t :password\n\t \t )\n\t end", "title": "" }, { "docid": "2aa7b93e192af3519f13e9c65843a6ed", "score": "0.60098374", "text": "def user_params\n params[:user].permit!\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.60070235", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.60070235", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "9c8cd7c9e353c522f2b88f2cf815ef4e", "score": "0.6006955", "text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end", "title": "" }, { "docid": "9736586d5c470252911ec58107dff461", "score": "0.60051733", "text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end", "title": "" }, { "docid": "f70301232281d001a4e52bd9ba4d20f5", "score": "0.60028553", "text": "def room_allowed_params\n end", "title": "" }, { "docid": "e7cad604922ed7fad31f22b52ecdbd13", "score": "0.6002582", "text": "def member_params\n # byebug\n params.require(:member).permit(\n :first_name, \n :last_name, \n :username, \n :email, \n :password, \n :image, \n :family_size, \n :address)\n\n end", "title": "" }, { "docid": "58ad32a310bf4e3c64929a860569b3db", "score": "0.6002021", "text": "def user_params\n\t\tparams.require(:user).permit!\n\tend", "title": "" }, { "docid": "58ad32a310bf4e3c64929a860569b3db", "score": "0.6002021", "text": "def user_params\n\t\tparams.require(:user).permit!\n\tend", "title": "" }, { "docid": "2e6de53893e405d0fe83b9d18b696bd5", "score": "0.6000165", "text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.6000129", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.6000129", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "0f53610616212c35950b45fbcf9f5ad4", "score": "0.5994901", "text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end", "title": "" }, { "docid": "a50ca4c82eaf086dcbcc9b485ebd4261", "score": "0.59947675", "text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end", "title": "" }, { "docid": "b545ec7bfd51dc43b982b451a715a538", "score": "0.599438", "text": "def user_params\n params_allowed = %i[email password password_confirmation is_admin]\n params.require(:user).permit(params_allowed)\n end", "title": "" }, { "docid": "0b704016f3538045eb52c45442e7f704", "score": "0.59922063", "text": "def admin_params\n filtered_params = params.require(:admin).permit(:display_name, :email, :password, :password_confirmation)\n if filtered_params[:password] == \"\"\n filtered_params.delete(:password)\n filtered_params.delete(:password_confirmation)\n end\n filtered_params\n end", "title": "" }, { "docid": "6af3741c8644ee63d155db59be10a774", "score": "0.59905964", "text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end", "title": "" } ]
360f29e62703dfb54ebaecf7f2334ae0
Assigns a tag to a user on a specific day.
[ { "docid": "061d2c10d600384ea4297f50f80b08a1", "score": "0.6502899", "text": "def add_tag_to_user\n payload = {}\n \n if session[:level] == 2 # Make sure this is an admin user. \n # Extract email and time from post parameters.\n email = params['email']\n time = Time.at params['time'].to_i\n\n # find or create a given day.\n day = Day.first(:conditions => ['date = ?', time.strftime('%Y-%m-%d')])\n user = User.first(:conditions => ['email = ?', email])\n tag = Tag.first(:conditions => ['text = ?', params['tag']])\n \n day.assignments.each do |assignment|\n if assignment.user_id == user.id\n assignment.applied_tags << tag\n end\n end\n \n else\n payload[:error] = I18n.t(:permission_error)\n end\n \n \n respond_to do |format|\n format.html {render :layout => false, :json => payload}\n format.json {render :layout => false, :json => payload}\n end\n end", "title": "" } ]
[ { "docid": "3f1e909d4f6f60e35a461b8a96998ca2", "score": "0.59915775", "text": "def set_tdee(date = Time.now)\n tdee_today = user_activities.find_by_name('Daily Energy Expenditure', :conditions => ['activity_date = ?', Time.now.beginning_of_day.utc])\n \n if !tdee_today && calorie_intake > 0\n UserActivity.create(:user_id => id, :name => 'Daily Energy Expenditure', :activity_date => Time.now.beginning_of_day, :calories_burned => tdee, :duration => 0)\n end\n \n end", "title": "" }, { "docid": "48bc130651606bd0799fb7b52d294bb6", "score": "0.5726275", "text": "def tag(user_id)\n self.user_id = user_id\n self.save\n end", "title": "" }, { "docid": "152a378fab560ce3094427b22721fa45", "score": "0.5712858", "text": "def set_user_tag\n @user_tag = user_tag.find_by(find_by_params)\n end", "title": "" }, { "docid": "a516575483eb3f83f870a0e2642fcf6e", "score": "0.5670014", "text": "def set_user_tag\n @user_tag = UserTag.find(params[:id])\n end", "title": "" }, { "docid": "6850854a80f02e316d074579046f5407", "score": "0.5645449", "text": "def tag(user_id, tag)\n opts = {\n :user_id => user_id,\n :tag => tag\n }\n post \"/admin/api/user/tag.json\", opts\n end", "title": "" }, { "docid": "e544180cfdc3a55ae230de1c69226b33", "score": "0.56121206", "text": "def tag(user_id, tag)\n opts = {\n :user_id => user_id,\n :tag => tag\n }\n post \"/admin/api/user/tag.json\", opts\n end", "title": "" }, { "docid": "a0ac8e1148aa0ff9ef39bb424f67e8d9", "score": "0.556375", "text": "def add_user_to_day\n \n payload = {}\n \n if session[:level] == 2 # Make sure this is an admin user. \n # Extract email and time from post parameters.\n email = params['email']\n time = Time.at params['time'].to_i\n\n # find or create a given day.\n day = Day.first(:conditions => ['date = ?', time.strftime('%Y-%m-%d')])\n user = User.first(:conditions => ['email = ?', email])\n \n # Make sure the day exists.\n day = Day.create({\n :date => time,\n :required_user_count => 5,\n }) unless day\n \n # Make sure we can in fact assign this user to the day.\n # If a user isn't assigned to this day assign them to it.\n unless day.assigned_users.first(:conditions => ['email = ?', email]) \n\n if day.can_assign? user\n day.assigned_users << user\n day.save\n \n # Update the assignment object to indicate the type of \n # assignment that just took place, e.g., 'any'.\n \n assignment = Assignment.first(:conditions => ['day_id = ? AND user_id = ?', day.id, user.id])\n assignment.assignment_type = day.assigned_as\n assignment.save\n \n payload[:message] = 'User assigned to day.'\n else\n payload[:error] = day.error\n end\n \n else\n payload[:error] = 'User already assigned to this day.'\n end\n \n else\n payload[:error] = I18n.t(:permission_error)\n end\n \n \n respond_to do |format|\n format.html {render :layout => false, :json => payload}\n format.json {render :layout => false, :json => payload}\n end\n end", "title": "" }, { "docid": "c1f8316dd855b048c5158cb08c504b64", "score": "0.54606867", "text": "def set_tag\n @tag = current_user.tags.find(params[:id])\n end", "title": "" }, { "docid": "cac004873c6e2f1bcc36f8375f5987f4", "score": "0.54532075", "text": "def create_tag(tag_name, user)\n tag_name = tag_name[0..200]\n new_tag = Tag.create(\n name: tag_name, \n readable: tag_name, \n name_for_link: Tag.proper_name_for_link(tag_name), \n tag_group: TagGroup.find_by_group_name(\"provider type\"),\n organization: self)\n Event.add_event(\"User\",\"#{user.id}\" ,\"added a new tag\", \"Tag\", new_tag.id)\n\n new_tag\n end", "title": "" }, { "docid": "f98b65d7178d2d2ef7ba247a0ba6454e", "score": "0.542001", "text": "def set_tag\n @tag = current_user.tags.find(params[:id])\n end", "title": "" }, { "docid": "f98b65d7178d2d2ef7ba247a0ba6454e", "score": "0.542001", "text": "def set_tag\n @tag = current_user.tags.find(params[:id])\n end", "title": "" }, { "docid": "f98b65d7178d2d2ef7ba247a0ba6454e", "score": "0.542001", "text": "def set_tag\n @tag = current_user.tags.find(params[:id])\n end", "title": "" }, { "docid": "8829329719bf8bf9773685fe56f85c02", "score": "0.53798515", "text": "def add_event_time_vote(user, day)\n # TODO: Check if event vote is initialized\n # TODO: Check if event vote has expired\n begin\n person_vote = event_time_votes.find_by!(:person_id => user.id)\n rescue ActiveRecord::RecordNotFound\n person_vote = EventTimeVote.create(person: user, event: self)\n end\n\n is_new_vote = false\n case day\n when /[Mm]onday/\n is_new_vote = EventTimeVote.is_new_vote(person_vote.monday_votes)\n self.monday_votes += 1 if is_new_vote\n person_vote.monday_votes = 1\n when /[Tt]uesday/\n is_new_vote = EventTimeVote.is_new_vote(person_vote.tuesday_votes)\n self.tuesday_votes += 1 if is_new_vote\n person_vote.tuesday_votes = 1\n when /[Ww]ednesday/\n is_new_vote = EventTimeVote.is_new_vote(person_vote.wednesday_votes)\n self.wednesday_votes += 1 if is_new_vote\n person_vote.wednesday_votes = 1\n when /[Tt]hursday/\n is_new_vote = EventTimeVote.is_new_vote(person_vote.thursday_votes)\n self.thursday_votes += 1 if is_new_vote\n person_vote.thursday_votes = 1\n when /[Ff]riday/\n is_new_vote = EventTimeVote.is_new_vote(person_vote.friday_votes)\n self.friday_votes += 1 if is_new_vote\n person_vote.friday_votes = 1\n else\n raise Exception.new(\"#{day} is not a valid day for the Event Time!\")\n end\n\n person_vote.save!\n self.save!\n\n if is_new_vote\n return true, \"Your vote for hosting the event on #{day.capitalize} was accepted!\"\n else\n return false, \"You have already voted for hosting the event on #{day.capitalize}\"\n end\n end", "title": "" }, { "docid": "7f21414318756ccb97902459f2ace10a", "score": "0.53680587", "text": "def set_tag\n @tag = current_user.tags.find( params[ :id ] )\n redirect_to( root_url ) if @tag.nil?\n end", "title": "" }, { "docid": "460389957f49e386fbbdd0c5ba52a1ab", "score": "0.5363121", "text": "def set_tag_user\n @tag_user = TagUser.find(params[:id])\n end", "title": "" }, { "docid": "9d104569f316d87eef29ca0bc191d6f9", "score": "0.5329981", "text": "def create\n @tag = (params[:tag].has_key?(:local_key) && Tag.find_by_local_key(params[:tag][:local_key])) ? Tag.find_or_initialize_by_local_key(params[:tag][:local_key]) : Tag.find_or_initialize_by_user_id_and_tag_name(params[:tag][:user_id], params[:tag][:tag_name])\n @tag.assign_attributes(params[:tag])\n user = User.find(params[:tag][:user_id])\n\n respond_to do |format|\n if @tag.save\n format.html { redirect_to @tag, notice: 'Tag was successfully created.' }\n format.json { render json: @tag, status: :created, location: @tag }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4d77ee8ff75448766dc4f87ecef0ec8f", "score": "0.52951807", "text": "def day=(value)\n @day = value\n end", "title": "" }, { "docid": "106e653d4bfeb4265c5e1ee1be860bc4", "score": "0.5269186", "text": "def tag_created_at\n self.created_at = Date.today\n end", "title": "" }, { "docid": "f05ab380819b78197978911a8499fbe5", "score": "0.5256924", "text": "def add_tag(tag, **data)\n client.api.add_user_tag(client.mxid, id, tag, data)\n true\n end", "title": "" }, { "docid": "860bf98a48de96b604cce1392b299e78", "score": "0.5240598", "text": "def add_user_tag(user, room, tag, data = {})\n make_request(\n :put,\n \"/user/#{user}/rooms/#{room}/tags/#{tag}\",\n content: data\n ).code == 200\n end", "title": "" }, { "docid": "a4feaa3e18052561313159dc6a4ccb70", "score": "0.523257", "text": "def tag(taggable, user = nil)\n taggings.create :taggable => taggable, :user => user\n taggings.reset\n @tagged = nil\n end", "title": "" }, { "docid": "b5873801405088f2c07e7b8406b858ef", "score": "0.5221132", "text": "def tag(taggable, user_id = nil)\n taggings.create :taggable => taggable, :user_id => user_id\n taggings.reset\n @tagged = nil\n end", "title": "" }, { "docid": "9e5e6295d948fbd12917afe6ba241b0b", "score": "0.52169734", "text": "def set_tag(tag_name, tag_value)\n end_point_url = '/account/tag/' + escape_with_types(tag_name)\n JSON.parse('[' + post(end_point_url, tag_value).body + ']')[0]\n end", "title": "" }, { "docid": "d07a085066313f89a2b82c339e7272a6", "score": "0.5209522", "text": "def set_created_day\n @created_day = CreatedDay.find(params[:id])\n end", "title": "" }, { "docid": "d5366694e8147931f6eff99d24986f96", "score": "0.5204156", "text": "def repeat_for_day!(day)\n self.class.new(repeatable_attributes).tap do |repetition|\n repetition.date = day\n repetition.start_time = start_time\n repetition.end_time = end_time\n repetition.save!\n end\n end", "title": "" }, { "docid": "686c04aadc3ba0b6cc1839e7ff87e1bc", "score": "0.52008283", "text": "def set_gitswitch_entry(tag, email, name)\n @users[tag] = {:name => name, :email => email}\n save_gitswitch_file\n end", "title": "" }, { "docid": "5050443eabb0ee7879e51c8989abf2a1", "score": "0.5190055", "text": "def add_tag(tag)\n Exlibris::Primo::WebService::Request::AddTag.new(user_record_request_attributes.merge :value => tag).call\n reset_tags\n end", "title": "" }, { "docid": "c842ef6672469fc9ec7a31f21590bb9f", "score": "0.51877546", "text": "def tag\n tag = Tag.find(tag_id)\n tag.user_name = name\n return tag\n end", "title": "" }, { "docid": "72f0e32540ec135ca6248640e2baaa89", "score": "0.5164977", "text": "def watch_availability(user, date)\n notifications.create(date: date) do |notification|\n notification.user = user\n end\n end", "title": "" }, { "docid": "cedf885bfb0966388d0e87fe405d905d", "score": "0.51490325", "text": "def set_day\n @day = day.find(params[:id])\n end", "title": "" }, { "docid": "75ff4f1226d57cff6974b6ac55e3c0ca", "score": "0.5131327", "text": "def set_user_dish_tag\n @user_dish_tag = UserDishTag.find(params[:id])\n end", "title": "" }, { "docid": "90b3679ec4a1c182f9ceb3bf4be3ef5f", "score": "0.51177967", "text": "def tag(ref, label, date, message)\n file = tempfile(\"message\", message)\n date = date.strftime('%Y-%m-%d 23:59') unless String===date\n\n cmd = %[GIT_AUTHOR_DATE='#{date}' GIT_COMMITTER_DATE='#{date}' git tag -a -F '#{file}' #{label} #{ref}]\n puts cmd if $DEBUG\n `#{cmd}` unless $DRYRUN\n end", "title": "" }, { "docid": "3b6f5933c6d88bd082fcefd6eee13c68", "score": "0.5081746", "text": "def create\n @event_tag = EventTag.new(event_tag_params)\n @event_tag.user = @user\n\n respond_to do |format|\n if @event_tag.save\n format.html { redirect_to @event_tag, notice: 'Event tag was successfully created.' }\n format.json { render :show, status: :created, location: @event_tag }\n else\n format.html { render :new }\n format.json { render json: @event_tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "be93fa7b3d2097893b1b620e935d111b", "score": "0.50720423", "text": "def tag user\n unless tagged? user\n users << user\n end\n end", "title": "" }, { "docid": "be93fa7b3d2097893b1b620e935d111b", "score": "0.50720423", "text": "def tag user\n unless tagged? user\n users << user\n end\n end", "title": "" }, { "docid": "be93fa7b3d2097893b1b620e935d111b", "score": "0.50720423", "text": "def tag user\n unless tagged? user\n users << user\n end\n end", "title": "" }, { "docid": "d869cf00b7e8ecf69923e99a57265cbf", "score": "0.5070681", "text": "def update\n @user = User.find_by(id: params[\"id\"])\n tag = Tag.find_or_create_by(name: params[\"tag\"])\n @user.tag = tag\n @user.save!\n flash[:notice] = 'User was successfully updated.'\n redirect_to session[:return_to]\n end", "title": "" }, { "docid": "0be4bc22f8250214cbdaffcbd0e870be", "score": "0.506034", "text": "def set_day\n @day = Day.find_by_id(params[:id])\n if @day.nil?\n @day = Day.new(:id => params[:id])\n @day.save!\n end\n end", "title": "" }, { "docid": "9ac7a47de629057b4038999b7ca85596", "score": "0.50475776", "text": "def tag(ref, label, date, message)\n file = tempfile(\"message\", message)\n date = date.strftime('%Y-%m-%d 23:59') unless String===date\n\n cmd = %[GIT_AUTHOR_DATE='#{date}' GIT_COMMITTER_DATE='#{date}' git tag -a -F '#{file}' #{label} #{ref}]\n puts cmd if $DEBUG\n `#{cmd}` unless $DRYRUN\n end", "title": "" }, { "docid": "5a76296abd0c5ec64e4dc6d21fd4d5cd", "score": "0.5046073", "text": "def set_tag\n @tag = @user.tags.find(params[:id])\n end", "title": "" }, { "docid": "91d3008666198ed394f738c03fea519c", "score": "0.50450784", "text": "def create\n @tag = Tag.new(tag_params)\n @user_tags = UserTags.new\n respond_to do |format|\n if @tag.save\n @user_tags.user = current_user\n @user_tags.tag = @tag\n if @user_tags.save\n format.html { redirect_to @tag, notice: 'Tag was successfully created.' }\n format.json { render :show, status: :created, location: @tag }\n else\n format.html { render :new }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n else\n format.html { render :new }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d6fd53592cdfaef38bbdaecf14cfb7dc", "score": "0.5037771", "text": "def set_TaggerDate(value)\n set_input(\"TaggerDate\", value)\n end", "title": "" }, { "docid": "c230e1479b0abbecd014b221156be24e", "score": "0.50377184", "text": "def tag_for_user\n meeting = Meeting.find_by_id( params[:id] )\n # Meeting found?\n if meeting && current_user\n # Meeting already tagged?\n if meeting.tags_by_user_list.include?( \"u#{ current_user.id }\" )\n meeting.tags_by_user_list.remove( \"u#{ current_user.id }\" )\n else\n meeting.tags_by_user_list.add( \"u#{ current_user.id }\" )\n end\n # Save and return result:\n if meeting.save\n render( status: :ok, json: { success: true } ) and return\n else\n render( status: 422, json: { success: false, error: \"Error during save!\" } )\n end\n end\n render( status: 422, json: { success: false, error: \"Invalid parameters!\" } )\n end", "title": "" }, { "docid": "b9758aafd256372af5331049f52a8ced", "score": "0.503556", "text": "def set_userdate\n @userdate = Userdate.find(params[:id])\n end", "title": "" }, { "docid": "bb4bcef7a08658e0e13b3e333a0e3b33", "score": "0.5016607", "text": "def create\n @day_teacher = DayTeacher.new(day_teacher_params)\n @day_teacher.date = Date.today\n @day_teacher.user = current_user\n \n today_user_teachers = DayTeacher.where(\"date = :today AND user_id = :user\", { today: Date.today, user: current_user } )\n\n if(today_user_teachers.count > 0)\n redirect_to :vote, alert: 'Můžete hlasovat pouze jednou denně.'\n return\n end\n\n if @day_teacher.save\n redirect_to :vote, notice: 'Váš hlas byl zaznamenán.'\n else\n redirect_to :root, alert: \"Váš hlas se nepodařilo uložit.\"\n end\n end", "title": "" }, { "docid": "dad38fb0283d3b6689b70017a5871e58", "score": "0.49740177", "text": "def tag_string=(*args)\n args.flatten!\n v, user = args\n\n v.split.each do |tag_name|\n t = Tag.find_by_name(tag_name) || Tag.create(:name => tag_name)\n self.tags << t unless self.tags.include?(t)\n\n if user && user.is_a?(User) && !user.new_record?\n tagging = taggings(true).find_by_tag_id(t.id)\n begin\n tagging.users << user unless tagging.users.include?(user) \n rescue ActiveRecord::RecordInvalid => e\n puts \"\\n\\n\\nerror in tag_string= #{e}\\n\\n\"\n end\n end\n end\n end", "title": "" }, { "docid": "6ff8c2546b946d77283853f004fca05e", "score": "0.496369", "text": "def daily(user, for_date)\n\t\t@user = user\n\t\t@missing_date = for_date\n\t\tmail :to => user.email, :subject => \"Reminder - How was #{for_date.strftime('%A, %B %d')}?\"\n end", "title": "" }, { "docid": "99b346025ae108dff9f78acef876c30d", "score": "0.4945339", "text": "def tag_for_user\n swimmer = Swimmer.find_by_id( params[:id] )\n # Meeting found?\n if swimmer && current_user\n # Swimmer already tagged?\n if swimmer.tags_by_user_list.include?( \"u#{ current_user.id }\" )\n swimmer.tags_by_user_list.remove( \"u#{ current_user.id }\" )\n else\n swimmer.tags_by_user_list.add( \"u#{ current_user.id }\" )\n end\n # Save and return result:\n if swimmer.save\n render( status: :ok, json: { success: true } ) and return\n else\n render( status: 422, json: { success: false, error: \"Error during save!\" } )\n end\n end\n render( status: 422, json: { success: false, error: \"Invalid parameters!\" } )\n end", "title": "" }, { "docid": "504adb0b8f0e1a2ddeed2f52b11c9ada", "score": "0.49445626", "text": "def set_tag(key, value)\n @tags[key] = value\n end", "title": "" }, { "docid": "a8fd8664fa3d1c818edab5c97d946724", "score": "0.49402678", "text": "def shot_on\n process_tags(%w{ createdate })\n end", "title": "" }, { "docid": "4b5706274a0d06fc2953e07ccadc2162", "score": "0.49265927", "text": "def day=(value); end", "title": "" }, { "docid": "41987b861b6573ddd91c9674f28118f4", "score": "0.49233308", "text": "def add_tag(tag_number)\n \tuser_tags.create(tag_id: Tag.find_by_tag_number(tag_number).id)\n end", "title": "" }, { "docid": "1da367af8b67945ad368085ebd984f00", "score": "0.49221095", "text": "def set_tag(key, value)\n set_tags(key => value)\n end", "title": "" }, { "docid": "f98922dcb6f04a048f85571e804309ec", "score": "0.49158108", "text": "def update_tags!\n return if updated_at && (updated_at > 1.day.ago)\n \n retrieve_tags!\n save!\n end", "title": "" }, { "docid": "58fd50fc4a11f3b24718bf8e0a80c586", "score": "0.4910595", "text": "def user_date=(date)\n d,m,y = date.split(\"/\")\n if (d.nil? || m.nil? || y.nil?)\n self.date = DateTime.now()+1\n else\n self.date = DateTime.civil(y.to_i, m.to_i, d.to_i)\n end\n end", "title": "" }, { "docid": "c797f92218527911788f536b20c67325", "score": "0.49087632", "text": "def set_tag\n @tag = Tag.friendly.find(params[:id])\n rescue => e\n @error = '一度も登録されていないTag (´・ω・`)'\n end", "title": "" }, { "docid": "2ded518ece6dbe5100630e1c4a7f94cf", "score": "0.49047452", "text": "def create\n @day = current_account.days.new(params[:day])\n @day.user_id = current_account.id\n respond_to do |format|\n if @day.save\n format.html { redirect_to(:back, :notice => 'Day was successfully created.') }\n format.xml { render :xml => @day, :status => :created, :location => @day }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @day.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "12343553d3a2d9222b9126b429ebd2dd", "score": "0.49030167", "text": "def create\n @tag = Tag.new(params[:tag])\n\t@tag.user_id = current_user.id\n\n respond_to do |format|\n if @tag.save\n format.html { redirect_to etykiety_path, notice: 'Utworzono etykietę.' }\n format.json { render json: tags_path, status: :created, location: @tag }\n else\n format.html { render action: \"new\", notice: 'Nie utworzono etykiety.' }\n format.json { render json: @tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "255e623154007bfe037fdff8265b4565", "score": "0.48911527", "text": "def tag(taggable, user_id = nil, blog_id = nil)\n taggings.create :taggable => taggable, :user_id => user_id, :blog_id => blog_id\n taggings.reset\n @tagged = nil\n end", "title": "" }, { "docid": "86bd7b499d4650b74822b89d259d0593", "score": "0.48900482", "text": "def tag_someone(registered_user)\n end", "title": "" }, { "docid": "d29c1ca772bc6c3ffe2049ca23cc8327", "score": "0.48879996", "text": "def set_event_tag\n @tag = Product::Tag.find(params[:id])\n end", "title": "" }, { "docid": "6f052230ac862c281220cf108310e7fe", "score": "0.48872706", "text": "def touch_tags\n self.tags.each { |t| t.updated_at = Time.now; t.save }\n end", "title": "" }, { "docid": "73094051e0698373d751827b1c93fe41", "score": "0.48858154", "text": "def assign_duty date\n support_assignments.create(date: date) if available? date\n end", "title": "" }, { "docid": "4dea0ee51e6e843d826859b15e217ca2", "score": "0.48623976", "text": "def []=(day, set)\n set_day(day, set)\n end", "title": "" }, { "docid": "09b533e4a943aad25b0985d40a4e6137", "score": "0.48564857", "text": "def tag=(_tag)\n self.tag_id = _tag.id\n end", "title": "" }, { "docid": "d9bbff912faa9851e5a8c5fd16174125", "score": "0.48560423", "text": "def define_uptime(user)\n if user.role == \"Organisator\"\n @uptime = Uptime.create!(start_time: @event.start_time, user: user)\n @uptime.start_time = @event.start_time\n if @uptime.save\n redirect_to event_path(@event)\n end\n else\n ### uptime for invite people\n @event.start_event.empty? ? user_date = \"\" : user_date = @event.define_date_for_user\n @uptime = Uptime.create!(start_time: user_date, user: user)\n if @uptime.save\n redirect_to event_path(@event)\n end\n end\n end", "title": "" }, { "docid": "87c77dddca7b99191a0946f2819a2b15", "score": "0.48393914", "text": "def tag\n @tag = User.find_tagged_with(params[:id])\n end", "title": "" }, { "docid": "0933b03b34f47d7a576ee4b985de10da", "score": "0.483447", "text": "def create\n @recipe = Recipe.new(params[:recipe])\n @recipe.user = current_user\n @recipe.create_at = DateTime.now\n @recipe.update_at = DateTime.now\n @recipe.user.tag(@recipe, :with => params[:recipe][:tag_list], :on => :skills)\n \n respond_to do |format|\n if @recipe.save\n format.html { redirect_to(@recipe, :notice => 'Recipe was successfully created.') }\n format.xml { render :xml => @recipe, :status => :created, :location => @recipe }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @recipe.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "95e6e43efd21cf0dc39879633ca8757a", "score": "0.4833599", "text": "def set_day\n @day = Day.find(params[:id])\n end", "title": "" }, { "docid": "95e6e43efd21cf0dc39879633ca8757a", "score": "0.4833599", "text": "def set_day\n @day = Day.find(params[:id])\n end", "title": "" }, { "docid": "95e6e43efd21cf0dc39879633ca8757a", "score": "0.4833599", "text": "def set_day\n @day = Day.find(params[:id])\n end", "title": "" }, { "docid": "95e6e43efd21cf0dc39879633ca8757a", "score": "0.4833599", "text": "def set_day\n @day = Day.find(params[:id])\n end", "title": "" }, { "docid": "95e6e43efd21cf0dc39879633ca8757a", "score": "0.4833599", "text": "def set_day\n @day = Day.find(params[:id])\n end", "title": "" }, { "docid": "95e6e43efd21cf0dc39879633ca8757a", "score": "0.4833599", "text": "def set_day\n @day = Day.find(params[:id])\n end", "title": "" }, { "docid": "95e6e43efd21cf0dc39879633ca8757a", "score": "0.4833599", "text": "def set_day\n @day = Day.find(params[:id])\n end", "title": "" }, { "docid": "95e6e43efd21cf0dc39879633ca8757a", "score": "0.4833599", "text": "def set_day\n @day = Day.find(params[:id])\n end", "title": "" }, { "docid": "95e6e43efd21cf0dc39879633ca8757a", "score": "0.4833599", "text": "def set_day\n @day = Day.find(params[:id])\n end", "title": "" }, { "docid": "95e6e43efd21cf0dc39879633ca8757a", "score": "0.4833599", "text": "def set_day\n @day = Day.find(params[:id])\n end", "title": "" }, { "docid": "95e6e43efd21cf0dc39879633ca8757a", "score": "0.4833599", "text": "def set_day\n @day = Day.find(params[:id])\n end", "title": "" }, { "docid": "95e6e43efd21cf0dc39879633ca8757a", "score": "0.48333845", "text": "def set_day\n @day = Day.find(params[:id])\n end", "title": "" }, { "docid": "47f545df34ef6d74812d433a9380d3df", "score": "0.4825007", "text": "def add_make_up_day\n humanity_request_id = HumanityAPI.create_request(@pto_request, @user)\n HumanityAPI.approve_request(humanity_request_id)\n\n @calendar = Calendar.find_by(date: @pto_request.request_date)\n @pto_request.humanity_request_id = humanity_request_id\n @pto_request.excused = false\n @pto_request.save\n\n @calendar.signed_up_total.nil? ? @calendar.signed_up_total = 1 : @calendar.signed_up_total += 1\n @calendar.signed_up_agents.push(@user.name)\n @calendar.save\n\n @user.make_up_days.nil? ? @user.make_up_days = 1 : @user.make_up_days += 1\n @user.save\n\n redirect_to show_user_path(@user)\n RequestsMailer.with(user: @user, pto_request: @pto_request).sick_make_up_email.deliver_now\n UpdatePrice.update_calendar_item(@calendar)\n end", "title": "" }, { "docid": "8a61f55d951cc28dfedf1cf749183622", "score": "0.48175624", "text": "def set_tag(key, value)\n @tags = @tags.merge(key => value)\n end", "title": "" }, { "docid": "4307e87636269f5f7df0a39653d49f2c", "score": "0.48167726", "text": "def create\n @user_tag = User_tag.new(user_tag_params)\n \n respond_to do |format|\n if @user_tag.save\n format.html { redirect_to @user_tag.project, notice: 'Assignment was successfully created.' }\n format.json { render :show, status: :created, location: @assignment }\n else\n format.html { render :new }\n format.json { render json: @user_tag.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fb59ee0799e3c238b24c01825a003c11", "score": "0.48152316", "text": "def tag(tag)\n @tagname = tag\n end", "title": "" }, { "docid": "c605b177c2712369cea0161211d8095f", "score": "0.48063588", "text": "def create_tag(resource, key, value)\n ec2.tags.create(resource, key, value)\n end", "title": "" }, { "docid": "3f8eeddfd3224a69ba2d9edadc86fa3d", "score": "0.4797439", "text": "def add_tag(tag, user=nil)\n return unless tags.where(tag: tag).empty?\n tag = Tag.new(tag: tag, user: user, notebook: self)\n tags.push(tag) if tag.valid?\n end", "title": "" }, { "docid": "1ef270eec4f7f8a56f702b5b11ad6b11", "score": "0.47924966", "text": "def set_date(date)\n time = @datetime_list[0].text.split(/[:\\+]/).first(3).map(&:to_i)\n @datetime = DateTime.new(date.year, date.month, date.day, *time) rescue DateTime.now\n @datetime += 1 if @datetime_list[0].operation == 'yesterday'\n end", "title": "" }, { "docid": "175ac070c9d3afe5c0c88c56d9e3475f", "score": "0.4780568", "text": "def remove_tag_from_user\n payload = {}\n \n if session[:level] == 2 # Make sure this is an admin user. \n # Extract email and time from post parameters.\n email = params['email']\n time = Time.at params['time'].to_i\n\n # find or create a given day.\n day = Day.first(:conditions => ['date = ?', time.strftime('%Y-%m-%d')])\n user = User.first(:conditions => ['email = ?', email])\n \n day.assignments.each do |assignment|\n assignment.applied_tags.each do |tag|\n if assignment.user_id == user.id && tag.text == params['tag']\n assignment.applied_tags.delete(tag)\n end\n end\n end\n \n else\n payload[:error] = I18n.t(:permission_error)\n end\n \n \n respond_to do |format|\n format.html {render :layout => false, :json => payload}\n format.json {render :layout => false, :json => payload}\n end\n end", "title": "" }, { "docid": "b5dd24bb1bd2f85aeaa39e4200e8d3ea", "score": "0.47779217", "text": "def register_user_action_time(user, ts = Time.now.floor)\n Octo::UserTime.new({\n userid: user.id,\n enterpriseid: user.enterprise.id,\n created_at: ts\n }).save\n end", "title": "" }, { "docid": "c1e27043f19f45176278ba912deb567e", "score": "0.4761727", "text": "def set_event_tag\n @event_tag = EventTag.find(params[:id])\n end", "title": "" }, { "docid": "c1e27043f19f45176278ba912deb567e", "score": "0.4761727", "text": "def set_event_tag\n @event_tag = EventTag.find(params[:id])\n end", "title": "" }, { "docid": "b35a7b133dfe9ebc76e5fb677b4ae705", "score": "0.47595665", "text": "def tag_user(user)\n if user.meta_data && user.meta_data[:source].present?\n intercom.tags.tag(name: user.meta_data[:source], users: [{user_id: user.id}])\n end\n end", "title": "" }, { "docid": "63336bdc1540fcff1b8b603d0eae4fa6", "score": "0.47581288", "text": "def create\n @day = @user.days.new(params[:day])\n\n respond_to do |format|\n if @day.save\n format.html { redirect_to user_days_path(@user), notice: 'Day Awrad was successfully saved.' }\n format.json { render json: @day, status: :created, location: @day }\n else\n format.html { render action: \"new\" }\n format.json { render json: @day.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fd0187750432084931edd5b38f02af62", "score": "0.4756486", "text": "def set_tag\n return if tag\n tag = self.tag = Tag.new\n tag.consumer = self.consumer\n tag.name = \"upload_#{self.user_id}_#{Time.now.to_i}\"\n tag.description = \"Uploaded on #{Time.now} by #{user_id}\"\n tag.nature = :upload\n\n true\n end", "title": "" }, { "docid": "72ccb042f6ffc9c02427d0f1fd7377f6", "score": "0.47421592", "text": "def set_tag\n @tag = Tag.find_by!(tag: params[:id])\n end", "title": "" }, { "docid": "71abb31fd6b27467c71d9265a8020016", "score": "0.47409412", "text": "def create\n @day = Day.new(params[:day])\n @user = User.find(current_user);\n \t\t\t @day.user_id = @user.id\n\t\t\t\t@day.average_rating = 3\n\n\n respond_to do |format|\n if @day.save\n format.html { redirect_to(@day, :notice => 'Day was successfully created.') }\n\t\t \n\t\t if (params[:post_to_fb] == '1')\n\t\t\t@user.facebook.feed!(\n\t\t\t:message => @day.user.name + ' has posted a new day to Daymaven',\n\t\t\t:link => day_url(@day),\n\t\t\t:picture => 'http://www.daymaven.com/images/daymavensmall.gif?t=1307486144',\n\t\t\t:name => @day.title,\n\t\t\t:description => @day.description[0, 80] + '...')\n\t\t end\n\t \n format.xml { render :xml => @day, :status => :created, :location => @day }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @day.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "76effe0bdceb62c40790f848fa69a118", "score": "0.47339457", "text": "def tag *key\n if key.blank? \n\t\t\tout_tg_day_of.in\n else\n#\t\t\tout_tg_day_of.in\n\t\t\tkey= key.first\t\tif key.size == 1\n\t\t\tnodes( :out, via: /day/ , where: { value: key } )\n end\n end", "title": "" }, { "docid": "95fa4ffef47477f78143acd7068dffe4", "score": "0.4733832", "text": "def create_occurrence_on day\n o = EventOccurrence.new\n o.event = self\n o.start_at = Time.local( day.year, day.month, day.day, self.start_at.hour, self.start_at.min )\n if self.end_at\n o.end_at = Time.local( day.year, day.month, day.day, self.end_at.hour, self.end_at.min )\n end\n\n o.save!\n o\n end", "title": "" }, { "docid": "bbd08d21de66cefbda72c55d1add2e22", "score": "0.47333226", "text": "def construct_day!(day)\n diary_day = DiaryDay.find_or_create_by_site_id_and_day(:site_id => id, :day => day.beginning_of_day)\n template_capacities.each do |template_capacity|\n diary_time = DiaryTime.find_or_create_by_diary_day_id_and_minute_of_day(:diary_day_id => diary_day.id, :minute_of_day => template_capacity.minutes)\n raise \"Could not find or create slot day\" if diary_time.nil?\n if day.saturday? or day.sunday?\n diary_time.capacity = template_capacity.weekend_capacity\n else\n diary_time.capacity = template_capacity.weekday_capacity\n end\n diary_time.save!\n end\n diary_day\n end", "title": "" }, { "docid": "51c8b3976e2bfe200684885f3cb92211", "score": "0.47304797", "text": "def set_day (name,hour,min)\nend", "title": "" } ]
ba9d8fda8b2b0451ae97735974ebbeb0
Selects the auther id from the meme id
[ { "docid": "4d97e2c5b2f07b0823c8c6741326b9dd", "score": "0.75663626", "text": "def match_id(memeid)\n db = connect_to_database()\n return db.execute(\"SELECT MemeAutherId FROM memes WHERE MemeId = ?\", memeid).first[\"MemeAutherId\"]\n end", "title": "" } ]
[ { "docid": "b6bdf62f255152f6efd5d24f8dcfb21e", "score": "0.66046673", "text": "def auth_user_id\n auth[:user_id]\n end", "title": "" }, { "docid": "9df6f2e01f465f020a68b6af10298cfa", "score": "0.6365507", "text": "def setme\n # retrieve the user name\n id = %x{id}.chomp\n if id =~ /uid=\\d+\\(([^\\)]+)\\)/\n @me = $1\n else\n puts id\n end\n raise \"Could not retrieve user name; 'id' did not work\" unless defined?(@me)\n end", "title": "" }, { "docid": "3e24ee8d3ca4ff3594741b519b6066e9", "score": "0.62882906", "text": "def meu_id\n id = Integer(self.get_and_give_me_a_json(\"meuid\"))\n id\n end", "title": "" }, { "docid": "8bb6aa3cb1f4aedece75381d5c5dd26b", "score": "0.6278689", "text": "def set_auther\n @auther = Auther.find(params[:id])\n end", "title": "" }, { "docid": "8bb6aa3cb1f4aedece75381d5c5dd26b", "score": "0.6278689", "text": "def set_auther\n @auther = Auther.find(params[:id])\n end", "title": "" }, { "docid": "0ce822747aa121ca2c45ca457edf10cd", "score": "0.62397856", "text": "def token_user_id\n decoded_token.first['id']\n end", "title": "" }, { "docid": "54bdf73ad911f90a41515ce2ab57e8d9", "score": "0.62000215", "text": "def user_id\n decoded_token.first['user_id']\n end", "title": "" }, { "docid": "d05131ae96686a3e9f01a526f2ca1426", "score": "0.61678046", "text": "def set_auth_id(node)\n siblings = node.search(\"./preceding-sibling::*[not(@code='0' or @code='2')]\")\n\n auth_id = node.parent.at_xpath(\"subfield[@code='0']\").inner_text if siblings.empty?\n\n auth_id\n end", "title": "" }, { "docid": "9d33db608e2e01df9bed8d623b43b16e", "score": "0.6119488", "text": "def user_id\n raise \"Implement in Client or Advocate\"\n end", "title": "" }, { "docid": "00d7184c80706bb4bb7a8be473bc48b5", "score": "0.6088597", "text": "def user_id\n if (id = (@opts[:user_id] || @opts['user_id'])) && id.respond_to?(:to_s)\n if (id = id.to_s).size > 0 && id != '0'\n return id\n end\n end\n end", "title": "" }, { "docid": "195e80f7045948b331f3033656ce86a5", "score": "0.60664207", "text": "def get_user_id(reaktoruser_id)\n IdStore.get(:reaktoruser, reaktoruser_id)\n end", "title": "" }, { "docid": "3aec84cdeac0242db7d7af505b6cede1", "score": "0.6063457", "text": "def current_user_id\n info['user']['id']\n end", "title": "" }, { "docid": "da575058bb037da97d6b930379f70296", "score": "0.60548156", "text": "def authidcode\n\t\t \tparams['authIdCode']\n\t\t end", "title": "" }, { "docid": "d3a4767ecda96662288366611d6f057e", "score": "0.6034386", "text": "def set_id\n \"user:#{self['email']}\"\n end", "title": "" }, { "docid": "a9491dd3112271731fcc1bae62b9bca4", "score": "0.6034024", "text": "def user_id_from_token(token)\n DB[:Token].select(:UserID).where(Token: token).first[:UserID]\n end", "title": "" }, { "docid": "c890b5dcb2171bdc726ee64a4f417666", "score": "0.59935856", "text": "def author_id\n get_info[:authorID]\n end", "title": "" }, { "docid": "6285c204095fcb7f250f9753c223c66e", "score": "0.5982448", "text": "def find_authorizable_id\n @call_params[:path] = \"/#{@call_params[:path]}\" unless @call_params[:path].start_with? '/'\n @client.call(self.class, __callee__.to_s, @call_params)\n end", "title": "" }, { "docid": "127ada206232763275ed5a951edadfd4", "score": "0.59529275", "text": "def curAuth\n current_user.role_ids[0]\n end", "title": "" }, { "docid": "ca7d7364f9e8879fefaec58f13331f5f", "score": "0.5948135", "text": "def user_id\n @message[:user][:id]\n end", "title": "" }, { "docid": "88a55ffb7bba50c015bf033f860af148", "score": "0.59451103", "text": "def user_id\n return link.split(\"/\")[2]\n end", "title": "" }, { "docid": "5cfe7a3f43c5648a506849781883b1cc", "score": "0.5922404", "text": "def id\n token\n end", "title": "" }, { "docid": "7feb731b683c516ca30b1a2020ce156f", "score": "0.58920634", "text": "def auth_user_id\n session[:current_user_id] unless session[:current_user_id].nil?\n end", "title": "" }, { "docid": "fe7a11bc3eac71b7e7ed40c016e127e0", "score": "0.5846704", "text": "def twitter_user_id\n raw['id']\n end", "title": "" }, { "docid": "aa73f5cd13d53d41df44e2f7b1f02ebf", "score": "0.5827089", "text": "def user_id; 1; end", "title": "" }, { "docid": "9463c1dd9c9aa5b050ae4c5337918b25", "score": "0.57941824", "text": "def user_id\n username\n end", "title": "" }, { "docid": "4fdc6601ce21a8d0020f47e3b48e912e", "score": "0.5789749", "text": "def user_id_from_access_token_id(access_token_id)\n @redis.get(auth_domain_key(access_token_id))\n end", "title": "" }, { "docid": "7ffe30fb56aafa6ce7af5f2bf54f2a10", "score": "0.5765226", "text": "def auth_id\n params['TxAuthNo']\n end", "title": "" }, { "docid": "53ca7037d2a217c359455ca04987e23d", "score": "0.5763811", "text": "def get_id(data)\n result = get_full_data(data)\n usrgrpid = nil\n result.each { |usr| usrgrpid = usr['usrgrpid'].to_i if usr['name'] == data[:name] }\n usrgrpid\n end", "title": "" }, { "docid": "7dc02faf441ee2f53a487b075aac7668", "score": "0.5751486", "text": "def id\n @data[:user_id]\n end", "title": "" }, { "docid": "fcac40c9be7437e654087af53b72530b", "score": "0.575109", "text": "def user_id\n @raw['user']['id']\n end", "title": "" }, { "docid": "7d57b99d509f58c7eb52b7146d233721", "score": "0.57492715", "text": "def get_user_id_from_token\n if request.headers['Authorization'].present?\n @token = request.headers['Authorization'].split(' ').last\n @payload ||= AuthToken.decode(@token)\n if @payload && @payload[:user_id]\n return @payload[:user_id]\n end\n end\n return nil\n end", "title": "" }, { "docid": "97b880a3920c6007a23a699425cfe683", "score": "0.57452595", "text": "def get_ldap_id\n\t\tself.id = Devise::LDAP::Adapter.get_ldap_param(self.username,\"uidnumber\").first\n end", "title": "" }, { "docid": "3a4c87cf49bfd33455cc590a9e2bac0a", "score": "0.5738754", "text": "def facebook_id \n self.facebook_auth_cache.uid\n end", "title": "" }, { "docid": "574a71d8d2a1d09fc9024cac911feb7e", "score": "0.57351", "text": "def user_id\n Reddit::Base.user_id\n end", "title": "" }, { "docid": "2a9f7e1ea7a4249b8d6c0d92e2d34d4b", "score": "0.5714978", "text": "def employee_id_from_matter_people_id(mpid)\n e = MatterPeople.find(mpid)\n e.employee_user_id\n end", "title": "" }, { "docid": "2438cc17042835aaa1bd8b2e97a84ca1", "score": "0.5712133", "text": "def uuid\n idme_uuid\n end", "title": "" }, { "docid": "7d1a41edf46691840956926afa374484", "score": "0.57097435", "text": "def bot_user_id\n client.self.id\n end", "title": "" }, { "docid": "568cc04e6ed71c761bfec686bb765bf9", "score": "0.57030183", "text": "def get_id(user_name)\n return get_value_of(user_name, :id)\n end", "title": "" }, { "docid": "0ad7445071d393925131123318d2bf20", "score": "0.5698714", "text": "def get_connecting_uid\n request.params[:uid]\n end", "title": "" }, { "docid": "329c1db40326bd20d2d8cfbe182873fd", "score": "0.5687457", "text": "def provider\n return nil unless user_id\n user_id.split('/').last\n end", "title": "" }, { "docid": "329c1db40326bd20d2d8cfbe182873fd", "score": "0.5687457", "text": "def provider\n return nil unless user_id\n user_id.split('/').last\n end", "title": "" }, { "docid": "8559ce315c2d6ada9766d3013a230d55", "score": "0.5686334", "text": "def current_user_id\n 1\n end", "title": "" }, { "docid": "f60da1713b8403025eaab9f8c278fdd9", "score": "0.56825304", "text": "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", "title": "" }, { "docid": "4154f8358e199580e874792342d406a6", "score": "0.56789315", "text": "def author_login\r\n user.login if user\r\n end", "title": "" }, { "docid": "e7c3c82ad60507b1525d3c04af66f6dc", "score": "0.56770676", "text": "def query_id(token, login)\n query = %{\n query ($login: String!) {\n user (login: $login) {\n id\n }\n }\n }\n\n vars = { login: login }\n Github.query(token, query, vars).dig('data', 'user', 'id')\nend", "title": "" }, { "docid": "ed7e795cedb30ac4b6680b01a88f2231", "score": "0.56700844", "text": "def uid\n return nil unless user_id\n user_id.split('/').first\n end", "title": "" }, { "docid": "ed7e795cedb30ac4b6680b01a88f2231", "score": "0.56700844", "text": "def uid\n return nil unless user_id\n user_id.split('/').first\n end", "title": "" }, { "docid": "3e0bd808ee4d14b1740bb80e64700bad", "score": "0.56549937", "text": "def get_user_from_id_token(id_token)\n # Split the string on '.'\n token_parts = id_token.split('.')\n \n # token_parts[0] is header\n # token_parts[1] is JWT\n encoded_token = token_parts[1]\n \n # Check padding and add if needed\n case encoded_token.length % 4\n when 2\n # Add 2 pad chars\n encoded_token << '=='\n when 3\n # Add 1 pad char\n encoded_token << '='\n end\n \n decoded_token = JSON.parse(Base64.urlsafe_decode64(encoded_token))\n end", "title": "" }, { "docid": "4dd2883f8dae084f6338ca465d822556", "score": "0.56404024", "text": "def client_id\n me.client.id\n end", "title": "" }, { "docid": "4dd2883f8dae084f6338ca465d822556", "score": "0.56404024", "text": "def client_id\n me.client.id\n end", "title": "" }, { "docid": "b4a22cb945093ed458961ffff2ceda12", "score": "0.5628623", "text": "def get_id_from_cookie\n Sinatra::Authentication::Cookies::Hashing.decrypt(cookies[:ottoman_connection], settings.private_key)\n end", "title": "" }, { "docid": "23c2ba8c796d2e29dec713030feaf82a", "score": "0.5625508", "text": "def authorization_from(response)\n response[:unique_id]\n end", "title": "" }, { "docid": "b2475c4829834197283541f819386eeb", "score": "0.56230617", "text": "def user_id_for(user)\n find(user.id, user.login)\n end", "title": "" }, { "docid": "818faabd3017bb9ec05206067b00f0e4", "score": "0.5619149", "text": "def get_author_id\n commit_author = `#{$svnlook} author #{$repo_path} -t #{$transaction}`.downcase\n\n redmine_user = `#{$mysql} --database=bitnami_redmine --user=root --password=adminadmin \\\n -e \"SELECT id FROM users WHERE login = '#{commit_author.strip()}';\" --skip-column-names`.strip()\n\n if redmine_user.empty?\n STDERR.puts \"[cmError] User performing the commit (\" + commit_author + \") is not a Redmine user!\"\n exit(1)\n end\n\n $author_id = redmine_user.to_i\nend", "title": "" }, { "docid": "825ed637e580795c97cdf4ae558a3bf5", "score": "0.5614334", "text": "def map_logingov_to_idme\n if @current_user.identity.sign_in[:service_name].include? 'LOGINGOV'\n @current_user.identity.sign_in[:service_name] = 'oauth_IDME'\n end\n end", "title": "" }, { "docid": "435b9ab7e28c8c59c76ad9a17f08bc14", "score": "0.5609292", "text": "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", "title": "" }, { "docid": "ba6cf7a63e493efc2f025b71be3c934e", "score": "0.56077474", "text": "def get_user_id\n self.id = get_random\n \n \n end", "title": "" }, { "docid": "1d8b9fcb83b486f80e4d22a055dc9690", "score": "0.5593293", "text": "def uid\n \"#{user_id}-#{team_id}\"\n end", "title": "" }, { "docid": "6c4efeb1f35154a9817f3bb93f38acac", "score": "0.55925155", "text": "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", "title": "" }, { "docid": "d98a5e9186f8618c2fa2d643bc811672", "score": "0.5582265", "text": "def get_auth()\n\t\t\tfind_attributes(\"auth\").first\n\t\tend", "title": "" }, { "docid": "7aeaf47fda93481c91a99fd0b6e154a5", "score": "0.55734193", "text": "def me\n MailboxUser.find_user((@@user.include?('@') ? @@user : \"#{@@user}@\"))\n end", "title": "" }, { "docid": "03e64259acaf4adc4b18936c3b24c51b", "score": "0.5569302", "text": "def decode_user_id(id)\n if id\n if m = /^04:User(\\d+)$/.match(Base64.decode64(id))\n m[1].to_i\n end\n end\n end", "title": "" }, { "docid": "15bac3dbf3453ef42d364105e9f15d54", "score": "0.5568652", "text": "def user_id\n @user_id ||= self.user ? self.user.to_global_id : nil\n end", "title": "" }, { "docid": "07e13d5741e48ca62be45a3b43fd6e07", "score": "0.5563159", "text": "def author; User.get(self.author_id); end", "title": "" }, { "docid": "e9e346962158d2428657a87297de9f3f", "score": "0.55619186", "text": "def current_user_id\n @server.current_user_id\n end", "title": "" }, { "docid": "525b03d146ed6bda32cdbf0e0bcf1a50", "score": "0.55608886", "text": "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", "title": "" }, { "docid": "25d9f751ad3eed8ce174b20e6b63b76f", "score": "0.5559485", "text": "def get_logged_in_reviewer_id(current_user_id)\n participants.each do |participant|\n return participant.id if participant.user.id == current_user_id\n end\n nil\n end", "title": "" }, { "docid": "b2a09a304277d1f869a91691b26a49d4", "score": "0.5553102", "text": "def current_user\n puts decoded_token\n \n if decoded_token\n # user_id = User.find_by(id: user_id)\n User.find_by(id: decoded_token[0][\"user_id\"])\n\n end\n end", "title": "" }, { "docid": "a27adcdf8a5da0888fcc56504d3748d4", "score": "0.5552466", "text": "def target_id\n user_app_token\n end", "title": "" }, { "docid": "bd2fe650e15a8b2c9fb97d5f6307e5fa", "score": "0.55441886", "text": "def user_key\n uid\n end", "title": "" }, { "docid": "48e4e67657a8e5b2596bb693ad053bb8", "score": "0.5542277", "text": "def auth_user\n User.find(auth_user_id) unless auth_user_id.nil?\n end", "title": "" }, { "docid": "ec7f7e21dd01ec8600dc59a44ab4d743", "score": "0.55397743", "text": "def me\n cookie = cookies[:auth_token]\n @current_user ||= User.find_by_auth_token(cookie) if cookie\n end", "title": "" }, { "docid": "4009ed2c98435872d36a3eabebf8e1b8", "score": "0.553553", "text": "def user_id; config[:user_id]; end", "title": "" }, { "docid": "20647853cf9abc4094e183adc290b4e5", "score": "0.55308926", "text": "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", "title": "" }, { "docid": "0a6643923c8a22779a9aa8f80dee6498", "score": "0.5529452", "text": "def user_id\n config.present? ? config[:user_id] : ''\n end", "title": "" }, { "docid": "635b3d5fdc4828704a5eb8858f68a23f", "score": "0.5529054", "text": "def user_id; @message_impl.getUserId; end", "title": "" }, { "docid": "a25acc4f41a3be5937938328d6d6dd9b", "score": "0.551907", "text": "def id_from_user(u)\n u.is_a?(Twitter::User) ? u.id : u\n end", "title": "" }, { "docid": "1af9efc09a9d77b995caea83c39808b3", "score": "0.5494124", "text": "def current_user_id\n if request.headers && request.headers['Authorization']\n token = request.headers['Authorization'].split(' ')[1] #[Bearer <token>]\n begin\n decoded_token = JWT.decode(token, 'this should be in .env', true, algorithm: 'HS256')\n if decoded_token\n user_id = decoded_token[0]['user_id'] #[{ \"user_id\"=>\"2\" }, { \"alg\"=>\"HS256\" }]\n end\n rescue JWT::DecodeError\n nil\n end\n end\n end", "title": "" }, { "docid": "c7ee607fed843930ba87244504e94965", "score": "0.549295", "text": "def user_id\n self.person.user.id if self.person\n end", "title": "" }, { "docid": "c7ee607fed843930ba87244504e94965", "score": "0.549295", "text": "def user_id\n self.person.user.id if self.person\n end", "title": "" }, { "docid": "c7ee607fed843930ba87244504e94965", "score": "0.549295", "text": "def user_id\n self.person.user.id if self.person\n end", "title": "" }, { "docid": "385d01eb30bf8755377ed98e92769db0", "score": "0.54903865", "text": "def commenter_id\n if user_signed_in?\n current_user.id\n else\n 0\n end\n end", "title": "" }, { "docid": "5e88cf0cd979ca4256cfaedee019adf3", "score": "0.54883784", "text": "def auth0_id_token\n session.fetch(:id_token, nil)\n end", "title": "" }, { "docid": "fec75703c260c0451d1cc53c3fc4c3b6", "score": "0.5480177", "text": "def get_user_id(client_id, ethereum_address)\n ukds = get_user_kyc_details(client_id, ethereum_address)\n\n ukds.first.user_id\n end", "title": "" }, { "docid": "d557a2a7db355327257f2330a882f1e1", "score": "0.54763484", "text": "def key\n patron_info['id'] || user_info['id']\n end", "title": "" }, { "docid": "d0d7e8864b45b62e2f61ff7f5d7dc406", "score": "0.5472829", "text": "def get_current_user_auth_token(user_id)\n user=User.find(user_id)\n if user.ebay_auth_token\n user.ebay_auth_token\n end\n end", "title": "" }, { "docid": "fcb49814ab83a997bf95ca0b4ec97090", "score": "0.5471087", "text": "def authorization_id\n @authorization_id ||= begin\n join = AuthJoin.by_user_object_id(:key => id).first\n join && join[:auth_object_id]\n end\n end", "title": "" }, { "docid": "739b76071671166608344510c938cf4c", "score": "0.5470059", "text": "def user_login_to_id(login)\n user = user_from_login(login)\n return user[\"id\"]\n end", "title": "" }, { "docid": "66afbc2003ffe6d710c4853c1d96d413", "score": "0.54693604", "text": "def auth_inst_id\n auth[:institution_id]\n end", "title": "" }, { "docid": "de2f3f7fe28404fd133aba0de7ca6448", "score": "0.54689616", "text": "def authentication provider=:identity\n Authentication.where(user_id: id, provider: provider).all.first\n end", "title": "" }, { "docid": "d5ebef0ef72c364f8e6c0dd59255435f", "score": "0.54619294", "text": "def login\n self.user_id ? user.login : self.name\n end", "title": "" }, { "docid": "de3b138c92f2a06fb2efa62825770438", "score": "0.5458084", "text": "def correct_owner_id\n return 0 if accountant? or admin?\n return session[:user_id] if reseller?\n return session[:owner_id]\n end", "title": "" }, { "docid": "1b1247dbe47b5d8e5ebb2218bd94bdc0", "score": "0.5458016", "text": "def manager_user_id\n return @manager_user_id\n end", "title": "" }, { "docid": "32ddaa78a63c572681f9fa0e48ad756b", "score": "0.5449426", "text": "def actual_id\n args = params[:id].split('-')\n args[0]\n end", "title": "" }, { "docid": "7c1ca027c877c9abfcc1d84d7ff94cea", "score": "0.5447524", "text": "def id\n @uid\n end", "title": "" }, { "docid": "f3c0e063d1923f002eb58bfbe1a7df92", "score": "0.54439056", "text": "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", "title": "" }, { "docid": "8ca9634858302fd273e199665376f4fc", "score": "0.54422283", "text": "def user_id\n instance_variable_get(:@prepared_arguments).dig(:user_id)\n end", "title": "" }, { "docid": "99890b2308dd5963103b11e105bf312d", "score": "0.5439522", "text": "def grantor\n @data['grantor']\n end", "title": "" }, { "docid": "6d893498f20e7759596202de3edf5d4f", "score": "0.54305124", "text": "def get_author\n \tUser.find(author_id)\n \tend", "title": "" }, { "docid": "3e314cf5e26e59734af3c03765a53c9b", "score": "0.5426564", "text": "def item_id\n params['USER1']\n end", "title": "" } ]
9360524d6b2b55d68484878a678f7ffb
if they're not the admin user and they try to hit index or destroy they get redirected
[ { "docid": "ef6f6db405ff0dd92df04b547908b879", "score": "0.0", "text": "def show \n \t@user = User.find(params[:id]) # redirect to @user goes to show because of a rails convention\n \trender :layout => 'bootstraplayout.html.erb' # just until I get the regular layout made\n end", "title": "" } ]
[ { "docid": "2f07bf7eaafe9b0c12baf9cee153fbb9", "score": "0.78821397", "text": "def admin\n redirect_to \"/index.html\" unless !current_user.nil? && (current_user.id==1 || current_user.id==4)\n end", "title": "" }, { "docid": "eb089e960093f3c9571910a3201b0c48", "score": "0.7870089", "text": "def move_to_index\n redirect_to root_path unless user_signed_in? && current_user.admin?\n end", "title": "" }, { "docid": "62637906d6205e1f2a7d67eb6f1d2040", "score": "0.7691266", "text": "def admin_user\r\n redirect_to(root_url) unless current_user.admin?\r\n end", "title": "" }, { "docid": "5f16a0d6cf87cfa544cf1016dda33725", "score": "0.7684397", "text": "def admin_check\n\n \tif current_user.admin == false\n \t\tredirect_to main_index_path\n \tend\n\tend", "title": "" }, { "docid": "a43d3c27fd214255a647742a1e15f6a3", "score": "0.765841", "text": "def admin_user\n\t\t\tredirect_to(root_url) unless is_admin?\n\t\tend", "title": "" }, { "docid": "dbb731c079bb593eb72cb9a9fa4f5f1d", "score": "0.7655118", "text": "def admin_user\n\t redirect_to(root_url) unless current_user.admin?\n\t end", "title": "" }, { "docid": "d056e861d87dbc7d2b4716480b1082f1", "score": "0.76328593", "text": "def admin_user\n \tredirect_to(root_url) unless current_user.admin?\t\t\n end", "title": "" }, { "docid": "bee61606a8c1899aeb5151e54bb1a193", "score": "0.7620482", "text": "def admin_user\n\t \tredirect_to(root_url) unless current_user.admin?\n\t end", "title": "" }, { "docid": "c1f161de91a4fca4529e490bac3996de", "score": "0.76186526", "text": "def admin_user\n redirect_to( root_url ) unless current_user.admin?\n end", "title": "" }, { "docid": "c11658d7ce517f3dd25adfa06682e02a", "score": "0.7614929", "text": "def admin_user\n redirect_to(root_url) unless (logged_in? && current_user.admin?)\n end", "title": "" }, { "docid": "1ea6d86948e8284808a1d5459057474d", "score": "0.7614565", "text": "def redirect_to_index_if_not_current_admins_user\n @user = User.find(params[:id])\n unless @user.admin == current_user\n redirect_to(users_path)\n end\n end", "title": "" }, { "docid": "6e70a5a87d082b9c8e1c96eab3e5d4fc", "score": "0.76110923", "text": "def admin_user\n\t\tredirect_to(root_url) unless current_user.admin?\n\t\t\n\tend", "title": "" }, { "docid": "5d082f5f5480cc0c69f9a3c5a4c23b27", "score": "0.7599352", "text": "def admin_user\n redirect_to(root_url) unless current_admin?\n end", "title": "" }, { "docid": "5d082f5f5480cc0c69f9a3c5a4c23b27", "score": "0.7599352", "text": "def admin_user\n redirect_to(root_url) unless current_admin?\n end", "title": "" }, { "docid": "c233e605724e6bda95249842818add4b", "score": "0.7597214", "text": "def admin_user\n redirect_to(root_path) unless is_admin?\n end", "title": "" }, { "docid": "1bfb14d6d9f7ccc28a69dfb859e90538", "score": "0.7594614", "text": "def admin_only\n unless is_admin?\n flash[:warning] = \"You are not authorized to perform that action or view that page!\"\n if request.env['HTTP_REFERER'].nil?\n redirect_to root_url\n else\n redirect_to :back\n end\n end\n end", "title": "" }, { "docid": "1f4fe21e8c65f788435792e46dcb41a1", "score": "0.7587821", "text": "def admin_user\n\t\tredirect_to(root_url) unless current_user.admin?\n\tend", "title": "" }, { "docid": "b1f959886ead6f9ebb43a69e5bc8d65b", "score": "0.75875074", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "25c7ddc8381592eb3195eb35ffb51dd5", "score": "0.7581945", "text": "def admin_user\n \t\tredirect_to(root_url) unless current_user.admin?\n \tend", "title": "" }, { "docid": "25fed672f6776b4ed5a5f7b056c37177", "score": "0.75805545", "text": "def admin_index\n return if !user_is_allowed('users', 'view') \n end", "title": "" }, { "docid": "aaa0843f59952b905adafc4dfad3e022", "score": "0.75795734", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "93d7ced4ce18f5495226a43dcc9d28a1", "score": "0.7579283", "text": "def admin_user\n redirect_to root_url unless current_user.admin?\n end", "title": "" }, { "docid": "93d7ced4ce18f5495226a43dcc9d28a1", "score": "0.7579283", "text": "def admin_user\n redirect_to root_url unless current_user.admin?\n end", "title": "" }, { "docid": "93d7ced4ce18f5495226a43dcc9d28a1", "score": "0.7579283", "text": "def admin_user\n redirect_to root_url unless current_user.admin?\n end", "title": "" }, { "docid": "880fa482c4dc5522a86ce816fa269185", "score": "0.7579187", "text": "def admin_user\r\n redirect_to root_path unless current_user.admin?\r\n end", "title": "" }, { "docid": "7fdb4c58d61f3666f77cf2480247075c", "score": "0.75755084", "text": "def admin_user\n redirect_to(root_url) unless logged_in? and current_user.admin?\n end", "title": "" }, { "docid": "f7d17bb52889604c8b599e3dff409654", "score": "0.7575142", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "f7d17bb52889604c8b599e3dff409654", "score": "0.7575142", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "f7d17bb52889604c8b599e3dff409654", "score": "0.7575142", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "6ce2916346031a260c856414e4d8469f", "score": "0.7573077", "text": "def admin_user\n redirect_to(root_url) unless logged_in? && current_user.admin?\n end", "title": "" }, { "docid": "de590b23b3923971c2885d4caf0f6d78", "score": "0.7572574", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "238bdec7e801c763e49a495ea6ec4496", "score": "0.7570542", "text": "def admin_user\n redirect_to(root_url) unless logged_in? && current_user.admin?\n end", "title": "" }, { "docid": "238bdec7e801c763e49a495ea6ec4496", "score": "0.7570542", "text": "def admin_user\n redirect_to(root_url) unless logged_in? && current_user.admin?\n end", "title": "" }, { "docid": "238bdec7e801c763e49a495ea6ec4496", "score": "0.7570542", "text": "def admin_user\n redirect_to(root_url) unless logged_in? && current_user.admin?\n end", "title": "" }, { "docid": "4c2083274eab03da5df70c878a570f1e", "score": "0.75660056", "text": "def admin_user\n redirect_to(root_url) unless admin_user?\n end", "title": "" }, { "docid": "c5822c2606f910cae6208bdd9cff0bc3", "score": "0.7563912", "text": "def admin_user\n redirect_to(root_url) unless current_user.is_admin?\n end", "title": "" }, { "docid": "7e36cba63274dcccb3e2ab508a511801", "score": "0.7563866", "text": "def admin_check\n\n \tif current_user.admin == false\n\n \t\tredirect_to main_index_path\n\n \tend\n\tend", "title": "" }, { "docid": "dbb88954cbcee029234e2249f5d760ea", "score": "0.75603956", "text": "def admin_user\n redirect_to( root_url ) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.7556365", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75563025", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.7556139", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" }, { "docid": "fff9790967dea2b24edfeaf5bfcee2fc", "score": "0.75557256", "text": "def admin_user\n redirect_to(root_url) unless current_user.admin?\n end", "title": "" } ]
9a75d8f9594b56e23b75891cbf9354f5
A Ruby object that describes the value
[ { "docid": "53424df9c058d0d57e3fa31666d5fe9c", "score": "0.0", "text": "def calc_type!(env)\n type = case value\n when true, false\n TyRaw[\"Bool\"]\n when Integer\n TyRaw[\"Int\"]\n when Integer\n TyRaw[\"Float\"]\n else\n raise \"unknown value: #{value.inspect}\"\n end\n return env, type\n end", "title": "" } ]
[ { "docid": "5035c74df3043c73cee522e84b078df0", "score": "0.7591507", "text": "def object\n @value\n end", "title": "" }, { "docid": "5035c74df3043c73cee522e84b078df0", "score": "0.7591507", "text": "def object\n @value\n end", "title": "" }, { "docid": "5035c74df3043c73cee522e84b078df0", "score": "0.7591507", "text": "def object\n @value\n end", "title": "" }, { "docid": "9ee853e5ba249722f6bfacc1f524232f", "score": "0.7424313", "text": "def value() end", "title": "" }, { "docid": "68df4e4343e0888388d08dbbbbc147c4", "score": "0.7420416", "text": "def value\n object.value\n end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7288564", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7288564", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" }, { "docid": "0f688875676cb4e5fb1a58d865b51cca", "score": "0.7286846", "text": "def value; end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "00e47a706b960a35e61663f439ffeb04", "score": "0.0", "text": "def set_petition_review_member\n @petition_review_member = PetitionReviewMember.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163443", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.604317", "text": "def action_hook; end", "title": "" }, { "docid": "b8b36fc1cfde36f9053fe0ab68d70e5b", "score": "0.5943409", "text": "def run_actions; end", "title": "" }, { "docid": "3e521dbc644eda8f6b2574409e10a4f8", "score": "0.59143174", "text": "def define_action_hook; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5887026", "text": "def actions; end", "title": "" }, { "docid": "bfb8386ef5554bfa3a1c00fa4e20652f", "score": "0.58335453", "text": "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", "title": "" }, { "docid": "6c8e66d9523b9fed19975542132c6ee4", "score": "0.57738566", "text": "def add_actions; end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5701527", "text": "def callbacks; end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5701527", "text": "def callbacks; end", "title": "" }, { "docid": "6ce8a8e8407572b4509bb78db9bf8450", "score": "0.56534666", "text": "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "title": "" }, { "docid": "1964d48e8493eb37800b3353d25c0e57", "score": "0.5618685", "text": "def define_action_helpers; end", "title": "" }, { "docid": "5df9f7ffd2cb4f23dd74aada87ad1882", "score": "0.54237175", "text": "def post_setup\n end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5407991", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5407991", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5407991", "text": "def action_methods; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5394463", "text": "def before_setup; end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.5376582", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.5355932", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "0464870c8688619d6c104d733d355b3b", "score": "0.53376216", "text": "def define_action_helpers?; end", "title": "" }, { "docid": "0e7bdc54b0742aba847fd259af1e9f9e", "score": "0.5337122", "text": "def set_actions\n actions :all\n end", "title": "" }, { "docid": "5510330550e34a3fd68b7cee18da9524", "score": "0.5329516", "text": "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", "title": "" }, { "docid": "97c8901edfddc990da95704a065e87bc", "score": "0.5311442", "text": "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", "title": "" }, { "docid": "4f9a284723e2531f7d19898d6a6aa20c", "score": "0.52963835", "text": "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", "title": "" }, { "docid": "210e0392ceaad5fc0892f1335af7564b", "score": "0.52955836", "text": "def setup_handler\n end", "title": "" }, { "docid": "83684438c0a4d20b6ddd4560c7683115", "score": "0.5295297", "text": "def before_actions(*logic)\n self.before_actions = logic\n end", "title": "" }, { "docid": "a997ba805d12c5e7f7c4c286441fee18", "score": "0.5258503", "text": "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "1d50ec65c5bee536273da9d756a78d0d", "score": "0.52442217", "text": "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", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5235414", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5235414", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5235414", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5235414", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5235414", "text": "def action; end", "title": "" }, { "docid": "e34cc2a25e8f735ccb7ed8361091c83e", "score": "0.5234908", "text": "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", "title": "" }, { "docid": "635288ac8dd59f85def0b1984cdafba0", "score": "0.5230927", "text": "def workflow\n end", "title": "" }, { "docid": "78b21be2632f285b0d40b87a65b9df8c", "score": "0.52263695", "text": "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.5222485", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "923ee705f0e7572feb2c1dd3c154b97c", "score": "0.5216462", "text": "def process_action(...)\n send_action(...)\n end", "title": "" }, { "docid": "b89a3908eaa7712bb5706478192b624d", "score": "0.52128595", "text": "def before_dispatch(env); end", "title": "" }, { "docid": "d89a3e408ab56bf20bfff96c63a238dc", "score": "0.52070963", "text": "def setup\n # override and do something appropriate\n end", "title": "" }, { "docid": "7115b468ae54de462141d62fc06b4190", "score": "0.520529", "text": "def after_actions(*logic)\n self.after_actions = logic\n end", "title": "" }, { "docid": "62c402f0ea2e892a10469bb6e077fbf2", "score": "0.517586", "text": "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", "title": "" }, { "docid": "72ccb38e1bbd86cef2e17d9d64211e64", "score": "0.5174021", "text": "def setup(_context)\n end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.5172379", "text": "def setup(resources) ; end", "title": "" }, { "docid": "1fd817f354d6cb0ff1886ca0a2b6cce4", "score": "0.5165636", "text": "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "title": "" }, { "docid": "5531df39ee7d732600af111cf1606a35", "score": "0.5161574", "text": "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", "title": "" }, { "docid": "bb6aed740c15c11ca82f4980fe5a796a", "score": "0.51556087", "text": "def determine_valid_action\n\n end", "title": "" }, { "docid": "b38f9d83c26fd04e46fe2c961022ff86", "score": "0.5153217", "text": "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", "title": "" }, { "docid": "199fce4d90958e1396e72d961cdcd90b", "score": "0.5152898", "text": "def startcompany(action)\n @done = true\n action.setup\n end", "title": "" }, { "docid": "994d9fe4eb9e2fc503d45c919547a327", "score": "0.5151238", "text": "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", "title": "" }, { "docid": "62fabe9dfa2ec2ff729b5a619afefcf0", "score": "0.5144674", "text": "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", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.51387095", "text": "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", "title": "" }, { "docid": "adb8115fce9b2b4cb9efc508a11e5990", "score": "0.51342636", "text": "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "title": "" }, { "docid": "e1dd18cf24d77434ec98d1e282420c84", "score": "0.5113545", "text": "def setup(&block)\n define_method(:setup, &block)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.51131564", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.51131564", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "f54964387b0ee805dbd5ad5c9a699016", "score": "0.5107665", "text": "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", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5107052", "text": "def action\n end", "title": "" }, { "docid": "35b302dd857a031b95bc0072e3daa707", "score": "0.50908124", "text": "def config(action, *args); end", "title": "" }, { "docid": "bc3cd61fa2e274f322b0b20e1a73acf8", "score": "0.5089785", "text": "def setup\n @setup_proc.call(self) if @setup_proc\n end", "title": "" }, { "docid": "246840a409eb28800dc32d6f24cb1c5e", "score": "0.50814754", "text": "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", "title": "" }, { "docid": "5c3cfcbb42097019c3ecd200acaf9e50", "score": "0.50807786", "text": "def before_action \n end", "title": "" }, { "docid": "dfbcf4e73466003f1d1275cdf58a926a", "score": "0.5064482", "text": "def action\n end", "title": "" }, { "docid": "b6c9787acd00c1b97aeb6e797a363364", "score": "0.5053022", "text": "def setup\n # override this if needed\n end", "title": "" }, { "docid": "36eb407a529f3fc2d8a54b5e7e9f3e50", "score": "0.50526255", "text": "def matt_custom_action_begin(label); end", "title": "" }, { "docid": "9fc229b5b48edba9a4842a503057d89a", "score": "0.5050246", "text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "title": "" }, { "docid": "9fc229b5b48edba9a4842a503057d89a", "score": "0.5050246", "text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "title": "" }, { "docid": "fd421350722a26f18a7aae4f5aa1fc59", "score": "0.50329554", "text": "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", "title": "" }, { "docid": "d02030204e482cbe2a63268b94400e71", "score": "0.5023997", "text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "title": "" }, { "docid": "4224d3231c27bf31ffc4ed81839f8315", "score": "0.5021236", "text": "def after(action)\n invoke_callbacks *options_for(action).after\n end", "title": "" }, { "docid": "24506e3666fd6ff7c432e2c2c778d8d1", "score": "0.5014815", "text": "def pre_task\n end", "title": "" }, { "docid": "0c16dc5c1875787dacf8dc3c0f871c53", "score": "0.5014393", "text": "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "title": "" }, { "docid": "c99a12c5761b742ccb9c51c0e99ca58a", "score": "0.4999298", "text": "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", "title": "" }, { "docid": "0cff1d3b3041b56ce3773d6a8d6113f2", "score": "0.49990913", "text": "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "title": "" }, { "docid": "791f958815c2b2ac16a8ca749a7a822e", "score": "0.4997733", "text": "def setup_signals; end", "title": "" }, { "docid": "6e44984b54e36973a8d7530d51a17b90", "score": "0.49884573", "text": "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", "title": "" }, { "docid": "6e44984b54e36973a8d7530d51a17b90", "score": "0.49884573", "text": "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", "title": "" }, { "docid": "5aa51b20183964c6b6f46d150b0ddd79", "score": "0.49840933", "text": "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", "title": "" }, { "docid": "7647b99591d6d687d05b46dc027fbf23", "score": "0.49786162", "text": "def initialize(*args)\n super\n @action = :set\nend", "title": "" }, { "docid": "67e7767ce756766f7c807b9eaa85b98a", "score": "0.49784446", "text": "def after_set_callback; end", "title": "" }, { "docid": "2a2b0a113a73bf29d5eeeda0443796ec", "score": "0.49782816", "text": "def setup\n #implement in subclass;\n end", "title": "" }, { "docid": "a5294693c12090c7b374cfa0cabbcf95", "score": "0.49659815", "text": "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "title": "" }, { "docid": "63e628f34f3ff34de8679fb7307c171c", "score": "0.49655175", "text": "def lookup_action; end", "title": "" }, { "docid": "57dbfad5e2a0e32466bd9eb0836da323", "score": "0.4956222", "text": "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", "title": "" }, { "docid": "4aceccac5b1bcf7d22c049693b05f81c", "score": "0.49543875", "text": "def around_hooks; end", "title": "" }, { "docid": "5b6d613e86d3d68152f7fa047d38dabb", "score": "0.49536037", "text": "def release_actions; end", "title": "" }, { "docid": "64e0f1bb6561b13b482a3cc8c532cc37", "score": "0.495265", "text": "def setup(easy)\n super\n easy.customrequest = @verb\n end", "title": "" }, { "docid": "2318410efffb4fe5fcb97970a8700618", "score": "0.4951427", "text": "def save_action; end", "title": "" }, { "docid": "b280d59db403306d7c0f575abb19a50f", "score": "0.49438462", "text": "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "title": "" }, { "docid": "fbd0db2e787e754fdc383687a476d7ec", "score": "0.49436793", "text": "def action_target()\n \n end", "title": "" }, { "docid": "9f7547d93941fc2fcc7608fdf0911643", "score": "0.49335384", "text": "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", "title": "" }, { "docid": "da88436fe6470a2da723e0a1b09a0e80", "score": "0.49321616", "text": "def before_setup\n # do nothing by default\n end", "title": "" }, { "docid": "3ba85f3cb794f951b05d5907f91bd8ad", "score": "0.49264926", "text": "def setup(&blk)\n @setup_block = blk\n end", "title": "" }, { "docid": "17ffe00a5b6f44f2f2ce5623ac3a28cd", "score": "0.49247074", "text": "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "title": "" }, { "docid": "21d75f9f5765eb3eb36fcd6dc6dc2ec3", "score": "0.49246994", "text": "def default_action; end", "title": "" }, { "docid": "80834fa3e08bdd7312fbc13c80f89d43", "score": "0.49226475", "text": "def callback_phase\n super\n end", "title": "" }, { "docid": "f1da8d654daa2cd41cb51abc7ee7898f", "score": "0.49194494", "text": "def advice\n end", "title": "" }, { "docid": "0dccebcb0ecbb1c4dcbdddd4fb11bd8a", "score": "0.49152806", "text": "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "title": "" }, { "docid": "99a608ac5478592e9163d99652038e13", "score": "0.49149707", "text": "def _handle_action_missing(*args); end", "title": "" }, { "docid": "6e0842ade69d031131bf72e9d2a8c389", "score": "0.49149227", "text": "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", "title": "" }, { "docid": "0fe8b3b5573f8eb57ec1752658a62e4e", "score": "0.49144953", "text": "def call\n setup_context\n super\n end", "title": "" }, { "docid": "399ad686f5f38385ff4783b91259dbd7", "score": "0.49141943", "text": "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "title": "" } ]
b12105b4ae8cfd580c5cc2b549c451b1
GET /capsule_learners GET /capsule_learners.json
[ { "docid": "fe2fba55da586cfc41a70ed493d957c4", "score": "0.7685104", "text": "def index\n @capsule_learners = CapsuleLearner.all\n end", "title": "" } ]
[ { "docid": "321dbd7409d093df04a712064323d31c", "score": "0.69941765", "text": "def set_capsule_learner\n @capsule_learner = CapsuleLearner.find(params[:id])\n end", "title": "" }, { "docid": "c0ba802c05f7f54127db81ec32aca4d4", "score": "0.58871675", "text": "def show\n @learner = Learner.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @learner }\n end\n end", "title": "" }, { "docid": "c5ca72f871b6c0e2e58e42ac610e09d9", "score": "0.56256187", "text": "def create\n @capsule_learner = CapsuleLearner.new(capsule_learner_params)\n\n respond_to do |format|\n if @capsule_learner.save\n format.html { redirect_to '/free_capsule_classes', notice: 'Capsule learner was successfully created.' }\n \n else\n format.html { render template: 'home/free_capsule_classes' }\n \n end\n end\n end", "title": "" }, { "docid": "4b15be0be20cab4ab0d70f045c758db2", "score": "0.553226", "text": "def capsule_learner_params\n params.require(:capsule_learner).permit(:capsule_class_id, :name, :email, :phone_number, :educational_status, :company_name)\n end", "title": "" }, { "docid": "d7526d0b95bc7e25dd9004346d9f6a9d", "score": "0.54568607", "text": "def new\n @learner = Learner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @learner }\n end\n end", "title": "" }, { "docid": "b34d549c8b8eaf7c8c8f132b524ac86e", "score": "0.54109323", "text": "def update\n respond_to do |format|\n if @capsule_learner.update(capsule_learner_params)\n format.html { redirect_to @capsule_learner, notice: 'Capsule learner was successfully updated.' }\n format.json { render :show, status: :ok, location: @capsule_learner }\n else\n format.html { render :edit }\n format.json { render json: @capsule_learner.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7fafe6ed5d455bb85b6750fda54b7aa2", "score": "0.53825915", "text": "def manage_learners\n @package = Package.find(params[:id])\n end", "title": "" }, { "docid": "934abef3e2373948e73f54acd52f99f5", "score": "0.53428996", "text": "def show\n @capsules = @wardrobe_item.capsules\n respond_to do |format|\n format.html\n format.json {render json: @wardrobe_item}\n end\n end", "title": "" }, { "docid": "e8ee4985baa1ba9f5b1852b35adccc1c", "score": "0.53059804", "text": "def show\n if verify_request_is_peer\n learner = Portal::Learner.find(params[:id])\n @learner_details = LearnerDetail.new learner\n respond_to do |format|\n format.text { render :text => @learner_details.display }\n format.json { render :json => @learner_details.to_json }\n end\n else\n render text: \"unauthorized\"\n end\n end", "title": "" }, { "docid": "9c083253341f9ee883a5d97ceef0d50a", "score": "0.525787", "text": "def index\n\t\t@leagues = Fantasy.where(private_access: false, active: true, published: true, full:false, locked:false)\n\t\trender json: @leagues\n\tend", "title": "" }, { "docid": "8f6623c5da7a961b7340f25f41fe6241", "score": "0.52485955", "text": "def create_learners dataset\n \n end", "title": "" }, { "docid": "d514023fa172cfb2dbb44c7cbdf390c3", "score": "0.5228285", "text": "def index\n @capsule_classes = CapsuleClass.all\n end", "title": "" }, { "docid": "b98aa89f5a7bae6686332e58b807edd3", "score": "0.5214742", "text": "def all_runners(options = {})\n get('/runners/all', query: options)\n end", "title": "" }, { "docid": "b98aa89f5a7bae6686332e58b807edd3", "score": "0.5214742", "text": "def all_runners(options = {})\n get('/runners/all', query: options)\n end", "title": "" }, { "docid": "37bd14dd919f69f1fb664ab7913e2a11", "score": "0.5196751", "text": "def index\n render json: LessonVitalFact.all\n end", "title": "" }, { "docid": "9bb586b5cfdb6b107c2337c6df1306cc", "score": "0.5182616", "text": "def manage_learners\n @assessment = Assessment.find(params[:id])\n # remove_bounced_from_learners(@assessment)\n end", "title": "" }, { "docid": "86156e9b31df47b553e0ffa73239ed32", "score": "0.5181708", "text": "def listsurvey_app\n response = getsurvey(params[ai_id].to_i)\n if response.present?\n puts \"Got all surveys!\"\n render json: { message: response }, status: 200 \n else\n puts \"Could not get surveys!\"\n render json: { message: 'Could not get surveys!'}, status: 403\n end\n end", "title": "" }, { "docid": "3ccccdd91acc812beb195f4c2bdb0fdd", "score": "0.51657665", "text": "def index\n @team_leaders = @client.team_leaders\n end", "title": "" }, { "docid": "19a8c06841a4e671d674d0c09c74a0a9", "score": "0.5160741", "text": "def breaches(domain=\"\")\n get_resource('https://haveibeenpwned.com/api/v3/breaches',{:domain => \"\"})\nend", "title": "" }, { "docid": "1beb103324c26d0c491aa995e118f5fc", "score": "0.5153396", "text": "def destroy\n @capsule_learner.destroy\n respond_to do |format|\n format.html { redirect_to capsule_learners_url, notice: 'Capsule learner was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8b1472ab4693e9443f0b8a5d93d0b750", "score": "0.5150403", "text": "def index\n @capsules = Capsule.all\n end", "title": "" }, { "docid": "8b1472ab4693e9443f0b8a5d93d0b750", "score": "0.5150403", "text": "def index\n @capsules = Capsule.all\n end", "title": "" }, { "docid": "8309003de168c056733d6be76b12a54e", "score": "0.51418424", "text": "def get_whiskeys\n response_string = RestClient.get('https://evening-citadel-85778.herokuapp.com:443/whiskey/')\n response_hash = JSON.parse(response_string)\n response_hash[\"results\"].each do |result|\n # binding.pry\n Review.new(name: result[\"title\"], )\n end\n\nend", "title": "" }, { "docid": "6aaf374dadafa543e3b866557420d392", "score": "0.51379967", "text": "def index\n @learnables = Learnable.all\n end", "title": "" }, { "docid": "6aaf374dadafa543e3b866557420d392", "score": "0.51379967", "text": "def index\n @learnables = Learnable.all\n end", "title": "" }, { "docid": "765f58d8066965b79ec779997d5153fe", "score": "0.5123562", "text": "def index\n @leagues = League.all\n render json: @leagues\n end", "title": "" }, { "docid": "bed2b8601ed93173d19481494e74919e", "score": "0.51182914", "text": "def show\n @dataset = Dataset.find(params[:id])\n @users = AccessToken.all\n @strategies = Strategy.includes( :mallet_run).where( :mallet_runs => {:dataset_id => @dataset.id})\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dataset }\n end\n end", "title": "" }, { "docid": "eb17d96292fdb2bfab5413b569cabf00", "score": "0.5117979", "text": "def show\n @wardrobe_items = @capsule.wardrobe_items\n respond_to do |format|\n format.html\n format.json {render json: @wardrobe_items}\n end\n end", "title": "" }, { "docid": "5e1be10b1248fa732549fa55d85c0e0b", "score": "0.5117707", "text": "def index\n @racers = Racer.all\n\n render json: @racers\n end", "title": "" }, { "docid": "ce2e83887f86322822e5dba4d3ab0e5f", "score": "0.5105815", "text": "def new\n @racer = Racer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @racer }\n end\n end", "title": "" }, { "docid": "869839de9fdb076954564024d30aa5d1", "score": "0.50835276", "text": "def index\n @railways = Railway.all\n end", "title": "" }, { "docid": "c5fd2ba5a64d01539a70c6cc8fbddcc4", "score": "0.5080234", "text": "def riders\n @current_tab = \"Meetings\"\n \n sess = Patron::Session.new\n sess.base_url = \"http://online.equipe.com/\"\n #http://online.equipe.com/api/v1/meetings.json\n response = sess.get \"api/v1/meetings/\" + params[:id].to_s + \"/riders.json\"\n @meetings = JSON.parse response.body\n \n \n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @meetings }\n end\n \n end", "title": "" }, { "docid": "c54b6499c902f6b74621392ed8ece2ed", "score": "0.5080158", "text": "def index\n @bowlers = Bowler.all\n end", "title": "" }, { "docid": "4b7b45842374120d20b17b13e390505c", "score": "0.50697947", "text": "def show\n @learner = Portal::Learner.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @learner }\n end\n end", "title": "" }, { "docid": "f14ad5c1878abf9ca4c6675177b19898", "score": "0.5067831", "text": "def index\n @lesson_planners = LessonPlanner.all\n end", "title": "" }, { "docid": "e955c1cb6c292a0c3381e3f1c816199c", "score": "0.5045135", "text": "def index\n @laws = Law.where('jail_id =?', params[:jail_id])\n \n render json: @laws\n # respond_to do |format|\n # format.html\n # format.json { render json: @laws }\n # end\n end", "title": "" }, { "docid": "70cdf7772f8eadae6e4321943c8eede8", "score": "0.50290865", "text": "def index\n @user_challenges = UserChallenge.all\n render json: @user_challenges\n end", "title": "" }, { "docid": "c81b7ad78d49f0cf549d42e6224249df", "score": "0.5028535", "text": "def show\n client = Marvelite::API::Client.new(:public_key => ENV['MARVEL_KEY'], :private_key => ENV['MARVEL_SECRET'])\n .characters(:name => 'Spider-Man').to_json\n client = JSON.parse(client)\n comics = client['data']['results']\n render json: comics\n end", "title": "" }, { "docid": "9d8eaf1129d12732e19f81cb3dec9ac4", "score": "0.5027654", "text": "def index\n @brain_candies = BrainCandy.includes(:difficulty_level).all\n\n respond_to do |format|\n format.html # index.html.erb.erb\n format.json { render json: @brain_candies }\n end\n end", "title": "" }, { "docid": "6ae0b3a9c897fd983f8bc285810fa30f", "score": "0.501637", "text": "def show\n authorize @motel\n @rooms = @motel.rooms\n @revenues_rooms = revenues_resources(@rooms)\n end", "title": "" }, { "docid": "ae5b5f0c59472296ebfe0d6fb66ff786", "score": "0.50135815", "text": "def index\n @bunners = Bunner.all\n end", "title": "" }, { "docid": "ed2ca35ce6a29feeb95dc82261fc09e8", "score": "0.5002672", "text": "def new\n @challenge_activity = ChallengeActivity.new\n @challenge = Challenge.find(params[:challenge_id])\n @matriclicker = current_user.matriclicker\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @challenge_activity }\n end\n end", "title": "" }, { "docid": "c079e6b99b1256ff8b6d3f2ce2eda5f7", "score": "0.49991667", "text": "def challenger_leagues(queue: )\n raise ArgumentError,\n \"Invalid argument: #{queue}, arg must be in #{CHALLENGER_QUEUE_TYPES}\" unless CHALLENGER_QUEUE_TYPES.include?(queue)\n\n response_for CHALLENGER, {queue: queue}\n end", "title": "" }, { "docid": "bddab64516c5c5a635fd8631dfc3a195", "score": "0.49933165", "text": "def index\n @leagues = @sport.leagues\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @leagues }\n end\n end", "title": "" }, { "docid": "0b7811905fcf3f2f7c648833ea4c2454", "score": "0.49921685", "text": "def index\n @challenges = Challenge.all\n render json: @challenges\n end", "title": "" }, { "docid": "363a64ef76e4dcf06418de092091c594", "score": "0.49858683", "text": "def show\n @racer = Racer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @racer }\n end\n end", "title": "" }, { "docid": "61fafa3d1baa3f1100895afc491d6773", "score": "0.49828762", "text": "def challenger\n perform_request(api_url('league/challenger')).map { |l| League.new l }\n end", "title": "" }, { "docid": "61fafa3d1baa3f1100895afc491d6773", "score": "0.49828762", "text": "def challenger\n perform_request(api_url('league/challenger')).map { |l| League.new l }\n end", "title": "" }, { "docid": "827c1dd96611cc99300c29bef5bdf1b0", "score": "0.4976917", "text": "def show\n @enquirer = Enquirer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @enquirer }\n end\n end", "title": "" }, { "docid": "d5822b4832be00fbf2e731be58968090", "score": "0.49749488", "text": "def new\n @skill_challenge = SkillChallenge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @skill_challenge }\n end\n end", "title": "" }, { "docid": "95fb9297605c14f4507c97e81c71b05e", "score": "0.49720967", "text": "def index\n\t\t@leagues = League.all\n\t\trender json: @leagues\n\tend", "title": "" }, { "docid": "60d5de0cfead4034e27b92c2b12101eb", "score": "0.49700367", "text": "def index\n @thief_talents = ThiefTalent.all\n\n render json: @thief_talents\n end", "title": "" }, { "docid": "204c6c8c66c61faf6d6fdd98af57727f", "score": "0.49693498", "text": "def new\n @lessonplan = Lessonplan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lessonplan }\n end\n end", "title": "" }, { "docid": "da1c3f5e4f8fd4c01bd95ec0dd616230", "score": "0.49606594", "text": "def index\n @riders = Rider.all\n render json: @riders\n end", "title": "" }, { "docid": "190f830bc2a1f1beaa93a8db6a14b814", "score": "0.49541563", "text": "def suggestions\n @challenges = Challenge.where(\"status = #{Challenge::STATUSES[:suggested]} or status = #{Challenge::STATUSES[:approved]}\")\n\n respond_to do |format|\n format.html\n format.json { render json: @challenges }\n end\n end", "title": "" }, { "docid": "f8d658490ffefbff5e5f745d6a91a2d7", "score": "0.49513376", "text": "def index\n @ceremonies = Ceremony.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ceremonies }\n end \t\n end", "title": "" }, { "docid": "d6a879df85abc965945f045bb2476ecc", "score": "0.49480182", "text": "def larves\n self.class.get('/monstre_larve.json')\n end", "title": "" }, { "docid": "83a7594f98a08ee863d0f05e76432719", "score": "0.4941174", "text": "def show\n @technique = Technique.find(params[:id])\n\n render json: @technique\n end", "title": "" }, { "docid": "44ba4a0904fef4ef96490c1f0987cd27", "score": "0.49389932", "text": "def index\n @candidates = Candidate.all\n\n render json: @candidates\n end", "title": "" }, { "docid": "10af9e7344438fdd458810fc6d719930", "score": "0.4935918", "text": "def new\n @lesson_attempt = LessonAttempt.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lesson_attempt }\n end\n end", "title": "" }, { "docid": "bbdf2ef35cae4f26366218a1b75065fb", "score": "0.49346673", "text": "def new\n @smoothie = Smoothie.new\n @ingredients = Ingredient.all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @smoothie }\n end\n end", "title": "" }, { "docid": "7378630aebfa8c7626560607dd29011c", "score": "0.49306488", "text": "def new\n @enquirer = Enquirer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @enquirer }\n end\n end", "title": "" }, { "docid": "666f5c7078100088221319ee37dc4508", "score": "0.49295318", "text": "def show\n render json: @leader\n end", "title": "" }, { "docid": "8a73f2bb750c690f247e588b12b417c8", "score": "0.49282923", "text": "def index\n @api_v1_establishments = Establishment.all\n render json: @api_v1_establishments\n end", "title": "" }, { "docid": "13a13b18423fff592f99b5d164732b9c", "score": "0.49267003", "text": "def index #mapped as a GET request to the index.html.erb file\n @runners = Runner.all \n\n end", "title": "" }, { "docid": "2f48ce80a5939134934ea11726648aff", "score": "0.4926125", "text": "def new\n @teachers_reward = Teachers::Reward.new\n #where(:filter_id => [session[:filters]]).order(:name).collect { |lrc| [lrc.id,lrc.image.url,lrc.name]}\n\n respond_to do |format|\n format.html # new.html.haml\n format.json { render json: @teachers_reward }\n end\n end", "title": "" }, { "docid": "80279d76e7df16d89e3903d207c68612", "score": "0.4923517", "text": "def new\n @hitchhiker = Hitchhiker.new\n @brands = JSON.parse(RestClient.get(ENV['API_URL'] + 'vehicles/brands'))\n @models = []\n @years =[]\n @vehicles = []\n #@data.each do |d|\n\n # @brands.merge!d.to_hash\n #end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @hitchhiker }\n end\n end", "title": "" }, { "docid": "a36c5a042cf38d4763325c73c8d3f0b2", "score": "0.4923304", "text": "def index\n @guesses = @challenge.guesses\n end", "title": "" }, { "docid": "75d76da8677445437d8441950c9aa9bd", "score": "0.49229303", "text": "def new\n @capsul = Capsul.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @capsul }\n end\n end", "title": "" }, { "docid": "d1fc258af7cd215f945643008877f787", "score": "0.4921456", "text": "def index\n @ladders = Ladder.all\n\n render json: @ladders\n end", "title": "" }, { "docid": "3b4c4eabe0f28bbccfd168e544c4b696", "score": "0.49198636", "text": "def available_achievements\n render json: achievements\n end", "title": "" }, { "docid": "8a2cc7e05ac1d0694520dd5043a879da", "score": "0.49175403", "text": "def index\n @nerds = Nerd.all\n render json: @nerds\n end", "title": "" }, { "docid": "6ee3de5a0b6927591ac74f707c69f1e1", "score": "0.49142975", "text": "def index\n @habits = Habit.all\n\n render json: @habits\n end", "title": "" }, { "docid": "4a439d772d8b9b3169e66d5a9559359f", "score": "0.4905085", "text": "def index\n @lawyers = Lawyer.all\n end", "title": "" }, { "docid": "b673bf7cc4c0470ac013f7108724d05b", "score": "0.49036482", "text": "def index\n #deeply nested... so starts with gyms,goes to trainers,goes to clients.\n #since clients belongs to trainer we use trainer here..\n #but in trainers_controller the trainers belongs to gyms so gyms is used orignally.\n @trainer=Trainer.find(params[:trainer_id])\n @clients=Client.where(trainer_id: @trainer.id)\n render json:@clients, status: :ok\n end", "title": "" }, { "docid": "f11a22d09403f0e2a414b1bfd939488a", "score": "0.4902019", "text": "def show_leaders\n @leaders = User.all.order(score: :desc).limit(30)\n\n result = HTTParty.get(\"https://api.vk.com/method/users.get\", query: {\n user_ids: @leaders.map { |l| l.vk_id }.join(\",\"),\n fields: 'photo_50',\n access_token: Rails.application.config.vk[:access_token],\n v: '5.103',\n lang: 'ru'\n }, logger: Rails.logger, log_level: :debug, log_format: :curl)\n\n response = JSON.parse(result.body)\n @leaders_info = response['response']\n\n # merge @leaders and leaders_info\n @leaders_info.each do |leader|\n leader['score'] = @leaders.select { |l| l.vk_id == leader['id'] }[0].score\n end\n respond_to do |format|\n format.html { render 'application/show_leaders' }\n format.json { render json: @leaders_info }\n end\n end", "title": "" }, { "docid": "861d100c447956570ad0ade81547f968", "score": "0.49002105", "text": "def set_capsule\n @capsule = Capsule.find(params[:id])\n end", "title": "" }, { "docid": "861d100c447956570ad0ade81547f968", "score": "0.49002105", "text": "def set_capsule\n @capsule = Capsule.find(params[:id])\n end", "title": "" }, { "docid": "68d90f48973e9355fa7f85fc11164e9f", "score": "0.48962805", "text": "def index\n @learner_styles = LearnerStyle.all\n end", "title": "" }, { "docid": "a46d43d5027276b30f69d4adf7f8dd29", "score": "0.48882636", "text": "def division_leaders(division_id, type: 'Regular Season', limit: 20, metrics: [:points, :goals, :assists, :goals_against_average, :save_percentage, :wins, :shutouts, :number_first_stars, :number_stars])\n JSON.parse(@client.get(url(\"division/#{division_id}/leaders\"), query: {limit: limit, metrics: metrics.join(','), type: type}, header: headers).body)\n end", "title": "" }, { "docid": "5632b0cd68d9946ff139b46a99c0a66f", "score": "0.48872826", "text": "def index\n # TODO - this should only be enabled for an admin, no user should ever see everyone's headaches\n @headaches = Headache.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @headaches }\n end\n end", "title": "" }, { "docid": "e5ee53e43b9e2b1147557280b6ae7bfd", "score": "0.48860693", "text": "def index\n @cyclists = Cyclist.all \n=begin\n @client = Strava::Api::V3::Client.new(:access_token => \"f4d2110fa049267d3d49a4e2fea2d8b51329fb6c\")\n result = @client.list_athlete_activities\n open('list_athlete_activities_donald.json', 'w') do |f|\n f.puts result\n end\n=end\n=begin\n auth_param = 'Bearer ' + 'b9405ea739177180f34b207826b64e801a024ca6'\n result = RestClient.get \"https://www.strava.com/api/v3/activities/565825056?include_all_efforts=true\", :Authorization => auth_param\n open('tyler_activity_565825056.json', 'w') do |f|\n f.puts result\n end \n=end\n end", "title": "" }, { "docid": "1357de8bb7849cfc8dfc7258a752fc3c", "score": "0.48856765", "text": "def request\n HTTParty.get('http://api.brewerydb.com/v2/beer/' + @beer_id + '?withBreweries=Y&key=' + ENV['API_KEY'] + '&format=json')\n end", "title": "" }, { "docid": "1357de8bb7849cfc8dfc7258a752fc3c", "score": "0.48856765", "text": "def request\n HTTParty.get('http://api.brewerydb.com/v2/beer/' + @beer_id + '?withBreweries=Y&key=' + ENV['API_KEY'] + '&format=json')\n end", "title": "" }, { "docid": "658feef13794c2f290a70fb54984a528", "score": "0.48852524", "text": "def show\n\n render json: @racer\n end", "title": "" }, { "docid": "8d4ec36722f117af76d61e7c89699306", "score": "0.48840505", "text": "def get_discipline_list\n response = RestClient.get(\"http://www.gw2spidy.com/api/v0.9/json/disciplines\")\n disciplines = JSON.parse(response)\n disciplines[\"results\"]\nend", "title": "" }, { "docid": "963f8762e2c7c1dacdeb72a7b055391a", "score": "0.48772454", "text": "def index\n @boulder_routes = BoulderRoute.all\n end", "title": "" }, { "docid": "84123e94bf215bfe182d6ea2bef328c5", "score": "0.48749527", "text": "def show\n @lessonplan = Lessonplan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lessonplan }\n end\n end", "title": "" }, { "docid": "e22e59c07125544115ecb1c2acd8a1de", "score": "0.48710874", "text": "def new\r\n @race_runner = RaceRunner.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render :json => @race_runner }\r\n end\r\n end", "title": "" }, { "docid": "85818796e3bb27736fcd05098cc98117", "score": "0.48695302", "text": "def leaders(campaign_name, opts = {})\n\t\t\t\t#* This could just call Playapi::Interactions.list with most points params...\n\t\t\t\turl = \"api/v2/campaigns/#{campaign_name}/leaders\"\n\t\t\t\tget_object(:get, \"results\", url, opts)\n\t\t\tend", "title": "" }, { "docid": "6d609c69cc44a44c47ed6ca6078069f6", "score": "0.48686564", "text": "def index\n @teachers = Teacher.all\n render json: @teachers\n end", "title": "" }, { "docid": "6ac8cf03c83a9090fe4c4f032b34e198", "score": "0.4863573", "text": "def index\n render json: Candidate.all\n end", "title": "" }, { "docid": "6ac8cf03c83a9090fe4c4f032b34e198", "score": "0.4863573", "text": "def index\n render json: Candidate.all\n end", "title": "" }, { "docid": "526a684a5edae647e3adea9abe0a4fb9", "score": "0.48586816", "text": "def index\n @armors = Armor.all\n\n render json: @armors\n end", "title": "" }, { "docid": "f746a473531b83976b3c21f02c5c5da9", "score": "0.4856091", "text": "def campaigners\n return get(\"/campaigners/list\")\n end", "title": "" }, { "docid": "15504d217eb372847f7231cf132095a7", "score": "0.48547497", "text": "def index\n render json: @bowties\n end", "title": "" }, { "docid": "a92694900fdf9fce933f1c6bb21d9acc", "score": "0.48516315", "text": "def set_learnable\n @learnable = Learnable.find(params[:id])\n end", "title": "" }, { "docid": "a92694900fdf9fce933f1c6bb21d9acc", "score": "0.48516315", "text": "def set_learnable\n @learnable = Learnable.find(params[:id])\n end", "title": "" }, { "docid": "cabb737b7fb835c0c25b8d4c35f37979", "score": "0.48483568", "text": "def show\n render json: @thief_talent\n end", "title": "" }, { "docid": "b53eb75a4f7a24ab079fa895de0dbf60", "score": "0.4847044", "text": "def create\n @capsule = Capsule.new(capsule_params)\n respond_to do |format|\n if @capsule.save\n format.html { redirect_to @capsule, notice: 'Capsule was successfully created.' }\n format.json { render :show, status: :created, location: @capsule }\n else\n format.html { render :new }\n format.json { render json: @capsule.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
3cea2cba1b3b6601549364cbb45ef741
for chicken in chicken_hashes p chicken[:name] + " has laid " + chicken[:eggs].to_s() + " eggs" if chicken[:eggs] > 0 p "Whoop! Eggs!" end end
[ { "docid": "621405f6c0065c966f772cc05da395d4", "score": "0.6140553", "text": "def count_eggs(chicken_array)\n total_eggs = 0\n for chicken in chicken_array\n total_eggs += chicken[:eggs]\n end\n return total_eggs\nend", "title": "" } ]
[ { "docid": "e73a1fb85e1fdb49f005b2351676e8da", "score": "0.71530175", "text": "def look_pretty(grocery_hash)\n grocery_hash.each do |grocery, quantity|\n puts \"We need #{grocery}: #{quantity}\"\nend\n \nend", "title": "" }, { "docid": "9f9dae941e806f33644eb7c3ca9de3cc", "score": "0.6542369", "text": "def hash_printer(hash)\n puts \"Grocery List\"\n hash.each do |key, value|\n puts \"You need #{value} #{key}(s).\"\n end\nend", "title": "" }, { "docid": "0bedb4a075ffef9d727597345b96d83e", "score": "0.6519494", "text": "def grocery_printed_pretty(groceryhash)\n $groceryhash.map do |food_item, food_quantity|\n puts \"#{food_item.to_s} : #{food_quantity}\"\n end\nend", "title": "" }, { "docid": "01cfb165f4560781cc33d83588f11601", "score": "0.6374678", "text": "def list_pets\n dog_n = self.pets[:dogs].size\n cat_n = self.pets[:cats].size\n fish_n = self.pets[:fishes].size\n\n \"I have #{fish_n} fish, #{dog_n} dog(s), and #{cat_n} cat(s).\"\n #self.pets.each do |key,value|\n \n end", "title": "" }, { "docid": "341c9c46e92761653bb07b41f1f3c2ec", "score": "0.63671064", "text": "def ingredients_and_amounts(recipe_hash)\n recipe_hash.each do |ingredient,amount|\n puts \"#{amount} of #{ingredient}\"\n end\nend", "title": "" }, { "docid": "9a74b77f91d1e61fad1ace79a74a6569", "score": "0.6357298", "text": "def printhash(hash)\n puts \"-----------------------\"\n hash.each { |item, qty| \n puts \"#{item},\\n qty: #{qty}\"\n puts \"\"\n }\n puts \"-----------------------\"\nend", "title": "" }, { "docid": "6783a7a0e18d273f04f53ece36693f2f", "score": "0.6345823", "text": "def ingredients(recipe_hash)\n recipe_hash.each do |ingredient,amount|\n puts ingredient\n end\nend", "title": "" }, { "docid": "f68d554acb726c79e336428d2dc4691b", "score": "0.63457066", "text": "def print_list(hash)\r\n grocery_list=hash\r\n grocery_list.each do |item, quantity|\r\n puts \"You need to get #{quantity} of #{item}\"\r\n end\r\nend", "title": "" }, { "docid": "c34bdd79de482613b7e54a4a3bb5ddc6", "score": "0.6315085", "text": "def prettyfie_list(hash)\r\n puts \"This is your current grocery list:\"\r\n puts \"\\n\"\r\n hash.each {|key, value| puts \"#{key} quantity = #{value}\" }\r\n puts \"\\n\"\r\nend", "title": "" }, { "docid": "7a3750f1f5f36e724289c241a520fcc1", "score": "0.61940867", "text": "def print_method(hash)\n\thash.each do |grocery, quantity| #print out in in different line\n\tputs \"In your bag you have #{quantity} #{grocery}\" #mulitple lines of string\n\tend\nend", "title": "" }, { "docid": "d8b3464c3cbaa1ef5baf732fa05ad930", "score": "0.6162242", "text": "def recipe_ingredients(recipe_hash)\n recipe_hash.each do |ingredient,amount|\n \"#{amount} of #{ingredient}\"\n end\nend", "title": "" }, { "docid": "b3ac874caa15600b04a5214a6e2b7e16", "score": "0.6128637", "text": "def report_by_name(hash)\n\tnames = hash.keys.sort\n\tnames.each do |name|\n\t\tputs name.to_s + \"'s favorite flavor(s) are: \" + hash[name].join(', ')\n\tend\nend", "title": "" }, { "docid": "14b31e14d74a6e86107b8e9661fc0f97", "score": "0.61265963", "text": "def ingredients(perfect_10_recipe)\n perfect_10_recipe.each_key do |x|\n puts \"#{x}\"\n end\nend", "title": "" }, { "docid": "7a23f2aabd975f5982947334ceeab977", "score": "0.6120089", "text": "def list_pocket_money_hash\n p \"My Pocket Money\" # Just for display\n @pocket_money.each {|key, value| puts \"#{key} is: #{value}\" }\nend", "title": "" }, { "docid": "b7115b426ccee635071146e01e85a313", "score": "0.6118029", "text": "def every_favourite_food(people)\n #Create a empty array to save all the strings\n all_food = \"\"\n #For loop to iterate person in the array people\n for person in people\n #For loop to iterate in snacks in person\n for snacks in person[:favourites][:snacks]\n #adds new items to the array\n p snacks\n all_food += snacks += \" \"\n end\n end\n all_food.chop!\n return all_food\nend", "title": "" }, { "docid": "da3b2feb24dc210f50001357fb257eb4", "score": "0.61071354", "text": "def pretty_list(hash)\r\n puts \"Grocery List:\"\r\n puts \" \"\r\n hash.each do |item_name, quantity|\r\n puts \"#{item_name}: #{quantity}\"\r\n end\r\nend", "title": "" }, { "docid": "0cbd666dd070784828c96ec19fd4ecb3", "score": "0.609125", "text": "def print_grocery_hash(grocery_hash)\n item_array = grocery_hash.keys\n puts \"-------------------\"\n if item_array.length == 0\n puts \"Grocery list is empty\"\n end\n item_array.each do |item| # item is a symbol already\n puts \"#{item.to_s}: #{grocery_hash[item]}\"\n end\n puts \"-------------------\"\n grocery_hash\nend", "title": "" }, { "docid": "3599e66b33b71b5568fec953f6a33522", "score": "0.6085277", "text": "def spiciest_foods(spicy_foods)\n spicy_foods.select { |spicy_food_hash| spicy_food_hash[:heat_level] > 5}\nend", "title": "" }, { "docid": "9d607a43b52d6b0b90e13de7245ae3d8", "score": "0.5954832", "text": "def print_list(hash)\n puts \"Grocery list:\"\n hash.each {|item, quantity| puts \"#{item} - #{quantity}\"}\nend", "title": "" }, { "docid": "a40b1cbc71b0fb8776a8675f67e3a386", "score": "0.59269905", "text": "def amount_of_chocolate_chips(perfect_10_recipe)\n puts perfect_10_recipe[:mini_dark_chocolate_chips]\nend", "title": "" }, { "docid": "add4a85f61980dc833387a8cc249d4ed", "score": "0.5916377", "text": "def print_list(input_hash)\n# steps: iterate through the hash and print keys/values\n puts \"Here are the items on your list\"\n input_hash.each do |item, qty|\n p \"For item #{item}, we have #{qty}\" \n end \n# output: nil\nend", "title": "" }, { "docid": "10c398819999bb68dcc81c398b576b0c", "score": "0.5915249", "text": "def main\n fizzbuzz = []\n for i in 1..100\n h = {}\n h[:n] = i\n h[:f] = \"Fizz\" if i % 3 == 0\n h[:b] = \"Buzz\" if i % 5 == 0\n fizzbuzz << h\n end\n fizzbuzz.each do |fb|\n if fb[:f] or fb[:b] then\n puts \"#{fb[:f]}#{fb[:b]}\"\n else\n puts fb[:n]\n end\n end\nend", "title": "" }, { "docid": "c804384ae2435d52544237fb31c888d3", "score": "0.5884865", "text": "def print_list (grocery_hash)\n puts \"Here is your list:\"\n grocery_hash.each do |key, value|\n puts \"#{key}: #{value}\"\n end\nend", "title": "" }, { "docid": "6e93c621466aa003f285c0599df7dad0", "score": "0.5852989", "text": "def amounts(recipe_hash)\n recipe_hash.each do |ingredient,amount|\n puts amount\n end\nend", "title": "" }, { "docid": "df3683afb85a15e46a3772c7ae9057ed", "score": "0.58501595", "text": "def print_hash(select_hash)\n select_hash.each do |k,v|\n p \"#{k}-#{v}\"\n p \"*\"\n end\nend", "title": "" }, { "docid": "a68a0ff9a3395bf51d2eca86cbe5ef09", "score": "0.58498466", "text": "def bakery_num(num_of_people, fav_food) \n \n my_list = {\"pie\" => 8, \"cake\" => 6, \"cookie\" => 1} \n \n has_fave = false \n\n my_list.each_key do |k| \n if k == fav_food\n has_fave = true\n end\n end\n \n if has_fave == false\n raise ArgumentError.new(\"You can't make that food\")#raise error if has_fave is #false will catch items that are not included in program\n \n else fav_food_qty = my_list[fav_food] #setting fav_food_qty equal to value in my_list\n \n if num_of_people % fav_food_qty == 0 #if perfectly divisible...\n num_of_food = num_of_people / fav_food_qty\n return \"You need to make #{num_of_food} #{fav_food}(s).\"\n \n else #the scenario where the favorite food is not perfectly divisible\n final_hash = my_list \n my_list.each do |k, v|\n final_hash[k] = num_of_people / v\n num_of_people %= v\n end\n\n stringOut = \"You need to make \"\n stringMod = \"\"\n stringEnd = \"\"\n mod_hash = final_hash.dup.delete_if {|k, v| k == \"cookie\" } #Assumes that cookies always feeds one \n last_hash = final_hash.dup.delete_if {|k, v|k != \"cookie\" } #See above\n\n mod_hash.each do |k,v| \n stringMod += \"#{v}\" + \" \" + \"#{k}(s)\" + \",\" + \" \"\n end\n\n last_hash.each do |k,v|\n stringEnd += \"and #{v}\" + \" \" + \"#{k}(s)\" + \".\"\n end\n end\n end\n return stringOut + stringMod + stringEnd #purpose of this is to return as String\nend", "title": "" }, { "docid": "0b5ed10c1e30e2c9250de7f32f78e161", "score": "0.5820962", "text": "def print(hash)\r\n\thash.each do |key, value|\r\n puts \"Item: #{key} Quantity: #{value}\"\r\nend\r\nend", "title": "" }, { "docid": "b3555606e43d7ed28b889b12a67405dc", "score": "0.5819703", "text": "def display_list(grocery)\n # input: Hash \n # steps: If the list is empty, display the list is empty message.\n if grocery == {}\n \tputs \"The grocery list is empty\" \n \tputs \"-\" * 50\n else\n #output: print each element and its quantity in a sentence using .each\n puts \"The grocery list is: \"\n grocery.each do |item,quantity|\n puts \"Item name: #{item} and the Quantity is : #{quantity}\"\n end\n end\n puts \"-\" * 50\nend", "title": "" }, { "docid": "99f82aa774fd05ce45872b4a9f7b87ae", "score": "0.578922", "text": "def display_pegs\n\tputs \"Peg A = \" + $pegs[\"a\"].to_s\n\tputs \"Peg B = \" + $pegs[\"b\"].to_s\n\tputs \"Peg C = \" + $pegs[\"c\"].to_s\nend", "title": "" }, { "docid": "8d929d8c4fa7497f07c5c1e3dd4f9513", "score": "0.5789167", "text": "def bakery_num(num_of_people, fav_food)\n my_list = {\"pie\" => 8, \"cake\" => 6, \"cookie\" => 1}\n pie_qty = 0\n cake_qty = 0\n cookie_qty = 0\n \n has_fave = false\n\n my_list.each_key do |k|\n if k == fav_food\n has_fave = true\n fav_food = k\n end\n end\n if has_fave == false\n raise ArgumentError.new(\"You can't make that food\")\n else\n fav_food_qty = my_list.values_at(fav_food)[0]\n if num_of_people % fav_food_qty == 0\n num_of_food = num_of_people / fav_food_qty\n return \"You need to make #{num_of_food} #{fav_food}(s).\"\n else num_of_people % fav_food_qty != 0\n while num_of_people > 0\n if num_of_people / my_list[\"pie\"] > 0\n pie_qty = num_of_people / my_list[\"pie\"]\n num_of_people = num_of_people % my_list[\"pie\"]\n elsif num_of_people / my_list[\"cake\"] > 0\n cake_qty = num_of_people / my_list[\"cake\"]\n num_of_people = num_of_people % my_list[\"cake\"]\n else\n cookie_qty = num_of_people\n num_of_people = 0\n end\n end\n return \"You need to make #{pie_qty} pie(s), #{cake_qty} cake(s), and #{cookie_qty} cookie(s).\"\n end\n end\nend", "title": "" }, { "docid": "b5d3e781d7b5e1d203d634077270db5e", "score": "0.5784579", "text": "def list_all_animals(shelter)\n\n if shelter.animals.any?\n puts \"*** List of all animals ***\"\n shelter.animals.each do |key, x|\n puts \"Name: #{x.name}, Breed: #{x.breed}, Gender: #{x.gender}, Age: #{x.age}, Toys: #{x.toys.join(', ')}, Adoption: #{x.adoption}\"\n end\n else\n puts \"We have no animals left!\"\n end\n\nend", "title": "" }, { "docid": "aea4ac346eb3b590dcf41433fcfcd7f3", "score": "0.57735306", "text": "def poach_eggs (egg_stuff)\n (egg_stuff[:number_of_eggs] * egg_stuff[:minutes_to_poach])\nend", "title": "" }, { "docid": "47547e8e3e303e8119322a7747af9fbb", "score": "0.57622015", "text": "def nr_for_shops(the_array_of_hashes)\n the_array_of_hashes.each do |hash_info|\n hash_info[:shops].each_with_index do |value, index|\n puts \"#{hash_info[:name]}, tiene stock no registrado en la bodega #{index}\" if value == \"NR\"\n end\n end\nend", "title": "" }, { "docid": "282f0c81409afaf21e20f5e6353d1ef2", "score": "0.57513404", "text": "def bakery_num(num_of_people, fav_food)\n # Hash to show the serving zise of each food item \n my_list = {\"pie\" => 8, \"cake\" => 6, \"cookie\" => 1}\n # Raise an error if fav_food is not one of my_list\n raise ArgumentError.new(\"You can't make that food\") if my_list[fav_food].nil?\n # Initialize each quantity at zero\n supplies = { \"pie\" => 0,\n \"cake\" => 0,\n \"cookie\" => 0}\n \n left_over = num_of_people % my_list[fav_food]\n supplies[fav_food] = num_of_people/my_list[fav_food]\n if left_over == 0\n \"You need to make #{supplies[fav_food]} #{fav_food}(s).\"\n else \n my_list.each do |k, v|\n if left_over >= v \n supplies[k] = left_over / v\n left_over = left_over % v\n end\n end\n return \"You need to make #{supplies['pie']} pie(s), #{supplies['cake']} cake(s), and #{supplies['cookie']} cookie(s).\"\n end\nend", "title": "" }, { "docid": "4e23267a583cc83cda08083cfd8edead", "score": "0.5747093", "text": "def print_expenses(expenses)\n puts \"Expenses: \"\n # Print all the expenses in chosen period\n expenses.each_with_index do |hash, index|\n puts Rainbow(\"#{index + 1}. On #{hash['date']} you spent $#{hash['price']}, Category: #{hash['category']}, Comment: #{hash['comment']}\").whitesmoke\n end\nend", "title": "" }, { "docid": "aaa9e7fe9a4d917e4d4d9c8e14a39465", "score": "0.57455355", "text": "def bakery_num(num_of_people, fav_food)\n # Hash to show the serving zise of each food item \n my_list = {\"pie\" => 8, \"cake\" => 6, \"cookie\" => 1}\n # Raise an error if fav_food is not one of my_list\n raise ArgumentError.new(\"You can't make that food\") if my_list[fav_food].nil?\n # Initialize each quantity at zero\n supplies = { \"pie\" => 0,\n \t\t\t \"cake\" => 0,\n \t\t\t \"cookie\" => 0 }\n \n left_over = num_of_people % my_list[fav_food]\n supplies[fav_food] = num_of_people/my_list[fav_food]\n if left_over == 0\n \"You need to make #{supplies[fav_food]} #{fav_food}(s).\"\n else \n my_list.each do |k, v|\n if left_over >= v \n supplies[k] = left_over / v\n left_over = left_over % v\n end\n end\n return \"You need to make #{supplies['pie']} pie(s), #{supplies['cake']} cake(s), and #{supplies['cookie']} cookie(s).\"\n end\nend", "title": "" }, { "docid": "c65104596e90e152d2d130a5c0f150d9", "score": "0.57430655", "text": "def true_for_food(hash, item)\n food= hash[:favourites][:things_to_eat]\n\n for i in hash\n if i == food\n\n return \"Yes I like this food\"\n end\n end\n return \"No I don't like this\"\n end", "title": "" }, { "docid": "502f00341865d707876d619e5b97e6dd", "score": "0.5736234", "text": "def print_list(hash)\n hash.each do |item, quantity|\n puts item + \" : \" + quantity.to_s\n end\n end", "title": "" }, { "docid": "cc7d1a3deb1ed725197c92e9843f2cce", "score": "0.57357836", "text": "def cantidad_menor(the_array_of_hashes)\n puts \"Cantidad a consultar\"\n num = gets.chomp.to_i\n the_array_of_hashes.each do |hash|\n hash[:shops].each_with_index do |stock, index|\n if stock.to_i <= num\n puts \"El #{hash[:name]} tiene: #{stock} en la tienda/bodega #{index}\"\n end\n end\n end\nend", "title": "" }, { "docid": "aafe40db50a1f6810207e5fb57443709", "score": "0.5730048", "text": "def bakery_num(num_of_people, fav_food) #defining method bakery_num, which takes 2 arguments\n my_list = {\"pie\" => 8, \"cake\" => 6, \"cookie\" => 1, \"pudding\" => 2, \"bunt cake\" => 4, \"mega-cupcakes\" => 3} #creates hash my_list, key is food, value is number\n pie_qty = cake_qty = cookie_qty = has_fave = 0 \n \n\n my_list.each_key do |k| #iterating through array my_list\n if k == fav_food #tests if each item in array my_list = fav_food\n has_fave = 1 #if test above passes, set has_fave to true\n # fav_food = k #if test above passes, set fav_food to k\n end\n end\n \n if has_fave == 0 #if fav_food is not a key, end program\n raise ArgumentError.new(\"You can't make that food\")\n else #if fav_food is a key\n fav_food_qty = my_list.values_at(fav_food)[0] #set fav_food_qty equal to the value of fav_food\n if num_of_people % fav_food_qty == 0 \n num_of_food = num_of_people / fav_food_qty #if num_of_people is evenly divisible by fav_food_qty\n return \"You need to make #{num_of_food} #{fav_food}(s).\"\n \n #num_of_food = num_of_people / fav_food_qty #then perform division by integer\n #return \"You need to make #{num_of_food} #{fav_food}(s).\" #return \"You need to make (num_of_food) (fav_food)s\"\n else num_of_people % fav_food_qty != 0 #redundant else\n while num_of_people > 0 #while num_of_people is greater than 0\n if num_of_people / my_list[\"pie\"] > 0 #if num_of_people divided by value of pie is greater than 0\n pie_qty = num_of_people / my_list[\"pie\"] #set pie_qty equal to num_of_people divided by value of pie in hash\n num_of_people = num_of_people % my_list[\"pie\"] #set num_of_people equal to the remainder of num_of_people divided by value of pie in hash\n elsif num_of_people / my_list[\"cake\"] > 0 #if num_of_people divided by hash value of cake is greater than 0\n cake_qty = num_of_people / my_list[\"cake\"] #set cake_qty equal to num_of_people divided by hash value of cake\n num_of_people = num_of_people % my_list[\"cake\"] #set num_of_people equal to the remainder of num_of_people divided by value of cake in hash\n else\n cookie_qty = num_of_people #set cookie_qty equal to num_of_people\n num_of_people = 0 #set num_of_people equal to 0\n end\n end\n return \"You need to make #{pie_qty} pie(s), #{cake_qty} cake(s), and #{cookie_qty} cookie(s).\" #print out\n end\n end\n \nend", "title": "" }, { "docid": "734382caf6d52d176827802a37d48855", "score": "0.57293797", "text": "def print_list(hash)\n\tputs \"\" \n hash.each do |item, qty|\n puts \"#{item}: #{qty}\\n\"\n end\nend", "title": "" }, { "docid": "474d1e307fd2f2b918b1551e49fee974", "score": "0.5727608", "text": "def print_list(hash)\n hash.each do |x,v|\n puts \"the item is #{x} and the quantity is #{v}.\"\n end\nend", "title": "" }, { "docid": "09939eb6158e4bfa94b887a067c209bf", "score": "0.5727365", "text": "def iterate_through_hash\n add_a_key_value_pair.each {|key, value|\n puts \"The #{key} summer olympics took place in #{value}.\"}\nend", "title": "" }, { "docid": "e49452e99ff9b9eb893eeb453ad86ca7", "score": "0.5717824", "text": "def bakery_num(num_of_people, fav_food) #Defining a function that takes two parameters\n my_list = {\"pie\" => 8, \"cake\" => 6, \"cookie\" => 1} #Declaring a my_list hash\n pie_qty = 0 # Assigning three other variables \n cake_qty = 0\n cookie_qty = 0\n \n has_fave = false #setting a default value of false \n\n my_list.each_key do |k| #looping through the keys of my_list\n if k == fav_food #An if statement, where the condition is comapred to one of the parameters\n has_fave = true #If true, declaring a has_fave to true \n fav_food = k #Assigning fav_food to that key\n end\n end\n if has_fave == false #If no matec ==> error\n raise ArgumentError.new(\"You can't make that food\")\n else\n fav_food_qty = my_list.values_at(fav_food)[0] #If match ==> find value from Hash \n if num_of_people % fav_food_qty == 0 #Module of the first function parameter, number of people by fav food quantity\n num_of_food = num_of_people / fav_food_qty #If true, get portions \n return \"You need to make #{num_of_food} #{fav_food}(s).\" #return an order \n else num_of_people % fav_food_qty != 0 #redundant but if not \n while num_of_people > 0 \n if num_of_people / my_list[\"pie\"] > 0 #if there are more people than pies\n pie_qty = num_of_people / my_list[\"pie\"] #This gets portions\n num_of_people = num_of_people % my_list[\"pie\"] #this gets amount of people for leftovers \n elsif num_of_people / my_list[\"cake\"] > 0 #If the number of people is not rgeater than pies, we go into cakes\n cake_qty = num_of_people / my_list[\"cake\"]\n num_of_people = num_of_people % my_list[\"cake\"]\n else\n cookie_qty = num_of_people\n num_of_people = 0\n end\n end\n return \"You need to make #{pie_qty} pie(s), #{cake_qty} cake(s), and #{cookie_qty} cookie(s).\"\n end\n end\nend", "title": "" }, { "docid": "347782d09ae19d8c8e3f4f43db23e2d5", "score": "0.57110703", "text": "def print_list(grocery_hash={})\n\tputs \"*\" * 40\n\tputs \"Grocery List\"\n\tputs \"*\" * 40\n\tgrocery_hash.each do |food, quantity| puts \"#{food}:\".ljust(30) + \"#{quantity}\".rjust(10)\n\tend\n\tputs \"\"\nend", "title": "" }, { "docid": "079a5afb427e04a451237146477261ae", "score": "0.57097507", "text": "def beautify_hash(hash)\n hash.each do |item, quantity|\n puts \"#{item.capitalize}: #{quantity}\"\n end\nend", "title": "" }, { "docid": "eb53d5ee96d271051a3a02eca944b3e6", "score": "0.57055503", "text": "def print_hash(list)\nputs \"Current grocery list:\"\nputs \"---------------------\"\nlist.each do |item_name, item_quant|\n puts \" #{item_name}: #{item_quant}\"\nend\nend", "title": "" }, { "docid": "5783d2f6f195007c0ae447edc2dd3bdc", "score": "0.5702949", "text": "def pretty_print_list(hash)\n\thash.each do |key, value|\n\t\tputs \"You need #{value}, #{key}\"\n\tend\nend", "title": "" }, { "docid": "ce5721e973626b341787e45f48ac2060", "score": "0.5699759", "text": "def bakery_num(num_of_people, fav_food)\n my_list = {\"pie\" => 8, \"cake\" => 6, \"cookie\" => 1}\n food_array = []\n has_fave = false\n\n my_list.each_key do |k|\n if k == fav_food\n has_fave = true\n end\n end\n raise ArgumentError.new(\"You can't make that food\") if has_fave == false\n fav_food_qty = my_list[fav_food]\n if num_of_people % fav_food_qty == 0\n num_of_food = num_of_people / fav_food_qty\n return \"You need to make #{num_of_food} #{fav_food}(s).\"\n else num_of_people % fav_food_qty != 0\n while num_of_people > 0\n my_list.each do |k, v|\n food_qty = num_of_people / v\n num_of_people = num_of_people % v\n food_array << food_qty\n end\n end\n return \"You need to make #{food_array[0]} pie(s), #{food_array[1]} cake(s), and #{food_array[2]} cookie(s).\"\n end\nend", "title": "" }, { "docid": "3b1f8518de9138b9029235f102610c0d", "score": "0.5699096", "text": "def team_names(hashketball)\r\n puts \"The #{hashketball[:home][:team_name]} welcome the #{hashketball[:away][:team_name]}\"\r\n puts \r\nend", "title": "" }, { "docid": "2df41266ed170fa399479913eb2d6137", "score": "0.56956136", "text": "def print_list(list_hash)\n list_hash.each do |key,value|\n puts \"The quantity of #{key} is: #{value}\"\n end\nend", "title": "" }, { "docid": "a8f46cac9826982be205f9221a275aa1", "score": "0.56803644", "text": "def report_by_flavors(hash)\n\tflavors = {}\n\tflavor_array = []\t\n\thash.each do |name, flavor|\n\t\tif flavor_array.include? (flavor)\n\t\t\tflavors[flavor].push(name)\n\t\t#checks if hash already has given flavor as a key\n\t\t#creates a list of names by retrieving key from original hash\n\t\telse\n\t\t\tflavors[flavor] = [name]\n\t\t\tflavor_array.push flavor\n\t\tend\n\tend\n\tputs flavors\nend", "title": "" }, { "docid": "8a23bc66cf6e522bc361518abdbe4aab", "score": "0.5672034", "text": "def print_list(hash)\n hash.each do |item, quantity|\n puts \"#{item}: #{quantity}\"\n end\nend", "title": "" }, { "docid": "8420aba8cd54182d4bc4ad5d45c0f21e", "score": "0.56687117", "text": "def print_out_json_that_contains_a_hash hash\n\n\thash.each do |key, value|\n\n\t\tif is_hash? value\n\n\t\t\tprint_out_json_that_contains_a_hash(value)\n\t\t\t\n\t\telse\n\t\t\tprint_stuff(key, value)\n\n\t\tend\n\n\tend\n\nend", "title": "" }, { "docid": "58b27d17197cb6e350001cfaf7d4a8e9", "score": "0.56567544", "text": "def print_list(hash)\n puts \"Grocery List\"\n hash.each do |item|\n puts item\nend\nend", "title": "" }, { "docid": "6171be7b0f71723543cb3f6117ab6398", "score": "0.5641168", "text": "def bakery_num(num_of_people, fav_food) #defines the method and accepts arguments num_of_people and fav_food\n my_list = {\"pie\" => 8, \"cake\" => 6, \"cookie\" => 1} \n pie_qty = 0 #declaring variables at 0\n cake_qty = 0 #declaring variables at 0\n cookie_qty = 0 #declaring variables at 0\n \n has_fave = false\n\n my_list.each_key do |k| #iterates through the keys in my_list\n if k == fav_food #checks if passed argument fav_food is in the hash as a key\n has_fave = true #sets boolean has_fave to true\n fav_food = k #re-assigns fav_food to the key in the hash\n end\n end\n \n if has_fave == false #if fav_food is not found in the list\n raise ArgumentError.new(\"You can't make that food\") #raise an error\n else\n fav_food_qty = my_list.values_at(fav_food)[0] #declares a variable that is the quantity of fav food argument and sets it equal to first element in the value\n \n if num_of_people % fav_food_qty == 0 #if number of people is divisable by quantity of fav food\n num_of_food = num_of_people / fav_food_qty #number of food is set to number of people divided by fav food quantity\n return \"You need to make #{num_of_food} #{fav_food}(s).\" #returns string concatenated declaring how much of the food to make\n \n else num_of_people % fav_food_qty != 0 #if num of people is not divisable by fav food qty\n while num_of_people > 0 \n if num_of_people / my_list[\"pie\"] > 0 #if number of people divided by number of pies floor is greater than 0 \n pie_qty = num_of_people / my_list[\"pie\"] #sets pie quantity to multiples of number of servings\n num_of_people = num_of_people % my_list[\"pie\"] #num of people reassigned to remainder \n elsif num_of_people / my_list[\"cake\"] > 0 #if number of people divided by number of cakes floor is greater than 0\n cake_qty = num_of_people / my_list[\"cake\"] #sets cake quantity to multiples of number of servings\n num_of_people = num_of_people % my_list[\"cake\"] #num of people reassigned to remainder \n else\n cookie_qty = num_of_people #sets cookie qty to number of people remaining\n num_of_people = 0 #ends the loop if \"cookie else\" is reached\n end\n end\n \n return \"You need to make #{pie_qty} pie(s), #{cake_qty} cake(s), and #{cookie_qty} cookie(s).\" #returns the string, whole combination\n end\n end\nend", "title": "" }, { "docid": "9910274fc92af417b88dca15dd1a8757", "score": "0.5635537", "text": "def list_all_clients(shelter)\n if shelter.clients.any?\n shelter.clients.each do |key, x|\n puts \"ID: #{key}, Name: #{x.name}, Age: #{x.age}, Gender: #{x.gender}, Kids: #{x.kids}, Pets: #{x.pets.join(', ')}\"\n end\n else\n puts \"We have no clients left! We need to rethink our strategy!\"\n end\nend", "title": "" }, { "docid": "d0321eca59fc8ba9f39ab13c9f0bdb97", "score": "0.5632361", "text": "def amount_of_chocolate_chips(recipe_hash)\n \"#{recipe_hash[:mini_dark_chocolate_chips]} of mini dark chocolate chips\"\nend", "title": "" }, { "docid": "d4e397dd030f10f052748aeedf1c1b8b", "score": "0.5628065", "text": "def pets_sold(imported_hash)\n imported_hash[:admin][:pets_sold]\nend", "title": "" }, { "docid": "36093f67b6b1f0034e74ce5ba3653a31", "score": "0.5625929", "text": "def likes_to_eat(person, food)\n\n for x in person[:favourites][:snacks]\n if x == food\n return true\n end\n end\n return false\nend", "title": "" }, { "docid": "040f6ec629e55e13d0e4969ddb032ad1", "score": "0.5615946", "text": "def test_by_allergy(allergies)\n score = 0\n allergies.each do |allergy| \n score += $all_allergies[allergy.to_sym] if $all_allergies.keys.include?(allergy.to_sym)\n end\n score\nend", "title": "" }, { "docid": "5e8e2742ab9bc083a5bd81c8f8006832", "score": "0.5615509", "text": "def cheese_and_crackers(cheese_count, boxes_of_crackers)\n p \"You have #{cheese_count} cheeses!\"\n p \"You have #{boxes_of_crackers} boxes of crackers!\"\n p \"Man that's enough for a party!\"\n p \"Get a blanket.\\n\"\nend", "title": "" }, { "docid": "196ee70e5bf0e4a35d31491488f00e25", "score": "0.56064045", "text": "def list(gifts)\n puts 'listar os itens'\n # Show gifts with index\n gifts.each_with_index do |gift, index|\n puts \"#{index + 1} - #{gift[:bought] ? '[X]' : '[ ]'} - #{gift[:name]} - R$ #{gift[:price]}\"\n\n # teste de impressão com casas decimais: {sprintf('%.2f', gift[:price])}\"\n end\nend", "title": "" }, { "docid": "aeb14fd1574677ce3de56c962b8565f8", "score": "0.5595745", "text": "def display_lifts(db)\n lifting_data = db.execute(\"SELECT * FROM lifting\")\n lifting_data.each do |lifts|\n puts \"On #{lifts['date']} you weighed #{lifts['body_weight']}. These we're your lifts for that day:\"\n puts \"You squatted #{lifts['squats']}lbs \" if lifts['squats'] != \"\"\n puts \"You benched #{lifts['bench_press']} lbs\" if lifts['bench_press'] != \"\"\n puts \"You pressed #{lifts['overhead_press']} lbs\" if lifts['overhead_press'] != \"\"\n puts \"You deadlifted #{lifts['deadlifts']} lbs\" if lifts['deadlifts'] != \"\"\n puts \"You power cleaned #{lifts['power_cleans']} lbs\" if lifts['power_cleans'] != \"\"\n end\nend", "title": "" }, { "docid": "092515097df46cf885366f2e4f34445c", "score": "0.5587964", "text": "def find_pet_by_name(pet_shop, name)\n\n for animal in pet_shop[:pets]\n if animal[:name] == name\n p animal[:name]\n end\n end\n\nend", "title": "" }, { "docid": "c168ecd60b5fdb1423bd84037b1e5ea4", "score": "0.55764854", "text": "def cheese_and_crackers(cheese_count, boxes_of_crackers)\n puts \"You have #{cheese_count} cheeses!\"\n puts \"You have #{boxes_of_crackers} boxes of crackers!\"\n puts \"Man that's enough for a party!\"\n puts \"Get a blanket.\\n\"\n#output the value of cheese_count, which is 20\n puts \"You have #{cheese_count} cheeses!\"\n#outputs the value of boxes_of_crackers, which is 30\n puts \"You have #{boxes_of_crackers} boxes of crackers!\"\n#outputs the string of information\n puts \"Man that's enough for a party!\"\n#outputs the string of information\n puts \"Get a blanket.\\n\"\n# Ending this block of code and making it output clean\n puts \"\"\nend", "title": "" }, { "docid": "69b1eb6c417337d8d9a667d97c9e4d56", "score": "0.55760443", "text": "def all_supplies_in_holidays(holiday_hash)\n # iterate through holiday_hash and print items such that your readout resembles:\n # Winter:\n # Christmas: Lights, Wreath\n # New Years: Party Hats\n # Summer:\n # Fourth Of July: Fireworks, BBQ\n # etc.\n holiday_hash.map do |seasons, holidays|\n string_seasons = seasons.to_s.capitalize\n # binding.pry\n puts \"#{string_seasons}:\"\n holidays.map do |holiday, supply_arrays|\n array_holidays = holiday.to_s.split(\"_\")\n string_holidays = array_holidays.map do |holidays|\n # binding.pry\n string_holidays = holidays.capitalize\n end\n puts \" #{string_holidays.join(\" \")}: #{supply_arrays.join(\", \")}\"\n end\n end\nend", "title": "" }, { "docid": "5a911c189e62d724c20130652494b2c0", "score": "0.5574875", "text": "def pets_by_breed(pet_shop, breed)\n pets = [] # reminding myself again that the empty array will include the amount it has counted when searched\n for pet in pet_shop[:pets]\n if pet[:breed] == breed \n pets << pet\n end \n end\n #two ends because you are closing out the for and if\n return pets\nend", "title": "" }, { "docid": "e0710a14f4444ae812af896aa54c8e94", "score": "0.55738497", "text": "def cheese_and_crackers (cheese_count, boxes_of_crackers)\n puts \"You have #{cheese_count} cheeses!\"\n puts \"You have #{boxes_of_crackers} boxes of crackers!\"\n puts \"Man that's enough for a party!\"\n puts \"Get a blanket.\\n\"\nend", "title": "" }, { "docid": "c2de68ef7ab9e686afdd6a9ba6ae43d9", "score": "0.5572275", "text": "def yummy(foods)\n delicious_foods = []\n foods.each do |key,value| \n if value == \"delicious\"\n delicious_foods << key\n else \n foods.delete(key)\n end\n end\n the_good_food = delicious_foods.join(\", \")\nend", "title": "" }, { "docid": "eb4004bfd501b11a0ace7d603bf9ae09", "score": "0.5571573", "text": "def print_price hash\n p hash[:price]\nend", "title": "" }, { "docid": "83bd3a497030cb8f5eb14a8f3dc7ad4a", "score": "0.55714625", "text": "def bakery_num(num_of_people, fav_food)\n food_servings = {\"pie\" => 8, \"cake\" => 6, \"cookie\" => 1} # Initialize the food and the quantity \n fav_food_qty = food_servings[fav_food] \n \n raise ArgumentError.new(\"You can't make that food\") if !food_servings.has_key?(fav_food)\n \n if num_of_people % fav_food_qty == 0\n num_of_food = num_of_people / fav_food_qty\n return \"You need to make #{num_of_food} #{fav_food}(s).\"\n else \n food_qty = food_servings.clone\n # First make favorite food\n food_qty[fav_food] = num_of_people / food_servings[fav_food]\n num_of_people %= food_servings[fav_food]\n \tfood_servings.delete(fav_food)\t\t\n \t# Now servings for the rest\n food_servings.each_key do |key| \n break if num_of_people == 0 # this isn't really necessary with 3 keys, but with more it would be.\n food_qty[key] = num_of_people / food_servings[key]\n num_of_people %= food_servings[key]\n end\n return \"You need to make #{food_qty[\"pie\"]} pie(s), #{food_qty[\"cake\"]} cake(s), and #{food_qty[\"cookie\"]} cookie(s).\" # This prints the needed quantities\n end\nend", "title": "" }, { "docid": "fb869d98645ab238f3e55ebcebd14c92", "score": "0.5565767", "text": "def number_rides(whatever)\n whatever.each do |key,value|\n y = \"Driver #{key} has #{(value.length)} ride(s).\"\n puts y\n end\nputs\nend", "title": "" }, { "docid": "ccc02f929b2c15855bdb8e10537e00de", "score": "0.55635226", "text": "def bakery_num(num_of_people, fav_food) # creating method bakery_num\n my_list = {\"pie\" => 8, \"cake\" => 6, \"cookie\" => 1} #creating hash. value of keys equals servings per person\n pie_qty = 0\n cake_qty = 0\n cookie_qty = 0\n dessert_array = Array.new\n has_fave = false \n\n my_list.each_key do |k| #iterates each key in the hash my_list\n if k == fav_food # making a comparison of each key in hash\n has_fave = true # gives a true value to fave_food\n #fav_food = k #fav_food is set to the value of the key ***** Redundant assignment, line deleted.\n end\n end\n\n if has_fave == false #if has_fave is false\n raise ArgumentError.new(\"You can't make that food\") #makes a new error to say that we cannot make that food because we have the incorrect arguements\n else\n fav_food_qty = my_list[fav_food] #creating a variable that, through the values method, returns an array made up by the value of the key established at fav_food \n if num_of_people % fav_food_qty == 0 #if theres no remainder in num_of_people divided fav_food_quantity\n num_of_food = num_of_people / fav_food_qty #creating num_of_food variable that gives us how many food items we should make\n return \"You need to make #{num_of_food} #{fav_food}(s).\" # returns string \n else #if there is a remainder \n while num_of_people > 0\n #\n my_list.each do |k,v|\n dessert_qty = num_of_people / v\n num_of_people = num_of_people % v\n dessert_array << dessert_qty \n end\n \n #\n # if num_of_people / my_list[\"pie\"] > 0 # if num_of_people divided by number of servings of pie is greather than zero\n # pie_qty = num_of_people / my_list[\"pie\"] # pie_qty equals num_of_people divided by servings of pie\n # num_of_people = num_of_people % my_list[\"pie\"] # num_of_people equals the remainder of num_of_people and servings of pie\n # elsif num_of_people / my_list[\"cake\"] > 0 #repetition of first set of conditions of pie\n # cake_qty = num_of_people / my_list[\"cake\"]\n # num_of_people = num_of_people % my_list[\"cake\"]\n # else\n # cookie_qty = num_of_people / my_list[\"cookie\"] \n # num_of_people = num_of_people % my_list[\"cookie\"] # so we don't have an infinite loop\n # end\n end\n return \"You need to make #{dessert_array[0]} pie(s), #{dessert_array[1]} cake(s), and #{dessert_array[2]} cookie(s).\"\n end\n end\nend", "title": "" }, { "docid": "a39b084adcaba25dd1a5d1b2ec32b3e9", "score": "0.5556109", "text": "def all_supplies_in_holidays(holiday_hash)\n # iterate through holiday_hash and print items such that your readout resembles:\n # Winter:\n # Christmas: Lights, Wreath\n # New Years: Party Hats\n # Summer:\n # Fourth Of July: Fireworks, BBQ\n # etc.\n\n holiday_hash.each do |season, holidays|\n puts \"#{season.to_s.capitalize}:\"\n holidays.each do |event, gear|\n puts \" \" + event.to_s.split('_').map{|x| x.capitalize}.join(' ') + \": \" + gear.join(\", \") # \"Fourth Of July: Fireworks, BBQ\"\n end\n end\nend", "title": "" }, { "docid": "b22d40ba9cd1d0080ea8ea9d08d5facc", "score": "0.55560696", "text": "def bakery_num( num_of_people, fav_food ) # defines a method called bakery_num that takes two parameters, num_of_peope, fav_food\n serving_sizes = { \"pie\" => 8, \"cake\" => 6, \"cookie\" => 1 } # Hash of available foods and associated counts\n food_quantities = { \"fav_food\" => 0, \"pie\" => 0, \"cake\" => 0, \"cookie\" => 0 } # Hash of food quantities\n\n # Raise error if serving sizes doesn't contain food\n raise ArgumentError.new(\"You can't make that food\") if !serving_sizes.has_key? (fav_food)\n\n # Returns the necessary number of food items needed to satisfy each serving if the \n # number of people attending is evenly divisible by the quantity of the passed favorite food.\n return \"You need to make #{num_of_people / serving_sizes[fav_food]} #{fav_food}(s).\" if num_of_people % serving_sizes[fav_food] == 0\n\n # Loop through each key in food_quantities to determine how many of each food item is needed.\n food_quantities.each do |key, value|\n if key == \"fav_food\" \n food_quantities[key] = num_of_people / serving_sizes[fav_food] # Setting \"fav_food\" property for future use in food_quantities\n food_quantities[fav_food] = food_quantities[key]\n num_of_people = num_of_people % serving_sizes[fav_food] # Setting remaining amount of people left after fav_food is determined.\n elsif num_of_people / serving_sizes[key] > 0 # key is not fav_food and number of remaining people divided by the next food item serving size is greater than zero\n food_quantities[key] = num_of_people / serving_sizes[key] # Setting count for additional food items needed for remaining people\n num_of_people = num_of_people % serving_sizes[key] # Setting number of remaining people after the additional food item\n end # Ending conditional\n end # Ending .each loop\n\n return \"You need to make #{food_quantities[\"pie\"]} pie(s), #{food_quantities[\"cake\"]} cake(s), and #{food_quantities[\"cookie\"]} cookie(s).\"\nend", "title": "" }, { "docid": "850e0feafa468677f18f98745fdadf4e", "score": "0.5555909", "text": "def cheese_and_crackers(cheese_count, boxes_of_crackers)\n puts \"You have #{cheese_count} cheesees!\"\n puts \"You have #{boxes_of_crackers} boxes of crackers!\"\n puts \"Man, that's enough for a party!\"\n puts \"Get a blanket.\\n\"\nend", "title": "" }, { "docid": "998ab77a0552ec8b4400e5340e40a469", "score": "0.55556256", "text": "def print_list(list_hash)\r\n\tlist_hash.each {|key, value| puts \"#{key}; qty: #{value}\" }\r\nend", "title": "" }, { "docid": "920448b31fb0d6c528b2ad3f9aeb8707", "score": "0.5548363", "text": "def bakery_num( num_of_people, fav_food ) # defines a method called bakery_num that takes two parameters, num_of_peope, fav_food\n my_list = {\"pie\" => 8, \"cake\" => 6, \"cookie\" => 1} # Hash of avaialble foods and associated counts\n \n pie_qty = 0\n cake_qty = 0 # quantity of the foods equals to 0 \n cookie_qty = 0\n \n has_fave = false # Initializes our has_fave tood to false\n\n my_list.each_key do |key| # iterating over my_list keys to do a comparison \n if key == fav_food # Favorite food comparison\n has_fave = true # confirms fav_food is in the list \n end\n # has_fave = true if key == fav_food\n end\n \n if has_fave == false # my_list does not contain fav_food \n raise ArgumentError.new(\"You can't make that food\") # Raise error if fav_food was not found\n else # Fav_food was in the list\n fav_food_qty = my_list[fav_food] #.values_at(fav_food)[0] # if in the list, return the quantity on hand *** refactor\n if num_of_people % fav_food_qty == 0 # Checks if num_of_people is evenly divisable by the fav_food_qty\n num_of_food = num_of_people / fav_food_qty # returns num_of_food eq to number of people / fav foods \n return \"You need to make #{num_of_food} #{fav_food}(s).\" # Return favorite food along with quantity\n else #num_of_people % fav_food_qty != 0 # num_of_people was not evenly divisable by fav_food_qty\n while num_of_people > 0 # while num_of_people is greater than zero \n if num_of_people / my_list[\"pie\"] > 0 # At least more people than the quantity of pie will feed \n pie_qty = num_of_people / my_list[\"pie\"] # quantity of pie is equal the number of people divided by my_list of pie \n num_of_people = num_of_people % my_list[\"pie\"] # number of people ramaining after distributing pies\n elsif num_of_people / my_list[\"cake\"] > 0 # At least more people than the quantity of cake \n cake_qty = num_of_people / my_list[\"cake\"] # quantity of cake is equal to the number of people divided by qty of people cake will feed\n num_of_people = num_of_people % my_list[\"cake\"] # number of people remaining after distributing cakes \n else # num_of_people is less than both qty that pie and cake will feed\n cookie_qty = num_of_people # cookie quantity is equal to the number of people \n num_of_people = 0 # Set num_of_people to 0 in order to end the loop\n end # Ending if-else conditions\n end\n return \"You need to make #{pie_qty} pie(s), #{cake_qty} cake(s), and #{cookie_qty} cookie(s).\"\n end\n end\nend", "title": "" }, { "docid": "3151cbfa0c7518cb2b9073f41ac24aba", "score": "0.55453545", "text": "def print_list(hash)\r\n\thash.each do |item, quantity|\r\n\t\tputs \"#{item}, #{quantity}\"\r\n\tend\r\nend", "title": "" }, { "docid": "8a59254df91c32039372291700e7308f", "score": "0.55426526", "text": "def bakery_num(num_of_people, fav_food)\n my_list = {\"pie\" => 8, \"cake\" => 6, \"cookie\" => 1}\n food_quantity = {\"pie\" => 0, \"cake\" => 0, \"cookie\" => 0}\n \n#Determine whether fav_food is a key in my_list\n# if you type in a food that isn't on the list, it raises an argument error\n\nunless my_list.has_key?(fav_food)\n raise ArgumentError.new(\"You can't make that food\")\nend\n\n# takes the value of the favorite food\n fav_food_qty = my_list[fav_food]\n#checks whether the number of people is divisible by that value \n if num_of_people % fav_food_qty == 0\n \n num_of_food = num_of_people / fav_food_qty\n return \"You need to make #{num_of_food} #{fav_food}(s).\"\n#if there is a remainder...\n else num_of_people % fav_food_qty != 0\n food_quantity[fav_food] = num_of_people / fav_food_qty\n remaining_people=num_of_people%fav_food_qty\n my_list.each do |k,v|\n if remaining_people / my_list[k] > 0\n food_quantity[k] += remaining_people / my_list[k]\n remaining_people = remaining_people % my_list[k]\n end\n end\n # returns the number of pies, cakes, and cookie that can be made\n return \"You need to make #{food_quantity['pie']} pie(s), #{food_quantity['cake']} cake(s), and #{food_quantity['cookie']} cookie(s).\"\n end\n end", "title": "" }, { "docid": "948a7f69bb2665fbf8b474b3363ddbad", "score": "0.55412877", "text": "def bakery_num(num_of_people, fav_food)\n my_list = {\"pie\" => 8, \"cake\" => 6, \"cookie\" => 1}\n quantity = {\"pie\" => 0, \"cake\" => 0, \"cookie\" => 0}\n raise ArgumentError.new(\"You can't make that food\") unless my_list.include?(fav_food)\n\n quantity[fav_food] = num_of_people / my_list[fav_food]\n remainder = num_of_people % my_list[fav_food]\n return \"You need to make #{quantity[fav_food]} #{fav_food}(s).\" if num_of_people % my_list[fav_food] == 0\n \n my_list.each do |k,v|\n next if remainder < v\n quantity[k] = (remainder / v)\n remainder = remainder % v\n end \n\n \"You need to make #{quantity[\"pie\"]} pie(s), #{quantity[\"cake\"]} cake(s), and #{quantity[\"cookie\"]} cookie(s).\"\nend", "title": "" }, { "docid": "104a3c49b5256a7eb7f6d381df39b2ea", "score": "0.5536747", "text": "def every_supply(list)\n\n list.each do |season, holidays_hash|\n # in season there are:\n puts \"In #{season.to_s.capitalize} there are the following holidays:\"\n holidays_hash.each do |holiday_name, supplies|\n puts \"-#{holiday_name.upcase}. For which you will need:\"\n supplies.each do |supply|\n puts \"--#{supply}\"\n end\n end\n end\nend", "title": "" }, { "docid": "25a614dd51c0ef60dcfd9aad6ef1a78a", "score": "0.5533767", "text": "def print_zombies\n@zombie_apocalypse_supplies.each do |supplies|\n puts \"#{supplies} *\"\nend\nend", "title": "" }, { "docid": "c025da1da26cbc8cca9fb8053ea35958", "score": "0.5529293", "text": "def pumps\n if $drink[:flavor] == nil\n #if drink[:flavor] == nil\n #puts \"No worries\"\n #pumps = 0\n $drink[:pumps_flavor] = 0\n puts\n else\n #elsif drink[:flavor] \n puts \"How many pumps?\"\n $drink[:pumps_flavor] = gets.to_i\n puts\n end\n end", "title": "" }, { "docid": "aff8cea5e706c7cf8ffd11a8b81e0203", "score": "0.5528915", "text": "def homes_info(homes)\n homes.each do |hm|\n puts \"#{hm.name} is in #{hm.city}\"\n puts \"Price: $#{hm.price} a night.\"\n end\nend", "title": "" }, { "docid": "60d8ab63fd311d739edcce8e0cb11918", "score": "0.55287576", "text": "def num_points_scored(string) \n game_hash.each do |hash, info|\n player_hash = info[:players] #this returns the key of players and the hash \n player_hash.each do |key, result|\n if(string == key[:player_name])\n return key[:points]\n #binding.pry\n \n end\n end\n\n end \nend", "title": "" }, { "docid": "df1c4ebb394f6734b0213dbc84a88b42", "score": "0.5526576", "text": "def print_price hash \n\thash[:price]\nend", "title": "" }, { "docid": "53e0a71226218bc1e091fc60383d82b1", "score": "0.5523186", "text": "def nice_print(grocery_list)\n\tgrocery_list.each { |food, quantity| puts \"We need #{quantity}, of #{food}.\"}\nend", "title": "" }, { "docid": "1e5159a7751ee8a14c32d34ed40d8fbd", "score": "0.552085", "text": "def cheese_and_crackers(cheese_count, boxes_of_crackers)\n\tputs \"You have #{cheese_count} cheeses!\"\n\tputs \"You have #{boxes_of_crackers} boxes of crackers!\"\n\tputs \"Man that's enough for a party!\"\n\tputs \"Get a blanket.\\n\"\nend", "title": "" }, { "docid": "1e5159a7751ee8a14c32d34ed40d8fbd", "score": "0.55206937", "text": "def cheese_and_crackers(cheese_count, boxes_of_crackers)\n\tputs \"You have #{cheese_count} cheeses!\"\n\tputs \"You have #{boxes_of_crackers} boxes of crackers!\"\n\tputs \"Man that's enough for a party!\"\n\tputs \"Get a blanket.\\n\"\nend", "title": "" }, { "docid": "aba4257fe48c0493ab56b9da11105408", "score": "0.55166215", "text": "def cheese_and_crackers(cheese_count, boxes_of_crackers)\n puts \"You have #{cheese_count} cheeses!\"\n puts \"You have #{boxes_of_crackers} boxes of crackers!\"\n puts \"Man that's enough for a party!\"\n puts \"Get a blanket.\\n\"\nend", "title": "" }, { "docid": "aba4257fe48c0493ab56b9da11105408", "score": "0.55166215", "text": "def cheese_and_crackers(cheese_count, boxes_of_crackers)\n puts \"You have #{cheese_count} cheeses!\"\n puts \"You have #{boxes_of_crackers} boxes of crackers!\"\n puts \"Man that's enough for a party!\"\n puts \"Get a blanket.\\n\"\nend", "title": "" }, { "docid": "aba4257fe48c0493ab56b9da11105408", "score": "0.55166215", "text": "def cheese_and_crackers(cheese_count, boxes_of_crackers)\n puts \"You have #{cheese_count} cheeses!\"\n puts \"You have #{boxes_of_crackers} boxes of crackers!\"\n puts \"Man that's enough for a party!\"\n puts \"Get a blanket.\\n\"\nend", "title": "" }, { "docid": "aba4257fe48c0493ab56b9da11105408", "score": "0.55166215", "text": "def cheese_and_crackers(cheese_count, boxes_of_crackers)\n puts \"You have #{cheese_count} cheeses!\"\n puts \"You have #{boxes_of_crackers} boxes of crackers!\"\n puts \"Man that's enough for a party!\"\n puts \"Get a blanket.\\n\"\nend", "title": "" }, { "docid": "aba4257fe48c0493ab56b9da11105408", "score": "0.55166215", "text": "def cheese_and_crackers(cheese_count, boxes_of_crackers)\n puts \"You have #{cheese_count} cheeses!\"\n puts \"You have #{boxes_of_crackers} boxes of crackers!\"\n puts \"Man that's enough for a party!\"\n puts \"Get a blanket.\\n\"\nend", "title": "" }, { "docid": "aba4257fe48c0493ab56b9da11105408", "score": "0.55166215", "text": "def cheese_and_crackers(cheese_count, boxes_of_crackers)\n puts \"You have #{cheese_count} cheeses!\"\n puts \"You have #{boxes_of_crackers} boxes of crackers!\"\n puts \"Man that's enough for a party!\"\n puts \"Get a blanket.\\n\"\nend", "title": "" }, { "docid": "aba4257fe48c0493ab56b9da11105408", "score": "0.55166215", "text": "def cheese_and_crackers(cheese_count, boxes_of_crackers)\n puts \"You have #{cheese_count} cheeses!\"\n puts \"You have #{boxes_of_crackers} boxes of crackers!\"\n puts \"Man that's enough for a party!\"\n puts \"Get a blanket.\\n\"\nend", "title": "" }, { "docid": "aba4257fe48c0493ab56b9da11105408", "score": "0.55166215", "text": "def cheese_and_crackers(cheese_count, boxes_of_crackers)\n puts \"You have #{cheese_count} cheeses!\"\n puts \"You have #{boxes_of_crackers} boxes of crackers!\"\n puts \"Man that's enough for a party!\"\n puts \"Get a blanket.\\n\"\nend", "title": "" }, { "docid": "aba4257fe48c0493ab56b9da11105408", "score": "0.55166215", "text": "def cheese_and_crackers(cheese_count, boxes_of_crackers)\n puts \"You have #{cheese_count} cheeses!\"\n puts \"You have #{boxes_of_crackers} boxes of crackers!\"\n puts \"Man that's enough for a party!\"\n puts \"Get a blanket.\\n\"\nend", "title": "" } ]
c789be2a6b1310f83fb6e01ca1cb8009
Takes the current search query and adds metadata TODO: there is probably no need to return animals and plants separately
[ { "docid": "edbca4af4e8ed6f7413b7069e79ebbf0", "score": "0.0", "text": "def generate\n @animalia, @plantae = cached_results.partition { |item| item.kingdom_position == 0 }\n if @output_layout == :taxonomic\n injector = Checklist::HigherTaxaInjector.new(@animalia)\n @animalia = injector.run\n injector = Checklist::HigherTaxaInjector.new(@plantae)\n @plantae = injector.run\n end\n [self] # TODO: just for compatibility with frontend, no sensible reason for this\n end", "title": "" } ]
[ { "docid": "295feca7763f904ab962cf03b052aca6", "score": "0.6427846", "text": "def index\n if params[:query].present?\n @animals = Animal.search_by_species(params[:query])\n if params[:search].present?\n @animals = @animals.where(care_level: params[:search])\n end\n else\n @animals = Animal.all\n if params[:search].present?\n @animals = @animals.where(care_level: params[:search])\n end\n @previous_search = ''\n end\n end", "title": "" }, { "docid": "f6dd4ce4d3db7e731e2a89de6aa24612", "score": "0.6338822", "text": "def index\n #@animals = Animal.all\n if params[:search_inputs].present?\n @search_inputs = OpenStruct.new(params[:search_inputs])\n else\n @search_inputs = OpenStruct.new()\n end\n @animals = AnimalsSearch.new(@search_inputs).search\n @animals = @animals.page(params[:page])\n\n set_meta_tags title: 'Unsere Tiere', reverse: true,\n description: 'Alle Tiere von STINAH im Überblick!'\n end", "title": "" }, { "docid": "6b45d776105eb87cb11f533d7102e8c3", "score": "0.6209579", "text": "def search\n # Query\n @q = params[:q]\n @query = @q.split(/\\s(?=(?:[^\"]|\"[^\"]*\")*$)/).map do |i|\n (i =~ /^(?:([A-Za-z_]+):)?\"?(.*?)\"?$/) ? [$2, $1] : [i, nil]\n end\n # Results\n return if (m = @project.miga).nil? or\n (r = m.result(:project_stats)).nil? or\n (db_file = r.file_path(:metadata_index)).nil?\n db = SQLite3::Database.new db_file\n @results = nil\n @query.each do |q|\n q[0] = q[0].downcase.gsub(/[^A-Za-z0-9\\-]+/, \" \")\n res = db.execute(\"select distinct(name) from metadata \" +\n \"where value like ? #{\"and field=?\" unless q[1].nil?}\",\n [\"% #{q[0]} %\"] + (q[1].nil? ? [] : [q[1]])).flatten\n @results.nil? ? @results=res :\n @results.select!{ |i| res.include? i }\n end\n reference_datasets\n end", "title": "" }, { "docid": "a4e37947ffddb76d5abfbff1833f172a", "score": "0.6180308", "text": "def search(query); end", "title": "" }, { "docid": "7e2040451bbac883922b09a0326ee499", "score": "0.61738855", "text": "def init_results_for_search\n # try to find asqs and tags that match search string\n search_string = params[:search].downcase\n @title = \"Search for \\\"#{params[:search]}\\\"\"\n @matched_names = search_asqs_by_column('name', search_string)\n @matched_queries = search_asqs_by_column('query', search_string)\n @matched_tags = Asq.tagged_with(search_string.split(' '), wild: true)\n @matched_creator = Asq.where(created_by: search_string)\n @matched_modifier = Asq.where(modified_by: search_string)\n sort_matched_arrays\n redirect_if_single_result\n end", "title": "" }, { "docid": "d0e67033a33268942f2c31eb0ac443c3", "score": "0.60917085", "text": "def index\n if params[:search]\n @found_animals = FoundAnimal.search(params[:search]).order(\"created_at DESC\").paginate(page: params[:page], per_page: 10)\n else\n @found_animals = FoundAnimal.all.order('created_at DESC').paginate(page: params[:page], per_page: 10)\n end \n end", "title": "" }, { "docid": "6f115d84cc7a24c531633f43284c07e4", "score": "0.6070124", "text": "def search_data(query, params = {})\n return [] if query.blank?\n meta_keys = %w(email first_name last_name)\n\n meta_key = build_meta_search_query(meta_keys)\n meta_query = {meta_key => query}\n\n paging_info = parse_paging_options(params)\n \n return self.search(meta_query).paginate(:page => paging_info.page_id,\n :per_page => paging_info.page_size,\n :order => paging_info.sort_string)\n end", "title": "" }, { "docid": "b370b09cdf189d2ade7a7f067f61fcb7", "score": "0.60535794", "text": "def search\n\n # define the elasticsearch result \"size\" (limit)\n limit = params['limit'].to_i\n # define the elasticsearch result \"from\" (offset)\n offset = params['offset'].to_i\n # Pass through\n hack = params['hack']\n # Default output\n searchResults = ''\n # If we have filters, we need to parse them\n if params['filters'].present?\n filters = []\n # For each of the filters format them and stuff them into an array\n params['filters'].each do |key, filter|\n\n if [\n 'properties.educationalAlignment.properties.targetName',\n 'properties.inLanguage',\n 'properties.isBasedOnUrl',\n 'properties.thumbnailUrl',\n 'properties.timeRequired',\n 'properties.typicalAgeRange',\n 'properties.url',\n 'properties.useRightsUrl'\n ].include?(key)\n searchKey = \"schema-org.#{key}.original\"\n matchTerm = 'term'\n else\n searchKey = \"schema-org.#{key}\"\n matchTerm = 'match'\n end\n\n if filter.keys.count > 1\n # This is more complex because this filter type needs the keys or'd together\n orFilters = []\n filter.keys.each do |f|\n orFilters << { 'query' => { matchTerm => { searchKey => f.to_s } } }\n end\n filters << { 'or' => orFilters }\n else\n # This should be simple, there is only one of this filter key\n filters << { 'query' => { matchTerm => { searchKey => filter.keys.first.to_s } } }\n end\n end\n\n # If the query is present we need to match it\n if params['query'].present?\n query = { 'match' => { '_all' => params['query'] } }\n filter = { 'and' => filters }\n # If no query is present then we can wildcard against anything\n else\n query = { 'match_all' => { } }\n filter = { 'and' => filters }\n end\n # if not filter is present then just match against query\n else\n query = { 'match' => { '_all' => params['query'] } }\n end\n\n # Build the payload from the various parts\n payload = {\n 'size' => limit,\n 'from' => offset,\n 'query' => {\n 'filtered' => {\n 'query' => query,\n 'filter' => filter\n }\n },\n \"facets\" => {\n \"intendedEndUserRole\" => {\n \"terms\" => {\n \"field\" => \"schema-org.properties.intendedEndUserRole.original\",\n \"global\" => true,\n \"all_terms\" => true\n }\n },\n \"typicalAgeRange\" => {\n \"terms\" => {\n \"field\" => \"schema-org.properties.typicalAgeRange.original\",\n \"global\" => true,\n \"all_terms\" => true\n }\n },\n \"educationalUse\" => {\n \"terms\" => {\n \"field\" => \"schema-org.properties.educationalUse.original\",\n \"global\" => true,\n \"all_terms\" => true\n }\n },\n \"interactivityType\" => {\n \"terms\" => {\n \"field\" => \"schema-org.properties.interactivityType.original\",\n \"global\" => true,\n \"all_terms\" => true\n }\n },\n \"learningResourceType\" => {\n \"terms\" => {\n \"field\" => \"schema-org.properties.learningResourceType.original\",\n \"global\" => true,\n \"all_terms\" => true\n }\n },\n \"mediaType\" => {\n \"terms\" => {\n \"field\" => \"schema-org.properties.mediaType.original\",\n \"global\" => true,\n \"all_terms\" => true\n }\n }\n }\n }\n\n#puts \"PAYLOAD\"; puts Rails.configuration.elastic_search_url; puts payload.to_json\n\n # Okay after all that mess, lets make the request\n request = RestClient::Request.new( :method => :get, :url => Rails.configuration.elastic_search_url, :payload => payload.to_json )\n # Since this can error lets catch it\n begin\n searchResults = request.execute\n results = JSON.parse(searchResults)\n results[:hack] = hack\n\n#puts \"RESPONSE\"; puts results.to_json\n\n respond_to do |format|\n format.json { render json: results }\n end\n rescue => e\n # @TODO Need to return the correct error type and then an error message to be shown to user.\n respond_to do |format|\n format.json { render json: searchResults }\n end\n#puts \"ERROR!\"; puts e.response\n end\n\n end", "title": "" }, { "docid": "3316ffb66e3f3bc138384005ee3a99b5", "score": "0.599379", "text": "def add_custom_search_filters(search); end", "title": "" }, { "docid": "8b026bb4ba1f1b636635e7410e665dc8", "score": "0.5975828", "text": "def springer_metadata_search( keyword, opts = {} )\n base_uri = \"http://api.springer.com/metadata/pam\"\n q = URI.escape( keyword )\n cont = nil\n cache_file = cache_xml( \"springer\", q, opts[:start] )\n #p File.mtime( cache_file )\n if File.exist?( cache_file ) and ( Time.now - File.mtime( cache_file ) ) < CACHE_TIME\n cont = open( cache_file ){|io| io.read }\n else\n if not opts.empty?\n opts_s = opts.keys.map do |e|\n next if e.to_s =~ /\\A_/\n if e == :start\n \"s=#{ URI.escape( opts[e].to_s ) }\"\n else\n \"#{ e }=#{ URI.escape( opts[e].to_s ) }\"\n end\n end.join( \"&\" )\n end\n if opts[ :_prev_time ]\n elapsed = Time.now - opts[ :_prev_time ]\n if SPRINGER_INTERVAL > elapsed\n sleep( SPRINGER_INTERVAL - elapsed )\n end\n end\n opensearch_uri = URI.parse( \"#{ base_uri }?q=#{ q }&api_key=#{ SPRINGER_METADATA_APIKEY }&#{ opts_s }\" )\n response = http_get( opensearch_uri )\n cont = response.body\n open( cache_file, \"w\" ){|io| io.print cont }\n opts[ :_prev_time ] = Time.now\n end\n data = {}\n parser = LibXML::XML::Parser.string( cont )\n doc = parser.parse\n data[ :q ] = keyword\n # data[ :link ] = doc.find( \"//atom:id\", \"atom:http://www.w3.org/2005/Atom\" )[0].content.gsub( /&(format=atom|apikey=#{ SPRINGER_METADATA_APIKEY })\\b/, \"\" )\n data[ :totalResults ] = doc.find( \"//result/total\" )[0].content.to_i\n if data[ :totalResults ] > 0\n data[ :itemsPerPage ] = doc.find( \"//result/pageLength\" )[0].content.to_i\n end\n xmlns = [ \"dc:http://purl.org/dc/elements/1.1/\",\n \"pam:http://prismstandard.org/namespaces/pam/2.0/\",\n \"prism:http://prismstandard.org/namespaces/basic/2.0/\",\n \"xhtml:http://www.w3.org/1999/xhtml\",\n ]\n entries = doc.find( \"//pam:message\", xmlns )\n data[ :entries ] = []\n entries.each do |e|\n title = e.find( \"./xhtml:head/pam:article/dc:title\", xmlns )[0].content \n url = e.find( \"./xhtml:head/pam:article/prism:url\", xmlns )[0].content\n author = e.find( \"./xhtml:head/pam:article/dc:creator\", xmlns ).to_a.map{|au| au.content }.join( \"; \" )\n pubname = e.find( \"./xhtml:head/pam:article/prism:publicationName\", xmlns )[0].content\n pubdate = e.find( \"./xhtml:head/pam:article/prism:publicationDate\", xmlns )[0].content\n if pubdate\n pubdate.gsub!( /-01-01\\Z/, \"\" )\n pubdate.gsub!( /-01\\Z/, \"\" )\n end\n doi = e.find( \"./xhtml:head/pam:article/prism:doi\", xmlns )[0].content\n description = e.find( \"./xhtml:body/p\", xmlns )[0]\n description = description.nil? ? \"\" : description.content\n bibdata = {\n :title => title,\n :url => url,\n :author => author,\n :publicationName => pubname,\n :publicationDate => pubdate,\n :description => description,\n :doi => doi,\n }\n [ :isbn, :issn, :volume, :number, :startingPage ].each do |type|\n cont = e.find( \"./xhtml:head/pam:article/prism:#{ type }\", xmlns )[0]\n bibdata[ type ] = cont.content if cont and not cont.empty?\n end\n data[ :entries ] << bibdata\n end\n data\n end", "title": "" }, { "docid": "4e452a690cd7f867bba4cdb4b6962d20", "score": "0.59745866", "text": "def search(query='*', opts={})\n\n defaults = {\n :search_category => 'all',\n :load_search_page => true\n }\n \n opts = defaults.merge(opts)\n\n if (opts[:load_search_page])\n @request.add('/var/widgets.json?callback=define')\n @request.add('/system/me?_charset_=utf-8')\n @request.add('/var/templates/worlds.2.json?_charset_=utf-8')\n end\n \n case opts[:search_category]\n when 'all'\n @request.add(\"/var/search/general.json?q=#{query}&tags=&sortOn=_lastModified&sortOrder=desc&page=0&items=18&_charset_=utf-8&_=1342558141063\",\n {}, { 'subst' => 'true' })\n when 'content'\n @request.add(\"/var/search/pool/all.infinity.json?q=#{query}&tags=&sortOn=_lastModified&sortOrder=desc&page=0&items=18&_charset_=utf-8&_=1342558155346\",\n {}, { 'subst' => 'true' })\n when 'people'\n @request.add(\"/var/search/users.infinity.json?q=#{query}&tags=&sortOn=_lastModified&sortOrder=desc&page=0&items=18&_charset_=utf-8&_=1342558158607\",\n {}, { 'subst' => 'true' })\n when 'groups'\n @request.add(\"/var/search/groups.infinity.json?q=#{query}&tags=&sortOn=_lastModified&sortOrder=desc&category=group&page=0&items=18&_charset_=utf-8&_=1342558161747\",\n {}, { 'subst' => 'true' })\n when 'courses'\n @request.add(\"/var/search/groups.infinity.json?q=#{query}&tags=&sortOn=_lastModified&sortOrder=desc&category=course&page=0&items=18&_charset_=utf-8&_=1342558164687\",\n {}, { 'subst' => 'true' })\n when 'research_projects'\n @request.add(\"/var/search/groups.infinity.json?q=#{query}&tags=&sortOn=_lastModified&sortOrder=desc&category=research&page=0&items=18&_charset_=utf-8&_=1342558167607\",\n {}, { 'subst' => 'true' })\n end\n \n if (opts[:load_search_page])\n @request.add('/system/batch?_charset_=utf-8&requests=%5B%7B%22url%22%3A%22%2Fdevwidgets%2Fdisplayprofilesection%2Fdisplayprofilesection.html%22%2C%22method%22%3A%22GET%22%2C%22_charset_%22%3A%22utf-8%22%7D%2C%7B%22url%22%3A%22%2Fdevwidgets%2Fdisplayprofilesection%2Fbundles%2Fdefault.properties%22%2C%22method%22%3A%22GET%22%2C%22_charset_%22%3A%22utf-8%22%7D%5D&_=1324426870134')\n @request.add('/system/batch?_charset_=utf-8&requests=%5B%7B%22url%22%3A%22%2Fdevwidgets%2Fprofilesection%2Fprofilesection.html%22%2C%22method%22%3A%22GET%22%2C%22_charset_%22%3A%22utf-8%22%7D%2C%7B%22url%22%3A%22%2Fdevwidgets%2Fprofilesection%2Fbundles%2Fdefault.properties%22%2C%22method%22%3A%22GET%22%2C%22_charset_%22%3A%22utf-8%22%7D%5D&_=1324426870481')\n end\n \n end", "title": "" }, { "docid": "ec97a74a7fd017bc01a302e636ea7912", "score": "0.5972842", "text": "def search_data\n {\n title: title,\n tagline: tagline,\n description: description,\n status: status,\n rating: rating,\n categories: categories.map(&:id),\n research_areas: research_areas.map(&:id),\n providers: providers.map(&:id),\n platforms: platforms.map(&:id),\n target_groups: target_groups.map(&:id),\n tags: tag_list\n }\n end", "title": "" }, { "docid": "86497993a1df623e83b465a51fd52f4b", "score": "0.5945634", "text": "def index\n @search = Species.includes(:animals).organization(current_user).search(params[:q])\n @species = @search.result.paginate(:page => params[:page], :per_page => 10).order(\"updated_at DESC\")\n \n respond_with(@species)\n end", "title": "" }, { "docid": "0028fc1fc0b115ebdb125ae67e6ab51d", "score": "0.5868217", "text": "def search\n @query = \"%#{params[:query]}%\"\n\n search_fields = [\"name\", \"hmdb_id\", \"description\", \"iupac_name\", \"formula\", \"smiles\", \"cas\", \"inchi_identifier\", \"melting_point\", \"state\", \"wikipedia_name\", \"comments\"]\n conditions_arg = search_fields.collect { |sf| \"#{sf} LIKE :query\" }.join(\" OR \")\n\n @metabolites = Metabolite.all(:joins => [ :concentrations ], :select => 'DISTINCT metabolites.*', :conditions => [ conditions_arg, { :query => @query } ])\n\n respond_to do |format|\n format.html { render :action => 'index' } # index.html.erb\n format.xml { render :xml => @metabolites }\n format.csv { format_csv }\n end\n end", "title": "" }, { "docid": "7d1e8981f6eedf7bfd07cc2cc3b43512", "score": "0.58674085", "text": "def index_meta_data\n {\n q: params[:q],\n order: params[:order],\n order_by: params[:order_by],\n page: @cars.current_page,\n per_page: @cars.limit_value,\n total_pages: @cars.total_pages\n }\n end", "title": "" }, { "docid": "8a45d96be020e67e00a1e7d3bf9cd46f", "score": "0.584531", "text": "def index\n @search = Species.includes(:animals).organization(current_user).search(params[:q])\n @species = @search.result.paginate(page: params[:page], per_page: 10).order('updated_at DESC')\n\n respond_with(@species)\n end", "title": "" }, { "docid": "71c540f6efca7e8eabf0d3164e6ba396", "score": "0.5813029", "text": "def set_search\n @search = Recipe.ransack(params[:q])\n @search_recipes = @search.result.page(params[:page])\n @tag_search = Recipe.tagged_with(params[:search])\n end", "title": "" }, { "docid": "317fdc0f8af0dd4d08e956008237a03c", "score": "0.5808035", "text": "def parse_search(q)\n # TODO continue\n end", "title": "" }, { "docid": "6928fe79cea97194d3ab1f95403fca82", "score": "0.58000296", "text": "def process_search_results(content)\n extractions = _search_attributes.hmap do |name, expression|\n [name, content.extract(expression)]\n end\n\n [].tap do |results|\n extractions.values.map(&:size).max.times do |index|\n result = {}\n extractions.each do |key, value|\n result[key] = value[index]\n end\n results << new(result)\n end\n end\n end", "title": "" }, { "docid": "21600483460ca269357467c63d08e7f4", "score": "0.5780009", "text": "def search(query)\n\t\t query = \"%#{query}%\"\n\t\t name = arel_table[:name].matches(query)\n\t\t aliases = arel_table[:aliases].matches(query)\n\t\t where(name.or(aliases))\n\t\tend", "title": "" }, { "docid": "a9b78e4e85a263d40db1d3c91f3af042", "score": "0.57790107", "text": "def medley_search\n\t\t@keywords = params[:keywords].downcase.gsub(/[^a-z\\s]/, '')\n\t\t@keywords_array = @keywords.strip.split(/\\s+/)\n\t\t@formatted_search = ''\n\t\t@keywords_array.each do |keyword|\n\t\t\t@formatted_search = @formatted_search + keyword.to_s + '|'\n\t\tend\n\t\t@formatted_search = @formatted_search.chop\n\t\t@medleys = Medley.advanced_search(@formatted_search).order('votes DESC').joins(:user).limit(15)\n\t\t@medleys = medley_extra_formatter(@medleys)\n\t\t# Build Custom Item URLs Here...\n\tend", "title": "" }, { "docid": "c21a02efdac7f10bdc47eb305f8a5921", "score": "0.5775412", "text": "def index\n search_query = params[:search]\n if search_query.blank? || search_query.nil?\n @recipes = Recipe.all\n else\n @recipes = Array.new\n\n @search = Sunspot.search Recipe, Tag, Ingredient do\n fulltext search_query\n end\n\n @search.results.each do |result|\n if result.is_a?(Tag)\n @recipe_tags = RecipeTag.select { |rt| rt.tag_id == result.id}\n\n @recipe_tags.each do |tag|\n Recipe.select { |rc| rc.id == tag.recipe_id }.each do |recipe|\n @recipes << recipe\n end\n end\n elsif result.is_a?(Ingredient)\n @measurements = Measurement.select { |m| m.ingredient_id == result.id }\n\n @measurements.each do |measurement|\n Recipe.select { |r| r.id == measurement.recipe_id }.each do |recipe|\n @recipes << recipe\n end\n end\n elsif result.is_a?(Recipe)\n @recipes << result\n end\n end\n end\n end", "title": "" }, { "docid": "01a0ffb5794502dd7ea042cc5635b8bf", "score": "0.5769995", "text": "def build_content_metadata record, tags\n # TODO: Further enrich the structured data by marking up FAQ accordions, Video Carousels, Image Galleries, etc.\n # Also ItemList metadata for the meditations archive\n # See here: https://developers.google.com/search/docs/data-types/article\n []\n end", "title": "" }, { "docid": "7b221ff92a0cd5d06b8c97cc83d15ff4", "score": "0.57533395", "text": "def search_data\n {\n name: name\n }.merge(search_albums)\n end", "title": "" }, { "docid": "22fa216659c8aa977d40718edfd226d0", "score": "0.575075", "text": "def index\n @query = params[:q] || '*:*'\n query = Jbuilder.encode do |json|\n json.filter do\n json.missing do\n json.field \"parent_id\"\n end\n end\n json.query do\n json.query_string do\n json.query @query\n end\n end\n json.sort do\n json.node \"asc\"\n end\n end\n @themata = Thema.__elasticsearch__.search(query).page(params[:page]).records\n end", "title": "" }, { "docid": "149a19d99041085f5a80142473c4b07c", "score": "0.57465494", "text": "def set_query_attributes!\n attr_names = self.class.search_query_attributes.map(&:to_s)\n self.query = attr_names.inject({}) { |memo, attr|\n memo[attr] = self.send(attr)\n memo\n }\n end", "title": "" }, { "docid": "40b547edacf9c2477363ee94ee69932a", "score": "0.5742536", "text": "def search\n @page_title = t('titles.search_results')\n @query = params[:query]\n query = @query.to_s.gsub(/[\\/\\\\]/, \" \")\n ferret_results = ThinkingSphinx.search(\n Riddle.escape(query),\n page: params[:page],\n per_page: 10\n )\n # Probably not the best way to do this, strip out Products from the\n # search results unless the status is set to 'show_on_website'. It\n # would be better to filter these out during the ActsAsFerret.find\n # above, but since this is a multi-model search, there doesn't seem\n # to be a way to do SQL filtering on just one of the models being\n # searched.\n @results = []\n ferret_results.each do |r|\n unless (r.is_a?(Product) && !r.show_on_website?(website)) ||\n (r.has_attribute?(:brand_id) && r.brand_id != website.brand_id) ||\n (r.respond_to?(:belongs_to_this_brand?) && !r.belongs_to_this_brand?(website)) ||\n (r.is_a?(Artist) && !r.belongs_to_this_brand?(website))\n @results << r\n end\n end\n render_template\n end", "title": "" }, { "docid": "5a11b91822afa00d54fba5a010304153", "score": "0.57118696", "text": "def search( query, page=nil )\n \n # Reset all of our stored variables\n @ordered_results = []\n @current_results = {}\n @grouped_terms = {}\n @current_results_total = 0\n @current_page = 1\n \n # Calculate the start page\n start_doc = 0\n if page and ( Integer(page) > 1 )\n start_doc = ( Integer(page) - 1 ) * @docs_per_page\n end\n \n data = index_request(\n {\n \"q\" => query,\n \"sort\" => @sort_results_by,\n \"start\" => start_doc,\n \"rows\" => @docs_per_page,\n \"hl\" => true,\n \"hl.fl\" => '*',\n \"hl.usePhraseHighlighter\" => true\n }\n )\n \n if start_doc === 0\n @current_page = 1\n else\n @current_page = ( start_doc / @docs_per_page ) + 1\n end\n \n @current_results_total = data[\"response\"][\"numFound\"]\n \n data[\"response\"][\"docs\"].each do |doc|\n @current_results[ doc[ @primary_field ] ] = {\n \"index\" => doc,\n \"search_explaination\" => data[\"highlighting\"][ doc[ @primary_field ] ]\n }\n @ordered_results.push( doc[ @primary_field ] )\n end\n \n # Process and cache these results ready for searching the marts\n @grouped_terms = grouped_query_terms( @current_results )\n \n return @current_results\n end", "title": "" }, { "docid": "64893f9cf67a4a4caa1cd0b7b78b18de", "score": "0.57044417", "text": "def index\n @search = params[\"search\"]\n if @search.present?\n client = Client.new(@search)\n response = client.call\n\n new_results = StoreSearch.new(@search, response).run\n if new_results\n scope_to_use = client.find_search_key || \"random\"\n\n if scope_to_use == \"category\"\n searches = Search.with_category(@search[\"category\"])\n @searches = Search.paginate(page: params[:page], per_page: 5).where(id: searches.map(&:id))\n # TODO recover former sintax\n # @searches = Search.paginate(page: params[:page], per_page: 5)\n # .with_category(@search[\"category\"])\n elsif scope_to_use == \"text\"\n @searches = Search.paginate(page: params[:page], per_page: 5)\n .with_text(@search[\"text\"])\n elsif scope_to_use == \"random\"\n @searches = Search.paginate(page: params[:page], per_page: 5)\n .created_randomly\n else\n @searches = Search.paginate(page: params[:page], per_page: 5)\n end\n else\n @searches = Search.paginate(page: params[:page], per_page: 5)\n end\n end\n \n @searches ||= Search.paginate(page: params[:page], per_page: 5)\n @search = Search.new()\n end", "title": "" }, { "docid": "ffe42fd614baf463c57b617f7f5ed898", "score": "0.5696746", "text": "def fetch_custom_search_params; end", "title": "" }, { "docid": "f36c4f2706cbf62a0f948f7431648c03", "score": "0.5688429", "text": "def getResultsFromSearch(query, type, guts, ppOverride)\n request('getResultsFromSearch', {'query' => query, 'type' => type, 'guts' => guts, 'ppOverride' => ppOverride})\nend", "title": "" }, { "docid": "116086d4bc95779ca3e659aed31a0f50", "score": "0.56865287", "text": "def add_general_query\n fields = [\n \"creators.name^5\",\n \"title^7\",\n \"endnotes\",\n \"notes\",\n \"summary\",\n \"tags.name\",\n \"series.title\"\n ]\n query_string = options[:q]\n return if query_string.blank?\n body.must(\n :query_string,\n fields: fields,\n query: query_string\n )\n end", "title": "" }, { "docid": "19d12b79f45d7f8e4b589abd30264e25", "score": "0.5679831", "text": "def search_attributes\n {:title => self.name, :description => self.bio.present? ? self.bio[0..100] : \"\", :image => self.portrait(:thumb)}\n end", "title": "" }, { "docid": "7e8db3f89fda4d5f911ebed4100ebea0", "score": "0.56794584", "text": "def search_data\n {\n name: name,\n secondary: secondary_name,\n city: city,\n state: state\n }\n end", "title": "" }, { "docid": "72c47bd35d3820128debc21eda36b9d0", "score": "0.5675096", "text": "def Search query\n \n APICall(path: \"search.json?query=#{query}\",method: 'GET')\n \n end", "title": "" }, { "docid": "2adfde6164f451fa16f7754b6c91b371", "score": "0.56661326", "text": "def search_from_fresh( query, page )\n @search_data = {}\n @search_results = []\n \n index_search_status = search_from_fresh_index( query, page )\n \n if @index.current_results_total === 0\n @search_data = nil\n else\n dataset_search_status = search_from_fresh_datasets()\n end\n \n if @index.ordered_results.size > 0\n @search_results = paged_results()\n end\n \n if index_search_status and dataset_search_status\n obj_to_cache = {\n :search_data => @search_data,\n :current_page => @index.current_page,\n :current_results_total => @index.current_results_total,\n :ordered_results => @index.ordered_results\n }\n @cache.write( \"query:#{query}-page:#{page}\", obj_to_cache.to_json, :expires_in => 3.hours )\n end\n end", "title": "" }, { "docid": "f3c84b5a9ddccaac222ada8cd28f2ab7", "score": "0.5665565", "text": "def search\n if params[:query]\n respond_with Event\n .fulltext_search(params[:query])\n .includes(:categories, :organization, :location)\n else\n Event\n .order(\"updated_at DESC\")\n .includes(:categories, :organization, :location)\n end\n end", "title": "" }, { "docid": "faea7a6bac7aa1f36ed6046ef1578aa7", "score": "0.5663641", "text": "def modify_search_query\n query_data = params['q'] && params['q'][Garage::SearchPredicate]\n if query_data.present?\n params['q'][Garage::SearchPredicate] = query_data.split(' ')\n end\n end", "title": "" }, { "docid": "9664e018766fc3028bbbb96ec37c08bc", "score": "0.56610113", "text": "def search_data\n attributes.merge(\n brief_summary: brief_summary && brief_summary.description,\n detailed_description: detailed_description && detailed_description.description,\n browse_condition_mesh_terms: browse_conditions.map(&:mesh_term),\n conditions: conditions.map(&:downcase_name),\n browse_interventions_mesh_terms: browse_interventions.map(&:mesh_term),\n interventions_mesh_terms: interventions.map(&:name).reject(&:nil?),\n interventions: interventions.map(&:description).reject(&:nil?),\n design_outcome_measures: design_outcomes.map(&:measure),\n facility_names: facilities.map(&:name),\n facility_states: facilities.map(&:state),\n facility_cities: facilities.map(&:city),\n facility_countries: facilities.map(&:country),\n locations: facility_coords_hash,\n average_rating: average_rating,\n reviews_count: reviews.count,\n reviews: reviews && reviews.map(&:text),\n sponsors: sponsors && sponsors.map(&:name),\n rating_dimensions: rating_dimensions.keys,\n indexed_at: Time.now.utc,\n study_views_count: study_view_logs.count,\n wiki_page_edits: {\n email: wiki_page_edits.map(&:user).map(&:email),\n created_at: wiki_page_edits.map(&:created_at).map(&:to_time),\n },\n reactions:{\n email: reactions.order(:id).map(&:user).map(&:email),\n kind: reactions.order(:id).map(&:reaction_name)\n\n },\n ).merge(\n average_rating_dimensions,\n ).merge(\n wiki_search_data,\n ).except(\n # https://github.com/clinwiki-org/clinwiki/issues/111\n *NON_INDEX_FIELDS, *NON_INDEX_FIELDS.map(&:to_s)\n )\n end", "title": "" }, { "docid": "1d3e625d0e58b1f947af0f690d0d0b16", "score": "0.56607145", "text": "def gather_search\n local_search = Search.search @query\n unless local_search.nil?\n local_search = FoodItem.fetch_local_items local_search['food_items']\n return local_search unless local_search.nil?\n end\n\n remote_search = search_apis @query # adds searches remote end for elements\n unless remote_search.nil?\n Search.add @query, remote_search # adds elements to search\n remote_search = add_multiple_food_items remote_search unless remote_search.nil?\n return remote_search unless remote_search.nil?\n end\n\n nil # fallback\n end", "title": "" }, { "docid": "e4afd49dfeeea7b27c54618326ead682", "score": "0.5657544", "text": "def advanced_search\n if params[:name] || params[:location] || params[:user] || params[:content]\n query = create_advanced_search_query(params)\n else\n return if handle_advanced_search_invalid_q_param?\n\n query = find_query(:Observation)\n end\n show_selected_observations(query)\n rescue StandardError => e\n flash_error(e.to_s) if e.present?\n redirect_to(search_advanced_path)\n end", "title": "" }, { "docid": "f69e298dd5dc04b247c8afc4ee3710c2", "score": "0.5657343", "text": "def index\n @search = AnimalColor.includes(:animals).organization(current_user).search(params[:q])\n @animal_colors = @search.result.paginate(page: params[:page], per_page: 10).order('updated_at DESC')\n\n respond_with(@animal_colors)\n end", "title": "" }, { "docid": "b951689d31f59222d81e08e15f461c6a", "score": "0.5650074", "text": "def ar_search_results tags= {}\n if !@query || @query.empty? \n result= controller.ardata.labels[:ask_for_search_terms]\n elsif @search_results && @search_results.total_hits > 0\n\n result= sprintf(controller.ardata.labels[:search_results_summary], \n @search_results.total_hits, @query)\n \n items= @search_results.inject([]) do |elems_array, elem|\n elems_array << content_tag(tags[:item] || :li, ar_transform_search_result(elem))\n end\n\n result= \"#{result}\\n#{content_tag(tags[:items] || :ul, items.join(\"\\n\"))}\"\n else\n result= sprintf(controller.ardata.labels[:search_results_summary], 0, @query)\n end\n \n content_tag(tags[:enclose] || :p, result)\n end", "title": "" }, { "docid": "da9904f3ca99ef8ceba84bbeb0bd10d4", "score": "0.5646947", "text": "def index\n @q = @shelter.animals.where.not(name: nil).ransack(params[:q])\n @animals = @q.result(distinct: true).paginate(:page => params[:page], :per_page => 5)\n @animal = @shelter.animals.build\n\n end", "title": "" }, { "docid": "54b23f842d8a4aaaa3e6904bf2aed319", "score": "0.5645091", "text": "def parse_search; end", "title": "" }, { "docid": "3c9da43fcb4293a0cf01ab2468f2dac7", "score": "0.5642997", "text": "def search(query, options = {}); end", "title": "" }, { "docid": "2ccade747c8843188da6ff19115238c4", "score": "0.563878", "text": "def search_params_for_display(search_query)\n display_map = {}\n # name fields\n display_map[\"First Name\"] = search_query.first_name.upcase if search_query.first_name\n display_map[\"Last Name\"] = search_query.last_name.upcase if search_query.last_name\n display_map[\"Exact Match?\"] = \"Yes\" unless search_query.fuzzy\n display_map[\"Exact Match?\"] = \"No\" if search_query.fuzzy\n\n display_map[\"Record Type\"] = RecordType::display_name(search_query.record_type) if search_query.record_type\n display_map[\"Record Type\"] = \"All\" if search_query.record_type.blank?\n\n display_map[\"Start Year\"] = search_query.start_year if search_query.start_year\n display_map[\"End Year\"] = search_query.end_year if search_query.end_year\n\n counties = search_query.chapman_codes.map{|code| ChapmanCode::name_from_code(code)}.join(\" or \")\n display_map[\"Counties\"] = counties if search_query.chapman_codes.size > 1\n display_map[\"County\"] = counties if search_query.chapman_codes.size == 1\n if search_query.places.size > 0\n first_place = search_query.places.first\n place = first_place.place_name\n if search_query.all_radius_places.size > 0\n last_place = search_query.all_radius_places.last\n place <<\n \" (including #{search_query.all_radius_places.size} additional places within\n #{geo_near_distance(first_place,last_place,Place::MeasurementSystem::ENGLISH).round(1)}\n #{Place::MeasurementSystem::system_to_units(Place::MeasurementSystem::ENGLISH)} )\"\n end\n display_map[\"Place\"] = place if search_query.places.size > 0\n end\n display_map[\"Include Family Members\"] = \"Yes\" if search_query.inclusive\n display_map[\"Include Winesses\"] = \"Yes\" if search_query.witness\n display_map\n end", "title": "" }, { "docid": "ce89fa82cbbb3f491bd4d8fe0a64de67", "score": "0.5637644", "text": "def build_meta_query(query)\n meta_query = {}\n if query.kind_of?(Hash)\n meta_query[:limit] = query.delete(:limit) if query[:limit]\n meta_query[:skip] = query.delete(:skip) if query[:skip]\n meta_query[:sort] = [query.delete(:order), 1] if query[:order] # 1 = ASC, -1 = DESC\n end\n meta_query\n end", "title": "" }, { "docid": "28516564054bbe2dad058cdb70286545", "score": "0.5633736", "text": "def search(query)\n @form['query'] = query\n end", "title": "" }, { "docid": "0c982e64ab0af65c27566436dd442bb3", "score": "0.5628147", "text": "def search\n unless params[:query].blank?\n @listings = custom_search(params[:query])\n #print \"\\n\\n\\n***203 #{@listings}***\\n\\n\\n\"\n @header_type = \"Search for \\\"\" + params[:query] + \"\\\"\"\n \n #will render search.rhtml by default\n else\n browse\n end\n end", "title": "" }, { "docid": "11c1d111972747488910dcc9ad561bbf", "score": "0.56267095", "text": "def taggable_search\n @results = {}\n cond_ary = [ 'title ILIKE :title' ]\n cond_var = { :title => \"%#{params[:name]}%\" }\n limit = 50\n TagImage.types_for_select.flatten.each do |ctype|\n next if ctype == 'Beer'\n klass = Class.class_eval(ctype)\n @results[ctype] = klass.find :all, :order => 'title ASC',\n :conditions => [ cond_ary.join(' AND '), cond_var ], :limit => limit\n end\n @results['Beer'] = Beer.find :all, :include => [ 'brewery' ],\n :order => 'breweries.title ASC, beers.title ASC', :limit => limit,\n :conditions => [ 'beers.title ILIKE :title OR breweries.title ILIKE :title', cond_var ]\n render :partial => 'taggable_results'\n end", "title": "" }, { "docid": "ae955f252ecd8303f0723376e107d2be", "score": "0.5625046", "text": "def lookup_payload\n {\n query: {\n bool: {\n should: [\n { match: { exact_query: @query } },\n { match: { stemmed_query: @query } },\n ],\n },\n },\n post_filter: {\n bool: { must: { match: { document_type: \"best_bet\" } } },\n },\n size: 1000,\n _source: {\n includes: %i[details stemmed_query_as_term],\n },\n }\n end", "title": "" }, { "docid": "bbed164f284881a64c2acf258eeaf2e6", "score": "0.5624141", "text": "def index\n search = params[:search].present? ? params[:search] : nil\n\n @artists = if search\n\n # Render search results\n\n Artist.search(params[:search], page: params[:page], per_page: 20)\n\n else\n\n # Render blog articles\n\n Artist.all.order(created_at: :desc).page(params[:page])\n\n end\n end", "title": "" }, { "docid": "f3b192a5d4bbb3cbc0ec1d501bc7b499", "score": "0.56130546", "text": "def new_search_data\n # for now these are the same\n activity_search_data\n end", "title": "" }, { "docid": "1c82a213ccb66fc426822dd2c9a714a7", "score": "0.56112456", "text": "def index\n @search = MicrornaPatient.search do\n fulltext params[:query_microrna_patient]\n end\n \n @microrna_patients = @search.results\n \n \n respond_to do |format|\n format.html\n format.json { render :json => @microrna_patients.map(&:attributes) }\n end\nend", "title": "" }, { "docid": "5a58989787a9c5ac260323db94e0ffcc", "score": "0.56088835", "text": "def index\n @searches = Sunspot.search(Drug, Review, Condition) do\n fulltext params[:search]\n end\n @results=@searches.results\n @drugresults=Array.new\n @conditionresults=Array.new\n @reviewresults=Array.new\n @results.each do |result|\n if result.instance_of?Drug\n @drugresults.push(result)\n elsif result.instance_of?Condition\n @conditionresults.push(result)\n else\n @reviewresults.push(result)\n end\n end\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @searches }\n end\n end", "title": "" }, { "docid": "19a85f8fbe0dd1a888f955bf2f6c441c", "score": "0.5605646", "text": "def index\n @animals = Animal.search(params[:term])\n # @tasks = Task.search(params[:term])\n # @my_input = params['my_input']\n end", "title": "" }, { "docid": "ff1bb11e0003368a0ceb05a477ab136b", "score": "0.5598167", "text": "def index\n @photographs = Photograph.all\n\n @search = Photograph.ransack(params[:q])\n @photographs = @search.result(distinct: true)\n end", "title": "" }, { "docid": "23734f8fa4191baddf006e8c74a5a30c", "score": "0.5580771", "text": "def setup_search_options\n @original_search_parameter = params[:search]\n params[:search] ||= \"\"\n params.keys.each do |param|\n if param =~ /(\\w+)_id$/\n unless params[param].blank?\n query = \"#{$1} = #{params[param]}\"\n params[:search] += query unless params[:search].include? query\n end\n end\n end\n end", "title": "" }, { "docid": "719b0b410dbfffe7c4945d139e8e16d0", "score": "0.5578372", "text": "def add_queries\n add_general_query\n add_title_query\n add_creators_query\n add_series_query\n add_collected_query\n add_tag_name_query\n end", "title": "" }, { "docid": "b4c48a1acaa80aafb10a46dc8f9739fb", "score": "0.5566089", "text": "def data\n what = searched_for(@term)\n where = searched_in(@filter)\n {\n term: @term,\n title: (what + where).sub(/\\sin\\s|\\sfor\\s/, ''), # strip out opening ' in ' or ' for '\n cpvs: @cpvs,\n keywords: @term,\n countries: @filter.countries,\n what: what,\n where: where,\n }\n end", "title": "" }, { "docid": "85f092b7bb8db9d749892a448bece607", "score": "0.55629796", "text": "def index\n\n @title = t(\"h2.categories\")\n @search = Category.search(params[:search])\n\n p @search\n unless params[:keyword].blank?\n p 222222222222222222222\n name = split_keyword(params[:keyword])\n \n @search.name_like = params[:keyword]\n # @search.or_content_like = name\n # @search.or_email_like = name\n end\n\n# Article.where((:name =~ 'Hello%') | (:content =~ 'Goodbye%')).to_sql\n\n\n @categories = @search.paginate(:page => params[:page])\n\n # @categories = Category.where(:name => '123').paginate(:page => params[:page] || 1, :per_page => params[:per_page] || 1)\n # @categories = Category.find(:all ,:conditions => [\"name like ? \" ,'%12%']).paginate(:page => params[:page] || 1, :per_page => params[:per_page] || 1)\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @categories }\n end\n end", "title": "" }, { "docid": "17283f5f80ad006aaae4fb3fa888c3ce", "score": "0.55574596", "text": "def search(query, options={})\n api_response = @api_client.make_api_request(:GET, \"artist/search\", {:q => query}, options)\n @api_client.artist_digestor.nested_list_from_xml(api_response.content.search_results, :search_result, :search_results)\n end", "title": "" }, { "docid": "d9e9b5b50af8e813dacae2e92800de09", "score": "0.55560076", "text": "def search_new\n\n @searching = true\n results = Profile.joins(:user).includes(:user => [:photos]).user_readable(current_user).search_for(params['search-string'])\n @profiles = results.page(params[:page]).per(@@results_per_page)\n\n respond_to do |format|\n format.html { render action: \"index\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n\n end", "title": "" }, { "docid": "9b1b75c34e553feb98e8488be6448cf0", "score": "0.5551148", "text": "def search\n @albums = Album.where(\"title ILIKE ? OR description ILIKE ?\", \"%#{params[:search]}%\", \"%#{params[:search]}%\")\n @artists = Artist.where(\"name ILIKE ? OR about ILIKE ?\", \"%#{params[:search]}%\", \"%#{params[:search]}%\")\n @tracks = Track.where(\"name ILIKE ?\", \"%#{params[:search]}%\")\n @search_combinde = {\n albums: @albums, \n artists: @artists, \n tracks: @tracks\n }\n\n respond_to do |format|\n format.html\n format.json { render json: @search_combinde.to_json }\n format.xml { render xml: @search_combinde.to_xml}\n end\n end", "title": "" }, { "docid": "52cda645202c2483154f7df7ad5c8990", "score": "0.5550485", "text": "def search_data\n {\n name: name,\n description: description,\n status: status\n }\n end", "title": "" }, { "docid": "8cc208f24be6b76797181cdfddbb65da", "score": "0.5546558", "text": "def index\n @search_name = params[:search_name]\n\n # INICIO RANSACK\n @query = LentType.ransack(params[:q]) \n @query.name_cont = @search_name if @search_name.present?\n\n # PAGINACION Y ORDEN\n @results = @query.result(distinct: true).paginate(:page => params[:page] )\n \n # RESULTADO FINAL\n @lent_types = @results \n end", "title": "" }, { "docid": "eca5828567c3b5b06af8179d11501294", "score": "0.55453926", "text": "def index\n authorize! :read, Recipe\n @query = params[:query]\n @search_result = Recipe.search do\n fulltext params[:query]\n if params[:course_type_ids].present?\n all_of do\n params[:course_type_ids].each do |filter|\n with(:course_type_ids, filter)\n end\n end\n end\n if params[:exclu_course_type_ids].present?\n all_of do\n params[:exclu_course_type_ids].each do |filter|\n without(:course_type_ids, filter)\n end\n end\n end\n if params[:difficulty].present?\n all_of do\n params[:difficulty].each do |filter|\n with(:difficulty, filter)\n end\n end\n end\n if params[:exclu_difficulty].present?\n all_of do\n params[:exclu_difficulty].each do |filter|\n without(:difficulty, filter)\n end\n end\n end\n if params[:cost].present?\n all_of do\n params[:cost].each do |filter|\n with(:cost, filter)\n end\n end\n end\n if params[:exclu_cost].present?\n all_of do\n params[:exclu_cost].each do |filter|\n without(:cost, filter)\n end\n end\n end\n if params[:category_ids].present?\n all_of do\n params[:category_ids].each do |filter|\n with(:category_ids, filter)\n end\n end\n end\n if params[:exclu_category_ids].present?\n all_of do\n params[:exclu_category_ids].each do |filter|\n without(:category_ids, filter)\n end\n end\n end\n if params[:main_ingredient_ids].present?\n all_of do\n params[:main_ingredient_ids].each do |filter|\n with(:main_ingredient_ids, filter)\n end\n end\n end\n if params[:exclu_main_ingredient_ids].present?\n all_of do\n params[:exclu_main_ingredient_ids].each do |filter|\n without(:main_ingredient_ids, filter)\n end\n end\n end\n if params[:source_ids].present?\n all_of do\n params[:source_ids].each do |filter|\n with(:source_ids, filter)\n end\n end\n end\n if params[:exclu_source_ids].present?\n all_of do\n params[:exclu_source_ids].each do |filter|\n without(:source_ids, filter)\n end\n end\n end\n facet :course_type_ids\n facet :category_ids\n facet :main_ingredient_ids\n facet :source_ids\n facet :difficulty, :sort => :index\n facet :cost, :sort => :index\n paginate :page => params[:page] || 1, :per_page => 10\n order_by(:score, :desc)\n order_by(:created_at, :desc)\n end\n @query_params = params.except( :page )\n \n filters = [\n :course_type_ids, \n :exclu_course_type_ids, \n :difficulty, \n :exclu_difficulty, \n :cost, \n :exclu_cost, \n :category_ids, \n :exclu_category_ids, \n :main_ingredient_ids, \n :exclu_main_ingredient_ids, \n :source_ids, \n :exclu_source_ids\n ]\n filters.each do |filter|\n if params[filter].present?\n params[filter].map!{ |x| x.to_i }\n end\n end\n \n # @search_result.facet(:main_ingredient_ids).rows.sort!{|a,b| (a.count <=> b.count) == 0 ? (a.instance.name <=> b.instance.name) : (a.count <=> b.count)*(-1) }\n # @search_result.facet(:course_type_ids).rows.sort!{|a,b| (a.count <=> b.count) == 0 ? (a.instance.name <=> b.instance.name) : (a.count <=> b.count)*(-1) }\n # @search_result.facet(:category_ids).rows.sort!{|a,b| (a.count <=> b.count) == 0 ? (a.instance.name <=> b.instance.name) : (a.count <=> b.count)*(-1) }\n # @search_result.facet(:source_ids).rows.sort!{|a,b| (a.count <=> b.count) == 0 ? (a.instance.name <=> b.instance.name) : (a.count <=> b.count)*(-1) }\n \n sort_alphabetical(@search_result.facet(:main_ingredient_ids).rows)\n sort_alphabetical(@search_result.facet(:course_type_ids).rows)\n sort_alphabetical(@search_result.facet(:category_ids).rows)\n sort_alphabetical(@search_result.facet(:source_ids).rows)\n end", "title": "" }, { "docid": "604f233de66e7941e2a2f1160156cbb2", "score": "0.5542353", "text": "def search(query,types=nil,never_or=nil,extras=nil,start=nil,count=nil)\n result = search_json query,types,never_or,extras,start,count\n return result if not result\n results = result['results'] || []\n api = self\n #\n # This start out nil, because we need to reference classes in\n # types.rb and this gets loaded after this file. There's\n # probably a better way to do this.\n #\n if not @@types2classes\n @@types2classes = {\n 'r' => Artist,\n 'a' => Album,\n 's' => User,\n 't' => Track,\n 'p' => Playlist\n }\n end\n results.map {|o| @@types2classes[o['type']].new(api).fill o}\n end", "title": "" }, { "docid": "4b8c4cd68c140d643344caf6efcca7b9", "score": "0.55413574", "text": "def index\n # @entries = Entry.all\n @search.sorts = ['term desc', 'created_at desc'] if @search.sorts.empty?\n @search_term = params[:q]\n @entries = @search\n .result(distinct: true)\n .includes(:definitions)\n .page(params[:page])\n .per(params[:per_page])\n\n\n 1\n end", "title": "" }, { "docid": "526aac864ea44fd8465b2730c3360b92", "score": "0.5534979", "text": "def index\n @search_url = artists_path\n @search = params[:search].to_s.html_safe\n\n @artists = Artist.page(params[:page])\n\n if @search.present?\n @artists = @artists.search(:name,@search.mb_chars)\n end\n\n if params[:per_page].present?\n @artists = @artists.per(params[:per_page])\n end\n end", "title": "" }, { "docid": "e1f62e56c2f06e8d97d99c8c0a7f5f02", "score": "0.5534504", "text": "def index\n #search query, check params for search then search by appropriate fields\n @q = Entry.all\n @author_id = params[:search][:author_id] if params[:search]\n @text = params[:search][:text] if params[:search]\n @q = Entry.search(@q, @text) if !@text.blank?\n @q = @q.where(author_id: params[:search][:author_id]) if !@author_id.blank?\n\n #final result and column toggle sort\n @entries = @q.paginate(:page => params[:page], :per_page => 30).includes(:author).order(sort_column + \" \" + sort_direction)\n end", "title": "" }, { "docid": "08d64f55b4df1a7b449805a0a6e5c05e", "score": "0.5514598", "text": "def search_data\n attributes.merge(location: {lat: latitude, lon: longitude})\n end", "title": "" }, { "docid": "8dbdbcde7c6a24e5d1ba5ba8814c7616", "score": "0.551221", "text": "def index\n results = @search.result(distinct: true)\n if params[:customer_id]\n results = results.where(customer_id: params[:customer_id])\n end\n results = results.tagged_with(params[:tags].split(/\\s*,\\s*/)) if params[:tags].present?\n results = results.includes :series\n results.paginate(page: params[:page], per_page: 20)\n\n set_listing results.paginate(page: params[:page], per_page: 20)\n\n end", "title": "" }, { "docid": "e2e65a7e5ca58baa6913d838eeab20fd", "score": "0.5510482", "text": "def index\n @animalcontrols = Animalcontrol.all.paginate(:per_page =>15, :page => params[:page]).where(\"address ILIKE ?\",\"%#{params[:address_search]}%\").where(\"name ILIKE ?\",\"%#{params[:name_search]}%\").where(\"callback ILIKE ?\",\"%#{params[:phone_search]}%\").where(\"unitassigned ILIKE ?\",\"%#{params[:unit_search]}%\")\n end", "title": "" }, { "docid": "7a96c54550efc56b040cedf0ccbb8717", "score": "0.5509056", "text": "def index\n #set @animals to all and keep updating based on search queries\n #rails combines all the where queries into 1.\n @animals = Animal.all\n if params[:category]\n if @categories.all.map {|c| c.id}.include? params[:category].to_i\n @animals = @animals.where(category_id: params[:category])\n end\n end\n if params[:sponsored]\n case params[:sponsored]\n when \"0\"\n @animals = @animals.where(sponsored: false)\n when \"1\"\n @animals = @animals.where(sponsored: true)\n end\n end\n if params[:name]\n if !params[:name].empty?\n @animals = @animals.where(\"name like ?\", \"%#{params[:name].downcase}%\")\n end\n end\n end", "title": "" }, { "docid": "1672ed6707b856456b6331aed9cfbd79", "score": "0.5499834", "text": "def perform_search\n if self.class == Alchemy::Admin::PagesController && params[:query].blank?\n params[:query] = 'lorem'\n end\n return if params[:query].blank?\n @search_results = search_results\n if paginate_per\n @search_results = @search_results.page(params[:page]).per(paginate_per)\n end\n end", "title": "" }, { "docid": "53f5795c2dcfae96b2d26959646003e2", "score": "0.549931", "text": "def search_json(query,types=nil,never_or=nil,extras=nil,start=nil,count=nil)\n method = 'search'\n type = TODO\n if not types\n types = 'Artist,Album,Track,Playlist,User'\n end\n args = {:query=>query}\n args[:types] = types if types\n args[:never_or] = never_or if never_or\n args[:extras] = extras if extras\n args[:start] = start if start\n args[:count] = count if count\n json = call method,args\n if Rdio::log_json\n Rdio::log json\n end\n return unwrap_json json\n end", "title": "" }, { "docid": "e876c3ea6a00bd5e601ae3643aa7caca", "score": "0.5497494", "text": "def all_search\n @results ||= []\n feat_keyword ||= {:name_contains => params[:q]}\n reward_keyword ||= {:partner_business_name_contains => params[:q]}\n\n Feat.search(feat_keyword).all.each do |r|\n @results << r\n end if !Feat.search(feat_keyword).all.nil? && feat_keyword.length > 0\n\n Reward.search(reward_keyword).all.each do |r|\n @results << r\n end if !Reward.search(reward_keyword).all.nil? && reward_keyword.length > 0\n end", "title": "" }, { "docid": "9f3f75bfd88a4ae2fa5291142e741837", "score": "0.5496554", "text": "def search\n begin\n words= params[:search][:qw].strip\n @query_info=words\n\n # search in the descriptions\n @videos=VMetadata.search(words, :page => params[:page], :per_page => @@per_page,\n :match_mode => :any, :rank_mode => :proximity_bm25)\n\n respond_to do |format|\n format.html { render 'query/show' }\n end\n rescue ActiveRecord::RecordNotFound\n render(:file => \"#{Rails.root}/public/404.html\",\n :status => \"404 Not Found\")\n end\n end", "title": "" }, { "docid": "99ad1448d00c746f4a3521bd8188f02b", "score": "0.5495938", "text": "def search(query, page = 1, per_page = 10, orientation = nil)\n params = {\n query: query,\n page: page,\n per_page: per_page,\n orientation: orientation\n }.select { |_k, v| v }\n Unsplash::Search.search(\"/search/photos\", self, params)\n end", "title": "" }, { "docid": "da14b9fe0b11e770c48a42db1bac9a73", "score": "0.54956627", "text": "def find_by_query_columns\n ['title', 'description']\n end", "title": "" }, { "docid": "7f0e22bc765897b040184a2536ca53db", "score": "0.54907167", "text": "def search\n \n search = params[:search]\n miniresume = params[:miniresume]\n location = params[:location]\n\n #thinking_sphinx conditions - \n @adviceposts = Advicepost.search(search,miniresume,location,page: 1, per_page: 25)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @adviceposts }\n end\n end", "title": "" }, { "docid": "7a65a4bb0f3ed69fc52244a98e7e0bff", "score": "0.5484715", "text": "def index_meta_data\n {\n q: params[:q],\n page: @users.current_page,\n per_page: @users.limit_value,\n total_pages: @users.total_pages\n }\n end", "title": "" }, { "docid": "689ad65024e2fcabaa9c3fb0c7d175d0", "score": "0.54846126", "text": "def advanced_search # :nologin: :norobots:\n if params[:name] || params[:location] || params[:user] || params[:content]\n search = {}\n search[:name] = params[:name] unless params[:name].blank?\n search[:location] = params[:location] unless params[:location].blank?\n search[:user] = params[:user] unless params[:user].blank?\n search[:content] = params[:content] unless params[:content].blank?\n search[:search_location_notes] = !params[:search_location_notes].blank?\n query = create_query(:Observation, :advanced_search, search)\n else\n query = find_query(:Observation)\n end\n show_selected_observations(query)\n rescue => err\n flash_error(err.to_s) unless err.blank?\n redirect_to(controller: \"observer\", action: \"advanced_search_form\")\n end", "title": "" }, { "docid": "492a8b091c52fdfe16640e077b9dae6e", "score": "0.54833436", "text": "def my_search\n keywords = params[:search].downcase.split(',')\n\n tags = Article.tagged_with(keywords, any: true).uniq\n titles = Article.all.select { |a| keywords.include?(a.title.downcase) }.uniq\n begin\n summarys = Article.all.select { |a| keywords.include?(a.summary.downcase) }.uniq\n rescue NoMethodError\n summarys = []\n end\n sources = Article.all.select { |a| keywords.include?(a.source.name.downcase) }.uniq\n\n weight_dictionary = []\n\n tags.each do |article|\n if weight_dictionary.map { |row| row[0] }.include?(article)\n weight_dictionary[weight_dictionary.map { |row| row[0] }.index(article)] =\n [\n article,\n TAGS_WEIGHT,\n weight_dictionary[weight_dictionary.map { |row| row[0] }.index(article)][2] + 1\n ]\n else\n weight_dictionary << [article, TAGS_WEIGHT, 1]\n end\n end\n titles.each do |article|\n if weight_dictionary.map { |row| row[0] }.include?(article)\n weight_dictionary[weight_dictionary.map { |row| row[0] }.index(article)] =\n [\n article,\n TITLES_WEIGHT,\n weight_dictionary[weight_dictionary.map { |row| row[0] }.index(article)][2] + 1\n ]\n else\n weight_dictionary << [article, TITLES_WEIGHT, 1]\n end\n end\n summarys.each do |article|\n if weight_dictionary.map { |row| row[0] }.include?(article)\n weight_dictionary[weight_dictionary.map { |row| row[0] }.index(article)] =\n [\n article,\n SUMMARYS_WEIGHT,\n weight_dictionary[weight_dictionary.map { |row| row[0] }.index(article)][2] + 1\n ]\n else\n weight_dictionary << [article, SUMMARYS_WEIGHT, 1]\n end\n end\n sources.each do |article|\n if weight_dictionary.map { |row| row[0] }.include?(article)\n weight_dictionary[weight_dictionary.map { |row| row[0] }.index(article)] =\n [\n article,\n SOURCES_WEIGHT,\n weight_dictionary[weight_dictionary.map { |row| row[0] }.index(article)][2] + 1\n ]\n else\n weight_dictionary << [article, SOURCES_WEIGHT, 1]\n end\n end\n\n unless !weight_dictionary.nil? || !weight_dictionary.empty?\n @articles = [].paginate(page: params[:page], per_page: 10)\n @page_title = 'No results found for: \"' + params[:search] + '\"'\n render 'index'\n else\n weight_dictionary.each do |row|\n # Only keep searches where ALL keywords have been accounted for\n weight_dictionary.delete(row) if row[2] != keywords.length\n end\n @articles = weight_dictionary.sort_by { |article, _weight, _keyword| article.date_time }.sort_by { |_article, weight, _keyword| weight }.reverse.map { |row| row[0] }\n @articles = @articles.paginate(page: params[:page], per_page: 10)\n @page_title = 'Results for search: \"' + params[:search] + '\"'\n render 'index'\n end\n end", "title": "" }, { "docid": "f80c8fb3ee475741c4cce225fb674361", "score": "0.5481952", "text": "def perform_gallery_search\n\n\n\n \trijksmuseum_key = ENV['RIJKSMUSEUM_KEY']\n escaped_search_term = self.escaped_search_term\n response = HTTParty.get(\"https://www.rijksmuseum.nl/api/en/collection?key=#{rijksmuseum_key}&format=json&q=#{escaped_search_term}&imgonly=true\")\n response_json = JSON.parse(response.body)\n rijksmuseum_response_count = response_json[\"count\"]\n rijksmuseum_array = response_json[\"artObjects\"]\n\n array_of_container_objects = []\n\n # rijksmuseum_array.each do |item|\n # container_array = {\n # title: \"\",\n # image: \"\",\n # artist: \"\",\n # id: \"\"\n # }\n\n # if item[\"longTitle\"].nil? || item[\"webImage\"].nil? || item[\"principalOrFirstMaker\"].nil?\n # # return cooper_hewitt_random_artwork_generator\n # container_array[:title] = \"Not found\"\n # container_array[:image] = \"Not found\"\n # container_array[:artist] = \"Not found\"\n # container_array[:id] = \"Not found\"\n # array_of_container_objects.push(container_array)\n # return array_of_container_objects\n # end\n # container_array[:title] = item[\"longTitle\"]\n # container_array[:image] = item[\"webImage\"][\"url\"]\n # container_array[:artist] = item[\"principalOrFirstMaker\"]\n # container_array[:id] = item[\"id\"]\n\n # array_of_container_objects.push(container_array)\n # end\n\n # container_array\n array_of_container_objects\n end", "title": "" }, { "docid": "c606017d3d4631e41fef0e7cd104011e", "score": "0.5480924", "text": "def index\n @search = search_params\n #do your customize query here\n @images = Image.page(params[:page]).order('created_at desc')\n if @search && @search[:keyword]\n @images = @images.where('title like ?', @search[:keyword]+'%')\n end\n end", "title": "" }, { "docid": "ef483418c9a78e05301cc7a293720a25", "score": "0.5478277", "text": "def index\n # @locations = Location.all\n if params[:search]\n @locations = Location.name_sounds_like(params[\"search\"][\"query\"]).paginate(:page => params[:page], :order => 'population DESC') \n else \n @locations = Location.paginate(:page => params[:page], :order => 'population DESC', :per_page => 12) \n end\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @locations }\n end\n end", "title": "" }, { "docid": "8812953951621ac6b7c00cfbd2d37e11", "score": "0.54747504", "text": "def set_search\n @search_adie = Adie.search(params[:q])\n @search_company = Company.search(params[:q])\n @search_employee = Employee.search(params[:q])\n end", "title": "" }, { "docid": "7d7bab17de73319f1f5e6314a255333b", "score": "0.5472441", "text": "def metadata\n puts \"Adding Metadata...\"\n doc = Nokogiri::HTML(open(\"http://www.last.fm/search?q=#{query}&type=track\"))\n url = doc.css(\"span.chartlist-ellipsis-wrap\").first.css(\"a.link-block-target\").first.attr('href')\n ch = url.gsub('/music/', \"\")\n artist, title = ch.split(\"/_/\")\n artist = artist.gsub('+', \" \")\n title = title.gsub('+', \" \")\n doc = Nokogiri::HTML(open(\"http://www.last.fm#{url}\"))\n album = doc.css(\"h3 a\").first\n begin\n Mp3Info.open(\"#{query.gsub(\"+\",\"-\")}.mp3\") do |mp3|\n mp3.tag.title = \"#{URI.unescape(title)}\".strip\n mp3.tag.artist = \"#{URI.unescape(artist)}\".strip\n mp3.tag.album = \"#{URI.unescape(album.content)}\".strip\n end\n puts \"Done\"\n rescue\n puts \"Fail\"\n end\n end", "title": "" }, { "docid": "6ab340ea6152efa196e18d379b99609c", "score": "0.5472069", "text": "def decorate_with_rdio_info albums\n puts \"\\nSearching Rdio for #{albums.size} albums\"\n service = RdioService.new\n\n albums.each do |album_info|\n puts \" Searching Rdio for #{album_info.artist_name}: #{album_info.album_name}\"\n results = service.search_for_album(album_info)\n\n next if results.nil?\n next if results.empty?\n\n album_info.rdio_album = results.first\n end\nend", "title": "" }, { "docid": "90f519c833e788e02a069a5d1ef81887", "score": "0.5465745", "text": "def nxql_search_params\n fields = %w(brand_id brand_name item_id item_name nf_serving_size_qty nf_serving_size_unit)\n fields << %w(nf_calories nf_total_carbohydrate nf_sodium nf_dietary_fiber nf_protein)\n default_fields = fields.flatten\n\n {\n offset: 0,\n limit: 50,\n fields: default_fields,\n\n filters:{\n item_type:2 #filter by boxed goods?\n }\n\n }\n end", "title": "" }, { "docid": "5b47790c7600d0129a29e6ebae908b8c", "score": "0.54628265", "text": "def search_by_keyword(query, o={})\n #debugger\n #debug \"[search_by_keyword] query = #{query}\"\n result = Sunspot.search(Item) do\n keywords query\n if o[:doc_only]\n without :itype_str, Item::ITYPE_CONCEPT#['query','concept','tag']\n end\n #debugger\n o.find_all{|k,v|k.to_s =~ /^facet\\_/}.each do |e|\n #debugger\n with (e[0].to_s.split('_')[1..-1].join('_')).to_sym, e[1] if [e[1]].flatten.first != '-1'\n end\n #debugger\n order_by(:basetime, :desc) if o[:order] == \"recency\" || query == TEXT_DUMMY\n paginate(:page => o[:page], :per_page => o[:per_page]) if o[:page]\n facet(o[:facet]) if o[:facet]\n without :hidden_flag, '1'\n end\n #debugger\n if o[:facet]\n result.facet(o[:facet]).rows\n elsif o[:raw]\n result\n else\n result_items = result.hits.map_with_index{|e,i|{:id=>e.instance.id, :rank=>(i+1), :score=>e.score}}\n @cv.add(:type=>'kwd', :query=>query, :created_at=>(o[:created_at] || Time.now), :history_id=>o[:history_id], :result=>result_items) if o[:add_context]\n result_items\n end\n end", "title": "" }, { "docid": "0bc2ead4545451cb2f6f99c8ea54629d", "score": "0.54609436", "text": "def get_results_by_what\n\n initialize_filter\n\n cond = String.new\n if (@search_category_list || @search_from_input_box || @search_by_what_where_url) &&\n !(@search_by_author || @search_by_author_url)\n\n #did one click a tag?\n if @search_category_list\n @filter[:category_list] = params[:blog_entry][:category_list] if params[:blog_entry]\n @filter[:searchterms] = @filter[:category_list] = params[:category_list] if params[:category_list] &&( params[:blog_entry].nil? ||params[:blog_entry][:category_list]==\"\")\n else\n #prepare search input, look at things tagged with search terms as well\n @filter[:category_list] = params[:blog_entry][:search].split(',')\n @filter[:category_list].each{|item| item = item.strip} if @filter[:category_list].size > 1\n @filter[:searchterms] = params[:blog_entry][:search].strip unless params[:blog_entry][:search].nil?\n end\n\n #the second one is for tagged by searching\n @messages, @messages2 = Array.new\n if @search_from_input_box\n cond = \"1=1 \"\n elsif @search_category_list\n cond = \"1=1 \"\n end\n\n #conditions for distance, no unmapped being supported here\n cond = cond + \"AND (\" + BlogEntry.distance_sql(session[:geo_location], :miles, :sphere) << \"<= #{@filter[:radius]}\" + \")\"\n distcond = cond\n\n cond = cond + %Q{ AND lower(what) LIKE '%#{@filter[:searchterms].downcase.gsub(/[.,']/, '%')}%' } if @filter[:searchterms]\n\n @messages = BlogEntry.find :all, :conditions => cond, :order => 'blog_entries.created_at desc', :limit => @filter[:post_limit], :include =>[:user, :categories, :ratings]\n\n # but you also need to check tags because not only is the what a good candidate, the tags are there for search too\n @filter[:category_list] = params[:category_list] if params[:category_list]\n\n # wait input box overrides tag search\n @filter[:category_list] = params[:blog_entry][:search] if params[:blog_entry]&& params[:blog_entry][:search]!= \"\"\n\n @messages2 = BlogEntry.find_tagged_with @filter[:category_list], {:on=> :categories, :conditions=> distcond, :order => 'blog_entries.created_at desc', :limit => @filter[:post_limit], :include =>[:user, :ratings] }\n\n @messages2 = @messages2.find_all{|m| m.distance_to(session[:geo_location]) <= @filter[:radius].to_f || ( @filter[:show_unmapped] && m.lat.nil?)}\n\n @filter[:searchterms] = @filter[:category_list]\n @messages.concat(@messages2) if @messages2\n\n @messages = @messages.uniq\n #search by author (only possible through tag)\n elsif @search_by_author || @search_by_author_url && !@default_logged_in_search\n if params[:blog_entry].nil? && params[:author]\n params[:blog_entry]=Hash.new\n if author= User.find_by_name(params[:author])\n params[:blog_entry][:author_id] = author.id\n @filter[:author_id] = author.id\n end\n end\n\n @filter[:post_limit] = 500 if logged_in?\n @messages =BlogEntry.find :all, :conditions => {:user_id => params[:blog_entry][:author_id]}, :order => 'blog_entries.created_at desc', :include =>[:user, :ratings], :limit => @filter[:post_limit]\n\n elsif @search_by_location || @default_logged_in_search\n get_initial_messages\n else\n #fallback\n get_initial_messages\n end\n\n if session[:sliders]==true\n @messages = @messages.find_all{|m| m.rating >=@filter[:rating_from].to_f && m.rating <= @filter[:rating_to].to_f }\n @messages = @messages.find_all{|m| m.price|| 0 >= @filter[:price_from].to_f && m.price||0 <= @filter[:price_to].to_f }\n end\n\n\n finish_search\n\n end", "title": "" }, { "docid": "41f6249bb4371f4b9446f230ba33285a", "score": "0.54565483", "text": "def index\n @search_name = params[:search_name]\n\n # INICIO RANSACK\n @query = TypeClient.ransack(params[:q]) \n @query.name_cont = @search_name if @search_name.present?\n\n # PAGINACION Y ORDEN\n @results = @query.result(distinct: true).paginate(:page => params[:page] )\n \n # RESULTADO FINAL\n @type_clients = @results \n end", "title": "" }, { "docid": "dfa471148c645726b5dbcfbd9a57cdca", "score": "0.54561687", "text": "def index_query_results\n query = find_or_create_query(:NameDescription, by: params[:by])\n show_selected_name_descriptions(query, id: params[:id].to_s,\n always_index: true)\n end", "title": "" }, { "docid": "3ffef57a5f8dc1f6af08f8d118ce280f", "score": "0.5454786", "text": "def for(query)\n single_target_titles = []\n matches(query).each do |match|\n single_target_titles << {issn: match['022']['a'], sfx_object_id: match['090']['a'], title: match[\"245\"][\"a\"]} if single?(@all.index(match))\n end\n single_target_titles\n end", "title": "" }, { "docid": "ac522d9d9045e8dc10f2c6a92a950b92", "score": "0.5453169", "text": "def songs_from_query\n logger.info \"Grooveshark :: Query request initiated.\"\n if params[:query]\n query = URI.escape(params[:query])\n url = URI.parse(\"#{TINY_SONG_API}/s/#{query}?format=json&limit=#{NUM_SEARCH_RESULTS}&key=#{TINY_SONG_API_KEY}\")\n response = Net::HTTP.get_response(url).body\n response_json = ActiveSupport::JSON.decode(response)\n @song_results = response_json.map do |song_json|\n Song.find_or_create(song_json[\"SongID\"], song_json[\"SongName\"],\n song_json[\"AlbumID\"], song_json[\"AlbumName\"],\n song_json[\"ArtistID\"], song_json[\"ArtistName\"])\n end\n logger.info \"Grooveshark :: query results #{@song_results}.\"\n if @song_results.empty?\n render :text => \"No results were found.\"\n else\n render :partial => 'songs/song_list', :locals => {:songs => @song_results},\n :layout => false\n end\n else\n render :text => \"No query.\"\n end\n end", "title": "" }, { "docid": "ad1a5a583514694865b37d3673c9db7f", "score": "0.54523444", "text": "def search_query\n query = @grouping_class.new(sanitized_attributes, params)\n data = query.run\n @search_data = Rails.cache.fetch(['search_data', params], expires_in: 1.week) do\n query.build_hash(data, params)\n end\n @filtered_data = query.filter(@search_data, params)\n render :json => Kaminari.paginate_array(@filtered_data).page(params[:page]).per(params[:per_page]),\n :meta => metadata(@filtered_data, params)\n end", "title": "" }, { "docid": "6f6f899a9f11b1368257936d0feeb78c", "score": "0.5437702", "text": "def search_data\n updated_date = Arel.sql('DATE(updated_at)')\n activity_dates = activities.group(updated_date).pluck(updated_date)\n {\n type: type,\n name: name,\n tags: all_tag_names,\n user_tags: user_tag_list.map(&:downcase),\n content: search_content,\n organization_id: organization_id,\n user_ids: search_user_ids,\n group_ids: search_group_ids,\n parent_id: parent&.id,\n parent_ids: parent_ids,\n activity_dates: activity_dates.empty? ? nil : activity_dates,\n created_at: created_at,\n updated_at: updated_at,\n archived: archived,\n master_template: master_template,\n collection_type: collection_type,\n activity_count: activities_and_child_activities_count,\n }\n end", "title": "" } ]
f2977a75a19e7cbbe50a6a8b63e4e6e2
Parse tree to be compatible with jstree input data
[ { "docid": "70e9a06b7ebc64916022eb5455642334", "score": "0.66898245", "text": "def jstree_data\n Resource.tree.ordered.roots.map { |res| parse_jstree_node(res) }\n end", "title": "" } ]
[ { "docid": "8583f7809d0f7143ba111b7e607c49c3", "score": "0.7659295", "text": "def parsed_tree; end", "title": "" }, { "docid": "cfa6b7668a7eb3602553bcd8c2cf653b", "score": "0.686717", "text": "def parse(data)\n @tree = instance.parse(data)\n raise Error, instance unless @tree\n \n @tree\n end", "title": "" }, { "docid": "4991cc372fa086a89a6e1ea83943f0c8", "score": "0.66309905", "text": "def parse_tree\n File.open(html_file, 'r') do |file|\n current = nil\n file.each_line do |line|\n line.scan(%r{(<(.*?>.*?)<(\\/.*?)>|<(.*?)>(.*))}).each do |tag|\n if !tag[3].nil? && tag[3].start_with?('/') # ending tag\n current = current.parent\n else\n node = Node.new(tag)\n if @root.nil?\n @root = node\n else\n node.parent = current\n current.childs << node\n end\n @tags << node.tag\n current = node\n current = current.parent if !tag[2].nil? && tag[2].start_with?('/')\n end\n end\n end\n end\n end", "title": "" }, { "docid": "9f65e05723ecb9684e322d7876f62719", "score": "0.6384354", "text": "def parse_trees\n otus = cache[ attribute( 'otus' ) ]\n\n id = attribute( 'id' )\n label = attribute( 'label' )\n\n trees = NeXML::Trees.new( id, :otus => otus, :label => label )\n\n #a 'trees' element *will* have child nodes.\n while next_node\n case local_name\n when \"tree\"\n #parse child 'tree' element\n trees << parse_tree\n when \"network\"\n trees << parse_network\n when \"trees\"\n #end of current 'trees' element has been reached\n break\n end\n end\n\n #return the 'trees' object\n trees\n end", "title": "" }, { "docid": "8b42aa5beef27634d2fa61909572953a", "score": "0.6297782", "text": "def parse_tree\n id = attribute( 'id' )\n label = attribute( 'label' )\n\n type = attribute( 'xsi:type' )[4..-1]\n klass = NeXML.const_get( type )\n tree = klass.new( id, :label => label )\n\n #a 'tree' element *will* have child nodes.\n while next_node\n case local_name\n when \"node\"\n #parse child 'node' element\n node = parse_node\n\n #and add it to the 'tree'\n tree.add_node node\n\n #root?\n tree.roots << node if node.root?\n when \"rootedge\"\n #parse child 'edge' element\n rootedge = parse_rootedge\n\n #and add it to the 'tree'\n # tree.add_rootedge rootedge # XXX it looks like the super class(es)\n # can only deal with edges that have source and target\n when \"edge\"\n #parse child 'edge' element\n edge = parse_edge( type )\n\n #and add it to the 'tree'\n tree.add_edge edge\n when \"tree\"\n #end of current 'tree' element has been reached\n break\n end\n end\n\n #return the 'tree' object\n tree\n end", "title": "" }, { "docid": "05b47b429bf3de79e35a840054bb05d6", "score": "0.62531066", "text": "def build_tree(data)\n @root = Node.new(data[0])\n data.shift\n data.each { |value| @root.insert(value) }\n end", "title": "" }, { "docid": "b7f7113a08ff52d65eee794de8ca1f9c", "score": "0.6194001", "text": "def transform(tree); end", "title": "" }, { "docid": "6d4f6a517b676827f3f263eb5b86e1e9", "score": "0.61201173", "text": "def produce_tree(ary); end", "title": "" }, { "docid": "a4c13da4029c487e4829fe239ae75bef", "score": "0.61030877", "text": "def tree\n @tree ||= build_tree\n end", "title": "" }, { "docid": "8a2e943280b86cd4634fd21dab1aefbf", "score": "0.60604525", "text": "def gen_tree\n new_tree = {}\n node_list = {}\n @json_tree.each do |k, v|\n if v['child_of'].nil?\n # top\n new_tree[k] = v\n node_list[k] = new_tree[k]\n else\n parent = v['child_of']\n if v['condition'] == 'and'\n node_list[parent]['and'] ||= {}\n node_list[parent]['and'][k] = v\n node_list[k] = node_list[parent]['and'][k]\n elsif v['condition'] == 'or'\n node_list[parent]['or'] ||= {}\n node_list[parent]['or'][k] = v\n node_list[k] = node_list[parent]['or'][k]\n else\n # TODO: sink?\n node_list[parent]['or'] ||= {}\n node_list[parent]['or'][k] = v\n node_list[k] = node_list[parent]['or'][k]\n end\n end\n end\n\n @json_tree_type = 'tree'\n @json_tree = new_tree\n end", "title": "" }, { "docid": "92d4b41da2c8acd36cbada4617b3de60", "score": "0.60112315", "text": "def build_parse_tree(exp)\n exp_arr = exp.split\n tree_stack = Stack.new\n tree = BinaryTree.new('')\n current_tree = tree\n exp_arr.each do |i|\n if i == '('\n current_tree.insert_left('')\n tree_stack.push(current_tree)\n current_tree = current_tree.left_child\n elsif i.match(/\\d/)\n current_tree.set_root_value(Integer(i))\n parent = tree_stack.pop\n current_tree = parent\n elsif ['+', '-', '*', '/'].include?(i)\n current_tree.set_root_value(i)\n current_tree.insert_right('')\n tree_stack.push(current_tree)\n current_tree = current_tree.right_child\n elsif i == ')'\n current_tree = tree_stack.pop\n else\n fail 'Invalid Argument'\n end\n end\n tree\nend", "title": "" }, { "docid": "7c14ffd1d38cbc1f7f6f868fc4e52571", "score": "0.6008441", "text": "def tree(data_path, options = {})\n\t\t\t\tresult = \"\"\n\n\t\t\t\t# Unique hash\n\t\t\t\t@hash = Digest::SHA1.hexdigest(data_path.to_s)\n\n\t\t\t\t# Options\n\t\t\t\t@options = options.nil? ? {} : options\n\n\t\t\t\t# Clipboard\n\t\t\t\tif @options[:clipboard_attrs]\n\t\t\t\t\tclipboard = true\n\t\t\t\t\t@options[:clipboard_attrs] = [@options[:clipboard_attrs]] if !@options[:clipboard_attrs].is_a?(Array)\n\t\t\t\t\tclipboard_attrs_js = \"[\" + @options[:clipboard_attrs].map { |item| \"'#{item}'\" }.join(\",\") + \"]\"\n\t\t\t\telse\n\t\t\t\t\tclipboard = false\n\t\t\t\t\tclipboard_attrs_js = \"[]\"\n\t\t\t\tend\n\n\t\t\t\t# Actions\n\t\t\t\tif @options[:actions]\n\t\t\t\t\tactions_js = \"[\"\n\t\t\t\t\toptions[:actions].each do |key, action|\n\t\t\t\t\t\tactions_js += %{\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\turl: '#{action[:path] ? @path_resolver.resolve(action[:path], \":id\") : \"\"}',\n\t\t\t\t\t\t\t\ticon: '#{action[:icon]}',\n\t\t\t\t\t\t\t\tlabel: '#{action[:label]}',\n\t\t\t\t\t\t\t\tcollapsed: #{action[:collapsed] == true ? \"true\" : \"false\"},\n\t\t\t\t\t\t\t\tstyle: '#{action[:style] ? action[:style] : \"default\"}',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}\n\t\t\t\t\tend\n\t\t\t\t\tactions_js += \"]\"\n\t\t\t\telse\n\t\t\t\t\tactions_js = \"[]\"\n\t\t\t\tend\n\n\t\t\t\t# Parent\n\t\t\t\tparent = (options[:parent] ? options[:parent] : nil)\n\n\t\t\t\t# Save state\n\t\t\t\tsave_state = (options[:save_state] ? options[:save_state] : :simple)\n\n\t\t\t\t# Application JS\n\t\t\t\tresult += @template.javascript_tag(%{\n\t\t\t\t\tvar rug_tree_#{@hash} = null;\n\t\t\t\t\t$(document).ready(function() {\n\t\t\t\t\t\trug_tree_#{@hash} = new RugTree('#{@hash}', {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Model\n\t\t\t\t\t\t\tmodel: 'node',\n\n\t\t\t\t\t\t\t// State\n\t\t\t\t\t\t\tsaveState: '#{save_state.to_s}',\n\n\t\t\t\t\t\t\t// Parent element\n\t\t\t\t\t\t\tparent: '#{parent.to_s}',\n\n\t\t\t\t\t\t\t// Icons\n\t\t\t\t\t\t\tclosedIcon: '#{@icon_builder.render(@options[:closed_icon] ? @options[:closed_icon] : \"chevron-right\")}',\n\t\t\t\t\t\t\topenedIcon: '#{@icon_builder.render(@options[:opened_icon] ? @options[:opened_icon] : \"chevron-down\")}',\n\n\t\t\t\t\t\t\t// Show\n\t\t\t\t\t\t\tshow: #{check_show(@options) ? 'true' : 'false'},\n\t\t\t\t\t\t\tshowEvent: '#{@options[:show_event] && @options[:show_event].to_sym == :double_click ? \"dblclick\" : \"click\"}',\n\t\t\t\t\t\t\tshowUrl: '#{@path_resolver.resolve(@options[:paths][:show], \":id\")}',\n\n\t\t\t\t\t\t\t// Create\n\t\t\t\t\t\t\tcreate: #{check_create(@options) ? 'true' : 'false'}, \n\t\t\t\t\t\t\tcreateUrl: '#{@path_resolver.resolve(@options[:paths][:create])}',\n\t\t\t\t\t\t\tcreateIcon: '#{@icon_builder.render(@options[:update_icon] ? @options[:update_icon] : \"plus\")}',\n\t\t\t\t\t\t\tcreateLabel: '#{I18n.t(\"general.action.create_child\").upcase_first}',\n\t\t\t\t\t\t\tcreateActionCollapsed: #{@options[:create_action_collapsed] == true ? 'true' : 'false'}, \n\t\t\t\t\t\t\tcreateSuccessMessage: '#{I18n.t(\"general.messages.create.success\")}',\n\n\t\t\t\t\t\t\t// Update\n\t\t\t\t\t\t\tupdate: #{check_update(@options) ? 'true' : 'false'}, \n\t\t\t\t\t\t\tupdateUrl: '#{@path_resolver.resolve(@options[:paths][:update], \":id\")}', \n\t\t\t\t\t\t\tupdateIcon: '#{@icon_builder.render(@options[:update_icon] ? @options[:update_icon] : \"pencil\")}',\n\t\t\t\t\t\t\tupdateLabel: '#{I18n.t(\"general.action.update\").upcase_first}',\n\t\t\t\t\t\t\tupdateActionCollapsed: #{@options[:update_action_collapsed] == true ? 'true' : 'false'}, \n\t\t\t\t\t\t\tupdateSuccessMessage: '#{I18n.t(\"general.messages.create.success\")}',\n\n\t\t\t\t\t\t\t// Destroy\n\t\t\t\t\t\t\tdestroy: #{check_destroy(@options) ? 'true' : 'false'}, \n\t\t\t\t\t\t\tdestroyUrl: '#{@path_resolver.resolve(@options[:paths][:destroy], \":id\")}', \n\t\t\t\t\t\t\tdestroyIcon: '#{@icon_builder.render(@options[:update_icon] ? @options[:update_icon] : \"trash\")}',\n\t\t\t\t\t\t\tdestroyLabel: '#{I18n.t(\"general.action.destroy\").upcase_first}',\n\t\t\t\t\t\t\tdestroyActionCollapsed: #{@options[:destroy_action_collapsed] == true ? 'true' : 'false'}, \n\t\t\t\t\t\t\tdestroyConfirmMessage: '#{I18n.t(\"general.are_you_sure\")}',\n\t\t\t\t\t\t\tdestroySuccessMessage: '#{I18n.t(\"general.messages.destroy.success\")}',\n\n\t\t\t\t\t\t\t// Moving\n\t\t\t\t\t\t\tmoving: #{check_moving(@options) ? 'true' : 'false'},\n\t\t\t\t\t\t\tmovingUrl: '#{@path_resolver.resolve(@options[:paths][:move], \":id\", \":relation\", \":destination_id\")}',\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Type\n\t\t\t\t\t\t\ttypeIconTemplate: '#{@icon_builder.render(\":icon\", class: \"jqtree-icon\")}',\n\t\t\t\t\t\t\ttypeIconAttr: '#{@options[:type_icon_attr]}',\n\n\t\t\t\t\t\t\t// Actions\n\t\t\t\t\t\t\tactions: #{actions_js},\n\t\t\t\t\t\t\tactionsIconTemplate: '#{@icon_builder.render(\":icon\")}',\n\n\t\t\t\t\t\t\t// Clipboard\n\t\t\t\t\t\t\tclipboard: #{clipboard ? 'true' : 'false'},\n\t\t\t\t\t\t\tclipboardIcon: '#{@icon_builder.render(@options[:clipboard_icon] ? @options[:clipboard_icon] : \"clipboard\")}',\n\t\t\t\t\t\t\tclipboardTemplate: \"#{clipboard ? (@options[:clipboard_template] ? @options[:clipboard_template].gsub('\"', \"'\") : \":\" + @options[:clipboard_attrs].first) : \"\"}\",\n\t\t\t\t\t\t\tclipboardAttrs: #{clipboard_attrs_js},\n\t\t\t\t\t\t\tclipboardActionCollapsed: #{@options[:clipboard_action_collapsed] == true ? 'true' : 'false'}, \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Select\n\t\t\t\t\t\t\tselectByDefault: #{@options[:select_by_default] ? @options[:select_by_default].to_i : \"null\"},\n\n\t\t\t\t\t\t\t// Reload\n\t\t\t\t\t\t\treloadIcon: '#{@icon_builder.render(@options[:update_icon] ? @options[:update_icon] : \"refresh\")}',\n\t\t\t\t\t\t\treloadLabel: '#{I18n.t(\"general.action.reload\").upcase_first}',\n\t\t\t\t\t\t});\n\t\t\t\t\t\trug_tree_#{@hash}.ready();\n\t\t\t\t\t});\n\t\t\t\t\t$(document).on('turbolinks:load', function() {\n\t\t\t\t\t\trug_tree_#{@hash}.repair();\n\t\t\t\t\t});\n\t\t\t\t})\n\n\t\t\t\tresult += %{\n\t\t\t\t\t<div id=\"tree-#{@hash}\" data-url=\"#{data_path.to_s}\"></div>\n\t\t\t\t}\n\n\t\t\t\treturn result.html_safe\n\t\t\tend", "title": "" }, { "docid": "2c643f21d975c9bb7869eea23ae4b494", "score": "0.59797645", "text": "def tree(path)\n root.tree(path)\n end", "title": "" }, { "docid": "1cc7ea44b2cc5158bacecf8697506762", "score": "0.59783214", "text": "def render\n return ro_standard if @readonly \n set_initial_value('html','value')\n require 'sort_alphabetical' \n \n record = record_text_for(@yaml['name'])\n p '******', \"<div id=\\\"#{@yaml['name']}\\\" class=\\\"tree-select\\\" #{set_style()} >\"\n @html << \"<div id=\\\"#{@yaml['name']}\\\" class=\\\"tree-select\\\" #{set_style()} >\"\n# Fill @choices hash. The key is parent object id\n @choices = {}\n do_eval(@yaml['eval']).each {|data| @choices[ data[2].to_s ] ||= []; @choices[ data[2].to_s ] << (data << false)}\n# put current values hash with. To speed up selection when there is a lot of categories\n current_values = {}\n current = @record[@yaml['name']] || []\n current.each {|e| current_values[e.to_s] = true}\n# set third element of @choices when selected\n @choices.keys.each do |key|\n 0.upto( @choices[key].size - 1 ) do |i|\n choice = @choices[key][i]\n choice[3] = true if current_values[ choice[1].to_s ]\n end\n end\n make_tree(nil)\n @html << '</ul></div>'\n# add hidden communication field \n @html << @parent.hidden_field(record, @yaml['name'], value: current.join(','))\n# javascript to update hidden record field when tree looses focus\n @js =<<EOJS\n$(function(){\n $(\"##{@yaml['name']}\").jstree( {\n \"checkbox\" : {\"three_state\" : false}, \n \"core\" : { \"themes\" : { \"icons\": false } },\n \"plugins\" : [\"checkbox\"]\n });\n});\n \n$(document).ready(function() {\n $('##{@yaml['name']}').on('focusout', function(e) {\n var checked_ids = [];\n var checked = $('##{@yaml['name']}').jstree(\"get_checked\", true);\n $.each(checked, function() {\n checked_ids.push( this.data.id );\n });\n $('#record_#{@yaml['name']}').val( checked_ids.join(\",\") );\n });\n});\nEOJS\n self\nend", "title": "" }, { "docid": "ac621869e0a6d6fc445a78dc8f196200", "score": "0.59588015", "text": "def build_tree(arr)\n\tend", "title": "" }, { "docid": "4baaf1e9884726cf097f178a72334585", "score": "0.5955594", "text": "def tree\n @roots = @cards.roots\n # TODO: remove jbuilder?\n render :tree, status: :ok\n end", "title": "" }, { "docid": "7f7110f1814763b14aeac27f3ed2fd9d", "score": "0.59267557", "text": "def parse!\n return if @parsed\n \n # the parents\n log_data = `git log -1 #{node}^ 2> /dev/null`\n \n # DETERMINING PARENTS\n dad = log_data[/^commit (.+)$/, 1]\n dad = dad ? dad[0..6] : nil\n mom = nil\n \n if log_data =~ /^Merge: (.+)\\.\\.\\. (.+)\\.\\.\\.$/ # Merge: 1c002dd... 35cfb2b...\n dad = $1 # just have them both use the short name, nbd\n mom = $2\n end\n \n @parents = [dad, mom].compact.map {|r| Changeset.new repo, r }\n \n # the actual changeset\n log_data = `git log -1 #{node} 2> /dev/null`\n \n # DETERMINING DATE\n @date = Time.parse log_data[/^Date:\\s+(.+)$/, 1]\n \n # DETERMINING USER\n @user = log_data[/^Author:\\s+(.+)$/, 1]\n \n # DETERMINING DESCRIPTION\n @description = log_data.split(\"\\n\")[4..-1].map {|l| l.strip }.join \"\\n\"\n \n # ALTERED FILES\n @altered_files = `git log -1 #{node} --pretty=oneline --name-only 2> /dev/null`.split(\"\\n\")[1..-1]\n \n # ALL FILES\n # @all_files is also sorted. Hooray!\n @all_files = `git ls-tree -r #{node}`.split(\"\\n\").map do |line|\n # 100644 blob cdbeb2a42b714a4db49293c87fec4e180d07d44f .autotest\n line[/^\\d+ \\w+ \\w+\\s+(.+)$/, 1]\n end\n \n @parsed = true\n end", "title": "" }, { "docid": "f3e5ea9aba26a51ad1e464589970aaa4", "score": "0.5914712", "text": "def tree\r\n @rootNode\r\n end", "title": "" }, { "docid": "2ef425f5fbc970072577afbc08232922", "score": "0.58817726", "text": "def parse(data)\n @children.clear\n data = StringIO.new(data)\n while !data.eof?\n mode = Util.read_bytes_until(data, ' ').to_i(8)\n name = repository.set_encoding Util.read_bytes_until(data, \"\\0\")\n id = repository.set_encoding data.read(20).unpack(\"H*\").first\n @children[name] = Reference.new(:repository => repository, :id => id, :mode => mode)\n end\n end", "title": "" }, { "docid": "4fc9cef05b0bc194fdf4155498b1d445", "score": "0.58743834", "text": "def parse_category_tree\n dry_run_notification\n\n page_html = get_page_html @donor.url\n\n if page_html\n main_category_last = page_html.css('.content > .main-cat').last\n return false if main_category_last.nil?\n main_category_last.css('> .cat-item > .middle').each do |parent_category|\n parent_category_link = get_category_link(parent_category.at_css('a'))\n\n next if parent_category_link[:name].empty? && parent_category_link[:path].empty?\n\n category_parent = save_category(parent_category_link) unless DRY_RUN\n display_category_structure(parent_category_link, \"#{'-' * 80}\\n\")\n\n if parent_category\n parent_category.css('.main-cat > .cat-item > .middle').each do |subcategory_first_level_node|\n subcategory_first_level_link = get_category_link(subcategory_first_level_node.at_css('a'))\n\n subcategory_first_level = save_category(subcategory_first_level_link, category_parent.id) unless DRY_RUN\n display_category_structure(subcategory_first_level_link, ' ' * 2)\n\n subcategory_first_level_node.css('.main-cat > .cat-item > .middle').each do |subcategory_second_level_node|\n subcategory_second_level_link = get_category_link(subcategory_second_level_node.at_css('a'))\n\n save_category(subcategory_second_level_link, subcategory_first_level.id) unless DRY_RUN\n display_category_structure(subcategory_second_level_link, ' ' * 4)\n end\n end\n end\n end\n end\n end", "title": "" }, { "docid": "4c3d5407a00db06ab534bc72a7863c94", "score": "0.5842863", "text": "def build_tree_2(data_array)\n root = nil\n \n data_array.each do |elem|\n node = insert_node(root, nil, elem) \n\troot ||= node\n end\n \n root\nend", "title": "" }, { "docid": "3ec89a42a7f86dbf10080a53270baf84", "score": "0.5841359", "text": "def update_tree(element)\n last_blank = nil\n element.children.map! do |child|\n if child.type == :raw_text\n last_blank = nil\n reset_env(src: ::Kramdown::Utils::StringScanner.new(child.value, element.options[:location]),\n text_type: :text)\n parse_spans(child)\n child.children\n elsif child.type == :eob\n update_attr_with_ial(child.attr, child.options[:ial]) if child.options[:ial]\n []\n elsif child.type == :blank\n if last_blank\n last_blank.value << child.value\n []\n else\n last_blank = child\n child\n end\n else\n last_blank = nil\n update_tree(child)\n update_attr_with_ial(child.attr, child.options[:ial]) if child.options[:ial]\n # DEPRECATED: option auto_id_stripping will be removed in 2.0 because then this will be\n # the default behaviour\n if child.type == :dt || (child.type == :header && @options[:auto_id_stripping])\n update_raw_text(child)\n end\n child\n end\n end.flatten!\n end", "title": "" }, { "docid": "9360e36dea8ff756ad92558e403158dd", "score": "0.57952696", "text": "def create_tree(node, elem, level, parent)\n node.level = level\n elemtype = check_type(elem[1])\n case elemtype\n when \"array\"\n node.kind = \"array\"\n node.arrsize = elem[1][\".array_size\"].to_i\n if elem[1].has_key?(\".subtype\") && elem[1][\".subtype\"].has_key?(\".members\")\n elem[1][\".subtype\"][\".members\"].each do |m|\n x = Tree.new(m[0], item_type(elem[1]), node)\n node.create_child(x)\n create_tree(x, m, level+1, node)\n end\n if elem[1][\".subtype\"].has_key?(\".type_or_id_name\")\n elem[1][\".subtype\"][\".type_or_id_name\"] =~ /\\((.+)\\): (\\w+)/\n node.s_u_name = $2.clone\n else\n node.s_u_name = \"__ANON__\"\n end\n node.basetype = node.data = elem[1][\".subtype\"][\".type\"].clone\n else\n subkind = check_type(elem[1][\".subtype\"])\n case subkind\n when \"enum\"\n node.basetype = \"enum\"\n node.data = {\".type\" => elem[1][\".subtype\"][\".type\"]}\n node.data[\".type_or_id_name\"] = elem[1][\".subtype\"][\".type_or_id_name\"]\n arr = []\n elem[1][\".subtype\"][\".values\"].each { |k,v| arr << [k,v] }\n node.data[\".values\"] = arr.clone\n node.data[\".values\"].sort! { |a,b| a[1] <=> b[1] }\n when \"numeric_ose\", \"boolean\"\n elem[1][\".subtype\"][\".type_or_id_name\"] =~ /\\((.+)\\): (\\w+)/\n node.basetype = $2.clone\n when \"native\", \"numeric_other\"\n node.basetype = \"OTHER\"\n node.data = {\".type\" => elem[1][\".subtype\"][\".type\"]}\n if elem[1][\".subtype\"].has_key?(\".signed\")\n node.data[\".signed\"] = elem[1][\".subtype\"][\".signed\"] \n end\n if elem[1][\".subtype\"].has_key?(\".type_or_id_name\")\n node.data[\".type_or_id_name\"] = elem[1][\".subtype\"][\".type_or_id_name\"]\n end\n end\n node.leaf = true\n end\n when \"struct\", \"union\"\n node.kind = elemtype\n if is_anon?(elem[1])\n node.s_u_name = \"__ANON__\"\n else\n node.s_u_name = item_name(elem[1])\n end\n elem[1][\".members\"].each do |m|\n x = Tree.new(m[0], item_type(elem[1]), node)\n node.create_child(x)\n create_tree(x, m, level+1, node)\n end\n when \"enum\"\n node.kind = \"enum\"\n node.basetype = \"enum\"\n node.s_u_name = item_name(elem[1])\n node.parent = parent\n node.leaf = true\n arr = []\n elem[1][\".values\"].each { |k,v| arr << [k,v] }\n node.data = arr.clone\n node.data.sort! { |a,b| a[1] <=> b[1] }\n when \"numeric_ose\"\n node.kind = \"numeric\"\n node.basetype = item_name(elem[1])\n node.parent = parent\n node.leaf = true\n when \"boolean\"\n node.kind = \"boolean\"\n node.basetype = item_name(elem[1])\n node.parent = parent\n node.leaf = true\n when \"native\", \"numeric_other\"\n node.kind = \"numeric\"\n node.basetype = \"OTHER\"\n node.data = {'.type' => elem[1][\".type\"]}\n node.data[\".signed\"] = elem[1][\".signed\"] if elem[1].has_key?(\".signed\")\n if elem[1].has_key?(\".type_or_id_name\")\n node.data[\".type_or_id_name\"] = elem[1][\".type_or_id_name\"]\n end\n node.parent = parent\n node.leaf = true\n else\n raise \"Node #{node.name} contains erroneous data\" \n end\n end", "title": "" }, { "docid": "ed657495940fe6d6285f5c7c207b6a3f", "score": "0.57881427", "text": "def parse_tag_to_tree(html_str)\n node = Struct.new(:type, :classes, :id, :name, :text_content, :children, :parents)\n parser = node.new\n parser.type = html_str.scan(/<[a-z0-9]+/)[0][1..-1] if html_str[0] != \" \"\n parser.classes = html_str.scan(/class='(.*?)'/).join.split(\" \")\n parser.id = html_str.scan(/id='(.*?)'/).join\n parser.name = html_str.scan(/name='(.*?)'/).join\n parser.children = []\n parser.parents = nil\n parser\nend", "title": "" }, { "docid": "8fc0cbc16ac0a37ed88d198de120c911", "score": "0.57618445", "text": "def tree\n while token = @tokens.next\n case token.type\n when :operator\n token.build(@nodes.pop, tree).tap do |node|\n @nodes.push(node)\n end\n when :value\n token.build.tap do |leaf|\n @nodes.push(leaf)\n end\n end\n end\n rescue StopIteration\n @nodes.last || Lexeme::Null.new\n end", "title": "" }, { "docid": "32644267f56ed563e4a94891c54e9f8b", "score": "0.5736063", "text": "def parse_category_tree\n dry_run_notification\n\n page_html = get_page_html \"#{@donor.url}/mall/index.htm\"\n return display_error \"\\e[33;1m#{self.class}##{__method__}\\e[0m failed to get page html\" if page_html.blank?\n\n page_html.css('#headerWarp .cateAllList ul li').each do |menu_item|\n category_link_level_1 = get_link menu_item.at_css('dt a')\n category_level_1 = save_category(category_link_level_1) unless DRY_RUN\n display_category_structure category_link_level_1, \"#{'-' * 80}\\n\"\n\n menu_item.css('dd a').each do |menu_sub_item|\n category_link_level_2 = get_link menu_sub_item\n save_category(category_link_level_2, category_level_1.id) unless DRY_RUN\n display_category_structure category_link_level_2, ' '\n end\n end\n end", "title": "" }, { "docid": "e61d0db41d9e31424892316a38e5aa05", "score": "0.57241726", "text": "def tree=(data)\n @tree = HashWithIndifferentAccess.new(\n case data\n when Array\n hash_from_git(data)\n when Hash, HashWithIndifferentAccess\n data\n end\n )\n end", "title": "" }, { "docid": "9c17ef1165a46c9f1503492e5a8d4d06", "score": "0.57086605", "text": "def is_valid_tree(tree)\n\nend", "title": "" }, { "docid": "e3ccb2dfc08a53f1ce8d12902c31119a", "score": "0.5694128", "text": "def parse_text(text)\n\t\tNode.destroy_all(work_id: self.id)\n\t\tLink.destroy_all(work_id: self.id)\n\t\tLinkCollection.destroy_all(work_id: self.id)\n\n\t\tstack = Array.new\n\t\tnew_ordering= []\n\t\tlink_colls_queue = []\n\t\ttext.each_line do |line|\n\t\t\t#parser rules: any amount of whitespace followed immediately by < means new node. Otherwise, new note.\n\t\t\t#<TYPE.CATEGORY>TITLE\n\t\t\t#if the occurence of <*> is before the first occurence of \" then it's a new\n\t\t\t#@angleBracketLocation = line.index(/[ ,\\t]*<.*>/)\n\t\t\n\t\t\tfirst_char = get_text_from_regexp(line, /[ ,\\t]*(.)/)\n\t\t\n\t\t\t#if a new node should be made\n\t\t\tif first_char == '.'\n\t\t\t\tnew_node = Node.new\n\t\t\t\tbuild_node(new_node, line)\n\t\t\t\tnew_node.save\n\n\t\t\t\t#get the parent.\n\t\t\t\tdepth = new_node.depth\n\n\t\t\t\tnewNodeDepth = NodeDepth.new(new_node.id, depth)\n\t\t\t\t\n\t\t\t\tif depth == 0 #if it's a base element\n\t\t\t\t\tstack.push(newNodeDepth)\n\t\t\t\telse\n\t\t\t\t\tcurrNodeDepth = stack.pop\n\t\t\t\t\twhile depth <= currNodeDepth.depth do #while you're less deep, therefore it aint yo momma \n\t\t\t\t\t\tcurrNodeDepth = stack.pop\n\t\t\t\t\tend #at this point, @currNodeDepth is the nearest element that's not as deep as the new one, it's parent\n\t\t\t\t\tparentNode = Node.find(currNodeDepth.node_idnum)\n\t\t\t\t\tif parentNode.id == new_node.id #if it didn't find any parent\n\t\t\t\t\t\tparent_id = nil\n\t\t\t\t\telse\n\t\t\t\t\t\tparent_id = parentNode.id\n\t\t\t\t\tend\n\n\t\t\t\t\t#creates the link, and the sets the parent and child relation\n\t\t\t\t\trelation = Link.new(child_id: new_node.id, parent_id: parent_id, work_id: self.id)\n\t\t\t\t\trelation.save\n\t\t\t\t\tnew_node.parent_relationships << relation\n\t\t\t\t\tparentNode.child_relationships << relation\n\n\t\t\t\t\tstack.push(currNodeDepth)#push the parent back in, in case it has siblings\n\t\t\t\t\tstack.push(newNodeDepth)#push self in, in case it has children\n\n\t\t\t\t\t#@new_node.parent_relationships.build(child_id: @new_node.id, parent_id:@parentNode.id)\n\t\t\t\t\t#@new_node.parents << @parentNode\n\t\t\t\t\t#@parent_node.child=\n\t\t\t\t\t#make this nodes id into the parents child.\n\t\t\t\t\t#make the child's parent the parentNode's id.\n\t\t\t\tend\n\t\t\t\tnew_node.save\n\t\t\t\tnew_ordering.push(ObjectPlace.new(\"Node\", new_node.id))\n\n\t\t\t#if it's a note\n\t\t\telsif first_char == '-'\n\t\t\t\tnew_note = Note.new()\n\t\t\t\tbuild_note(new_note, line)\n\n\t\t\t\t#this is a bug. it just gets attached to the previous node without regard for depth\n\t\t\t\t#binding.pry\n\t\t\t\tif (new_note.depth != 0 && !stack.empty?) #if it could have a parent and there are possibilities\n\n\t\t\t\t\tcurrNodeDepth = stack.pop\n\t\t\t\t\twhile new_note.depth <= currNodeDepth.depth do #while you're less deep, therefore it aint yo momma \n\t\t\t\t\t\tcurrNodeDepth = stack.pop\n\t\t\t\t\tend #at this point, @currNodeDepth is the nearest element that's not as deep as the new one, it's parent\n\t\t\t\t\tparentNode = Node.find(currNodeDepth.node_idnum)\n\t\t\t\t\tstack.push(currNodeDepth)\n\t\t\t\t\n\t\t\t\t\tnew_note.node_id = parentNode.id\n\t\t\t\t\t#parentNode.add_note_to_combined(new_note)\n\t\t\t\tend\n\t\t\t\tnew_note.save\n\t\t\t\tnew_ordering.push(ObjectPlace.new(\"Note\", new_note.id))\t\t\t\t\n\t\t\t#for special chars\n\t\t\telsif first_char == ':'\n\n\t\t\t\t#ordering.insert(line_number, ObjectPlace.new(\"LinkCollection\", nil))\n\t\t\t\t#set_order(ordering)\n\t\t\t\t#parent_node = find_element_parent(link_coll_depth, line_number, ordering)\n\n\t\t\t\twhitespace = get_text_from_regexp(text, /(.*):/)\n\t\t\t\tlink_coll_depth = (whitespace.length)/3 #+2?\n\t\t\t\tparentNode = nil\n\t\t\t\tif (link_coll_depth != 0 && !stack.empty?) #if it could have a parent and there are possibilities\n\n\t\t\t\t\tcurrNodeDepth = stack.pop\n\t\t\t\t\twhile link_coll_depth <= currNodeDepth.depth do #while you're less deep, therefore it aint yo momma \n\t\t\t\t\t\tcurrNodeDepth = stack.pop\n\t\t\t\t\tend #at this point, @currNodeDepth is the nearest element that's not as deep as the new one, it's parent\n\t\t\t\t\tparentNode = Node.find(currNodeDepth.node_idnum)\n\t\t\t\t\tstack.push(currNodeDepth)\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tlink_coll = self.link_collections.build\n\t\t\t\tbuild_link_collection(link_coll, line, parentNode)\t\n\t\t\t\tlink_colls_queue.append({link_coll: link_coll, text: get_text_from_regexp(line, /:(.*)/)})\n\t\t\t\t#binding.pry\n\t\t\t\tnew_ordering.push(ObjectPlace.new(\"LinkCollection\", link_coll.id))\n\t\t\telse\n\t\t\t\tplace_holder = work.place_holders.create(text:line_content)\n\t\t\t\tnew_ordering.push(ObjectPlace.new(\"PlaceHolder\", place_holder.id))\n\t\t\tend\n\t\tend\n\n\t\tset_order(new_ordering)\n\t\t#at the end, build those links (appending the newly made nodes if needed.) This way, all nodes are mode before it thinks\n\t\t#it needs to be doing this shit\n\t\tlink_colls_queue.each do |link_coll_pair|\n\t\t\t#build its child links\n\t\t\tlink_coll_pair[:link_coll].set_links(link_coll_pair[:text])\n\t\tend\n\n\t\t#should fix this so I can get rid of populate_ordering, only works here because things are produced in order, can do it as I go\n\t\t#o = populate_ordering\n\tend", "title": "" }, { "docid": "59003537cf0d6abc8d0d3cb9ec67aa1b", "score": "0.5679293", "text": "def build_tree(data_array)\n root = nil\n \n data_array.each do |elem|\n cur_node = root\n \n node = Node.new(elem)\n\tnode.children = Array.new(2, nil)\n\t\n\twhile !cur_node.nil?\n\t if elem < cur_node.value\n\t if cur_node.children[0].nil?\n\t\t node.parent = cur_node\n\t\t cur_node.children[0] = node\n\t\t cur_node = node\n\t\tend\n\t\tcur_node = cur_node.children[0]\n\t else\n\t if cur_node.children[1].nil?\n\t\t node.parent = cur_node\n\t\t cur_node.children[1] = node\n\t\t cur_node = node\n\t\tend\n\t\tcur_node = cur_node.children[1]\n\t end\n\tend\n\t\n\troot ||= node\n\t \n end\n \n root\nend", "title": "" }, { "docid": "a0797dd929de743a7de8737a71136915", "score": "0.56644535", "text": "def test_tree_representation\n e =\n'ROOT (0.94)\n outlook => rainy (0.694)\n windy => TRUE (0.0)\n play => no (0.0)\n windy => FALSE (0.0)\n play => yes (0.0)\n outlook => overcast (0.694)\n play => yes (0.0)\n outlook => sunny (0.694)\n humidity => normal (0.0)\n play => yes (0.0)\n humidity => high (0.0)\n play => no (0.0)\n'\n assert_equal e, @tree.to_s\n end", "title": "" }, { "docid": "0ab4762ebede3a6ba6714150b5a2269a", "score": "0.56509775", "text": "def array_tree\n return @array_tree if @array_tree\n @description.strip!\n #@description.gsub!(/[^\\s()]+/, '\"\\0\"')\n @description.gsub!(/[^\\s()]+/) {|w| '\"'+w.gsub('\"', '\\'')+'\"'}\n @description.gsub!('(', '[')\n @description.gsub!(')', ']')\n @description.gsub!(/\\s+/,\" \")\n @description.gsub!(' ', ', ')\n @description.gsub!('\\\\', '\\\\\\\\\\\\')\n begin\n @array_tree = eval(@description) # TODO safety level\n rescue Exception => ex\n puts \"Error while parsing:\\n#{@description}\"\n end\n @array_tree\n end", "title": "" }, { "docid": "f8589ffc837b6ad4f3df310511bced39", "score": "0.56478375", "text": "def parse_tree(records)\n\n # build tree, should return a file_header node\n first, *records = *records\n unless first.code == :file_header\n raise ParseError.new('Expecting file header record (01).')\n end\n root = ParseNode.new(first)\n stack = [root]\n\n records.each do |record|\n raise ParseError.new('Unexpected record.') if stack.empty?\n\n case record.code\n\n # handling headers\n when :group_header, :account_identifier\n\n parent = {group_header: :file_header,\n account_identifier: :group_header}[record.code]\n unless stack.last.code == parent\n raise ParseError.new(\"Parsing #{record.code}, expecting #{parent} parent.\")\n end\n\n n = ParseNode.new(record)\n stack.last.children << n\n stack << n\n\n # handling trailers\n when :account_trailer, :group_trailer, :file_trailer\n\n parent = {account_trailer: :account_identifier,\n group_trailer: :group_header,\n file_trailer: :file_header}[record.code]\n unless stack.last.code == parent\n raise ParseError.new(\"Parsing #{record.code}, expecting #{parent} parent.\")\n end\n\n stack.last.records << record\n stack.pop\n\n # handling continuations\n when :continuation\n\n n = (stack.last.children.last || stack.last)\n n.records << record\n\n # handling transactions\n when :transaction_detail\n\n unless stack.last.code == :account_identifier\n raise ParseError.new(\"Parsing #{record.code}, expecting account_identifier parent.\")\n end\n\n stack.last.children << ParseNode.new(record)\n\n # handling special known errors\n else # nil\n raise ParseError.new('Unknown or unexpected record code.')\n end\n end\n\n unless stack == []\n raise ParseError.new('Reached unexpected end of input (EOF).')\n end\n\n # root now contains our parsed tree\n root\n end", "title": "" }, { "docid": "6178160f16a04f7194b8a3e453a198a1", "score": "0.56428546", "text": "def build_tree(arr)\n @root = Node.new(arr.shift)\n arr.each { |data| insert_data(data, @root) }\n end", "title": "" }, { "docid": "c6686f2c4b13da35e9e4a98eca5a5bb1", "score": "0.56308603", "text": "def tree\n\n h.updated_tree || h.original_tree\n end", "title": "" }, { "docid": "0e5ff04e552a63abc20a8e21b0ec30f7", "score": "0.56283176", "text": "def handle_tree_command(text, bot)\n parsed_all_options = false\n rest = text\n run_command = 'tree 1 --hiddencompleted'\n until parsed_all_options\n arg, rest = rest.split(' ', 2)\n case arg\n when 'depth'\n # get num\n depth, rest = rest.split(' ', 2)\n bot.logger.info(depth)\n # replace because we ignore the standard 1\n run_command = run_command.gsub(/tree 1/, \"tree #{depth}\")\n when 'ids'\n run_command += ' --withid'\n when 'notes'\n run_command += ' --withnote'\n when 'completed'\n run_command = run_command.sub(' --hiddencompleted', '')\n else\n parsed_all_options = true\n # rejoin\n rest = (arg || '') + ' ' + (rest || '')\n end\n end\n\n return call_wf(run_command, bot) if rest == 'root'\n\n call_wf(\"#{run_command} --id=#{rest}\", bot)\nend", "title": "" }, { "docid": "28875285c230724f077d78427334ecfe", "score": "0.56279933", "text": "def parse_category_tree\n dry_run_notification\n sub_menu_url = \"#{donor_domain}/web/index.php/home/data_sub_menu\"\n page_html = get_page_html \"#{donor_domain}/web/\"\n page_html.css('#menu_ul li').each do |parent_category|\n parent_category_id = parent_category[:source3]\n next if parent_category_id.blank?\n\n # Get sub menu html by category id\n sub_menu_page_html = get_page_html(sub_menu_url, :post, { cat_id: parent_category_id })\n\n next if sub_menu_page_html.blank?\n\n parent_category_link = get_link sub_menu_page_html.at_css('a')\n\n # Parent category name en/th language versions separated by \"/\"\n parent_category_link[:name] = parent_category_link[:name].split(' / ')[('en' == @lang) ? 0 : 1]\n category_parent = save_category(parent_category_link) unless DRY_RUN\n display_category_structure(parent_category_link, \"#{'-' * 80}\\n\")\n\n sub_menu_page_html.css('.inner > ul > li').each do |subcategory_first_level_node|\n subcategory_first_level_link_node = subcategory_first_level_node.at_css('.a_header')\n subcategory_first_level_link = get_link(subcategory_first_level_link_node)\n # Name convert notes:\n # 1. Get raw link html with inner_html() in order to get en/th language versions separated by \"<br>\"\n # 2. Method content() convert html entities to characters: &Amp; --> &, &#3650;&#3607; --> โท\n # 3. Converting methods order: squish() must be the last operation, otherwise spaces left\n subcategory_first_level_link[:name] = get_name(\n Nokogiri::HTML.fragment subcategory_first_level_link_node.inner_html.split('<br>')[('en' == @lang) ? 0 : 1]\n )\n subcategory_first_level = save_category(subcategory_first_level_link, category_parent.id) unless DRY_RUN\n display_category_structure(subcategory_first_level_link, ' ' * 2)\n\n subcategory_first_level_node.css('.sub_menu a').each do |subcategory_second_level_node|\n subcategory_second_level_link = get_link(subcategory_second_level_node)\n save_category(subcategory_second_level_link, subcategory_first_level.id) unless DRY_RUN\n display_category_structure(subcategory_second_level_link, ' ' * 4)\n end\n end\n end if page_html\n end", "title": "" }, { "docid": "6cfa21c5957acce5df83b9eae9999a43", "score": "0.5590464", "text": "def initialize(hsh, opener, content = nil)\n if content\n @hash_id, @opener = hsh, opener\n @type = 'tree'\n @content = content\n else\n super(hsh, opener)\n end\n parse!\n end", "title": "" }, { "docid": "b7c5aaa74944055b7b61661108c7a627", "score": "0.55839723", "text": "def populate(array)\n @root = Node.new({type: :document}, [], nil, 0)\n @total_nodes += 1\n @max_depth = 0\n current_node = @root\n current_depth = 0\n array.each do |hash|\n # opening tag - create new node\n if NODE_DOWN.include? hash[:type]\n #if <> depth += 1\n new_node = Node.new(hash, [], current_node, current_node.depth + 1)\n current_node.children << new_node\n current_node = new_node\n current_depth += 1\n @total_nodes += 1\n else #hash[:type] == \"close\"\n #if </> depth -= 1\n new_node = Node.new(hash, [], current_node, current_node.depth)\n current_node.children << new_node\n current_node = current_node.parent\n current_depth -= 1\n @total_nodes += 1\n end\n\n if current_depth > @max_depth\n @max_depth = current_depth\n end\n\n if hash[:type] == :text && current_node.children.empty?\n current_depth -= 1\n current_node = current_node.parent\n end\n end\n self\n end", "title": "" }, { "docid": "b1a9f92fcbe2bf331b71b9e64dc611dd", "score": "0.5568819", "text": "def tree_params\n params.require(:tree).permit(:name, :data, :root_uri)\n end", "title": "" }, { "docid": "88f8d4d8c018c5bea6ede72d2d371bb2", "score": "0.5565838", "text": "def java_tree_to_arrays(tree)\n # label just has to be unique. don't think we're using it for anything\n label = tree.label.value + '-' + tree.object_id.to_s\n root = Tree::TreeNode.new(label, tree.label.value)\n tree.children.each{|x|root << java_tree_to_arrays(x)}\n root\n end", "title": "" }, { "docid": "271f3a8fb5cd14ee464813219c586d86", "score": "0.5564269", "text": "def tree\n\n @definition = Definition.find(params[:id])\n\n uri = @definition.local_uri\n\n # TODO : reject outside definitions ?\n\n pdef = open(uri).read\n\n var = params[:var] || 'proc_tree'\n\n # TODO : use Rails callback thing (:callback)\n\n tree = RuotePlugin.ruote_engine.get_def_parser.parse(pdef)\n\n render(\n :text => \"var #{var} = #{tree.to_json};\",\n :content_type => 'text/javascript')\n end", "title": "" }, { "docid": "e065c1526817034a7667305b07aab082", "score": "0.5563852", "text": "def code_tree\n kids = j_instance.getChildren\n\n kids.each_with_object([]) do |kid, acc|\n data = { type: kid.getType, parent_type: j_instance.getType, token: kid.toString }\n subtree = self.class.new(kid).code_tree\n data[:children] = subtree unless subtree.empty?\n acc << data\n end\n end", "title": "" }, { "docid": "0a8953822d58d20b93bba59d4a06ada4", "score": "0.5561249", "text": "def ascii_tree; end", "title": "" }, { "docid": "110f29e4f40061ba0380d75fe25e8c1e", "score": "0.5558416", "text": "def tree\n h.updated_tree || h.original_tree\n end", "title": "" }, { "docid": "e79125fd6f1f768e2947928b4751ffdd", "score": "0.5549476", "text": "def build_tree(data, par_node)\n return nil if data.empty?\n \n if @node.value <= par_node.value\n if par_node.left == nil\n par_node.left = @node\n else\n build_tree(data, par_node.left)\n end\n else\n if par_node.right == nil\n par_node.right = @node\n else\n build_tree(data, par_node.right)\n end\n end\n\n @node = Node.new(data.shift)\n build_tree(data, @root)\n end", "title": "" }, { "docid": "9c8c55bcfcfb503c6844fd24fcfa090a", "score": "0.5547173", "text": "def build_tree(arr)\n @root = insert_node(nil, arr.shift)\n arr.each { |value| insert_node(@root, value) }\n end", "title": "" }, { "docid": "110b79e4e80f8056dd25d2c40484c36b", "score": "0.55410665", "text": "def process_child_nodes(node); end", "title": "" }, { "docid": "82a1e73ff1786a607b6604efb9814c40", "score": "0.55406946", "text": "def tree_nodes\n node_sets = completed_list.map.with_index do |item_set, index|\n item_set.map do |item|\n exclusive_index_at_which_substring_ends = index\n ParseForest::Node.new(item.production,\n item.position, \n exclusive_index_at_which_substring_ends)\n end\n end\n node_sets.flatten\n end", "title": "" }, { "docid": "032c6006c271ba0803607944fe80f7be", "score": "0.55358416", "text": "def valid_tree?\n true\n end", "title": "" }, { "docid": "032c6006c271ba0803607944fe80f7be", "score": "0.55358416", "text": "def valid_tree?\n true\n end", "title": "" }, { "docid": "1104f78a4a66b61b60cf65330774d35b", "score": "0.5525587", "text": "def build_struct_tree data\n data.to_hashugar\n end", "title": "" }, { "docid": "ddd3df8af0482ba236e7c7aedf68ef5e", "score": "0.55241114", "text": "def create_tree(items, rootpage)\n _, tree = visit_nodes(items, rootpage.lft + 1, rootpage.id, rootpage.depth + 1, {}, \"\", rootpage.restricted)\n tree\n end", "title": "" }, { "docid": "d6a257211c673242c33432d81ff5c3ca", "score": "0.5519003", "text": "def create\n \t@tree = current_user.trees.build(tree_params)\n \tupload\n \t@tree.created_at = Time.now\n \t@tree.name = @tree.file.original_filename\n \trespond_to do |format|\n \t\tif @tree.save\n\t\t \tnodes = Node.new\n \t \t\tvariaveis = nodes.extract_variables(@nome_arquivo,@numero_da_linha[:numero_de_variaveis]+1,@numero_da_linha[:test_mode]-1)\n \t \t\tnodes.extract_tree(@nome_arquivo,@numero_da_linha[:classifier_model]+5,@numero_da_linha[:numero_de_folhas]-2,variaveis,@tree.id)\n\t\t\t### adicionar a migracao que tira o autoincremt da buceta da tabela de nodes\n\t\t\t### adicionar um numero prefixo que não vá dar problema e resa muleke\n\t\t\ti= 0\n \t\t\tformat.html { redirect_to @tree, notice: 'Arquivo Adicionado com sucesso.' }\n \t\t\tformat.json { render :show, status: :created, location: @tree }\n \t\telse\n \t\t\tformat.html { render :new }\n \t\t\tformat.json { render json: @tree.errors, status: :unprocessable_entity }\n \t\tend\n \tend\n end", "title": "" }, { "docid": "35c62bf83a8df45c3e2010b9f0132fc2", "score": "0.5514772", "text": "def build_tree_unsorted(arr)\n root = nil\n arr.each do |item|\n root = insert_tree(item, root)\n end\n\n root\nend", "title": "" }, { "docid": "76bef116d9df8659eb7b87a3174372eb", "score": "0.5503814", "text": "def parse_tree(task, silent=false)\n\t\treturn if ![:definitions, :anchors, :annotations].include? task\n\t\tActiveRecord::Base.logger.level = 1 if silent\n\t\tcase task\n\t\t\twhen :definitions\n\t\t\t\ttask = :parse_definitions\n\t\t\twhen :anchors\n\t\t\t\ttask = :parse_anchors\n\t\t\twhen :annotations\n\t\t\t\ttask = :recalculate_annotations\n\t\tend\n\t\tcurrent = self.containers.roots.first\n\t\twhile current\n\t\t\tcurrent.send(task)\n\t\t\tcurrent=current.next_container\n\t\tend\n\t\tActiveRecord::Base.logger.level = 0\n\tend", "title": "" }, { "docid": "355cd4d8b1efebabf783bee84285d09a", "score": "0.5502948", "text": "def test_nested_ordered_list_incorrect\n assert_nothing_raised do\n parser = Juli::Parser.new\n parser.parse(data_path('t005.txt'), Juli::Visitor::Tree.new)\n end\n end", "title": "" }, { "docid": "1ecbda036e96979817c058e1cc167303", "score": "0.54982585", "text": "def fetch_tree(klass, name, node_id = nil)\n tree = klass.new(name, {}, false)\n\n # FIXME: maybe here we would need instance_exec/eval instead\n yield(tree) if block_given?\n\n tree.reload!\n\n if node_id\n tree.x_get_child_nodes(node_id).to_json\n else\n tree.instance_variable_get(:@bs_tree)\n end\n end", "title": "" }, { "docid": "dea3e27a17a44dbac20a10749960aaaf", "score": "0.5490451", "text": "def build_tree(tree_size, input)\n nodes = Array.new(tree_size) { Node.new(nil, nil, nil) }\n\n tree_size.times do |i|\n line = input.next\n val, left, right = line.chomp.split.map(&:to_i)\n nodes[i].val = val\n nodes[i].left = nodes[left] unless left == -1\n nodes[i].right = nodes[right] unless right == -1\n end\n \n nodes.first\nend", "title": "" }, { "docid": "857e676529dd501d8d9401d6b5cb3d6f", "score": "0.54859024", "text": "def parse(parse_info)\r\n save = parse_info.try\r\n\r\n @children.each do |child|\r\n return parse_info.reject(save) unless child.parse(parse_info)\r\n end\r\n\r\n parse_info.accept\r\n end", "title": "" }, { "docid": "4e2d1e2abd1ae15a9007f0bf96ecaded", "score": "0.5450344", "text": "def tree_params\n params.require(:tree).permit(:tree, :row, :planting_date, :pullout_date, :rootstock, :oldcode, :oldaccessioncode, :oldcollectioncode, :block_id)\n end", "title": "" }, { "docid": "a27bed7962f29ac2ca54be8c7d5c9219", "score": "0.5441356", "text": "def fetch_tree(node_uri)\n response = JSONModel::HTTP::get_json(\"/search/published_tree\", :node_uri => node_uri)\n\n Rails.logger.debug(response.inspect)\n return nil unless response and response.has_key?('tree_json')\n tree = ASUtils.json_parse(response['tree_json'])\n end", "title": "" }, { "docid": "7e50090c4cf5b58f34b5e4806d5b8692", "score": "0.5439583", "text": "def to_tree() = puts(TTY::Tree.new({ '.' => as_tree }).render)", "title": "" }, { "docid": "4f378ca0ae7f8ec8df9e7553a4c46cd3", "score": "0.5436064", "text": "def parse!\n return if @parsed\n \n log_data = `git log -1 HEAD 2> /dev/null`\n \n unless log_data.empty?\n # DETERMINING PARENTS\n commit = log_data[/^commit (.+)$/, 1]\n dad = commit ? commit[0..6] : nil\n mom = nil\n \n if log_data =~ /^Merge: (.+)\\.\\.\\. (.+)\\.\\.\\.$/ # Merge: 1c002dd... 35cfb2b...\n dad = $1 # just have them both use the short name, nbd\n mom = $2\n end\n \n @parents = [dad, mom].compact.map {|p| Changeset.new @repo, p }\n else\n @parents = []\n end\n @parsed = true\n end", "title": "" }, { "docid": "9698b861f216d132455c71ad8ea2698c", "score": "0.5431899", "text": "def build_tree(array)\n\t\t@root = Node.new(array[0])\n\t\ttemp_root = @root\n\n\t\tarray[1..-1].each do |node_value|\n\t\t\tinsert_node(node_value, temp_root)\n\t\tend\n\tend", "title": "" }, { "docid": "7645d651c28d79e71b34feee5508134e", "score": "0.54297394", "text": "def build_tree(array)\n\t\t@root = Node.new(array.shift)\n\t\tarray.each { |value| add_node(value, @root)}\n\tend", "title": "" }, { "docid": "e6f18d7a89000885f0c8f885faa30aeb", "score": "0.5422676", "text": "def build_tree(arr)\n #arr.shuffle!\n arr.each do |x|\n if @root == nil\n @root = Node.new(x)\n else\n current_node = @root\n until current_node == nil\n if x < current_node.value\n parent = current_node\n direction = \"left\"\n current_node = current_node.left_child\n elsif x > current_node.value\n parent = current_node\n direction = \"right\"\n current_node = current_node.right_child\n end\n end\n if direction == \"left\"\n parent.left_child = Node.new(x)\n elsif direction == \"right\"\n parent.right_child = Node.new(x)\n end\n end\n end\n end", "title": "" }, { "docid": "f7c538ca8544e8fb73aad24ea7edef99", "score": "0.54076666", "text": "def valid_tree?\n false\n end", "title": "" }, { "docid": "bf6cc111a9a79e42b655fee161db6bc9", "score": "0.53956765", "text": "def from_node(node); end", "title": "" }, { "docid": "6a96af8e896a3c63b7feb0c4f1768f30", "score": "0.5393988", "text": "def parse(filename)\n file = File.open(filename, \"r\").readlines\n\n $root = Node.new('root')\n $context = $root\n\n file.each_with_index do |line, index|\n process_line(line, index) if line.match(/\\S/)\n end\n\n return $root\n\nend", "title": "" }, { "docid": "624cce10ac5131c00b8c5eda1c21f7d2", "score": "0.5389143", "text": "def navtree_build(ret, item, el, el_type = \"\")\n module_name = item[:classnames][2] ? item[:classnames][2] : item[:classnames][1];\n page_name = item[:crumb]\n\n if !ret[module_name]\n ret[module_name] = {:id => module_name, :children => Hash.new}\n #if item[:deprecated] ret[module_name][:deprecated] = true\n end\n\n if !ret[module_name][:children][page_name]\n ret[module_name][:children][page_name] = {\n :id => page_name,\n :path => item.identifier,\n :children => Hash.new\n }\n #if item[:deprecated] ret[module_name][:deprecated] = true\n end\n\n el_name = el.respond_to?(:name) ? el.name : el\n ret[module_name][:children][page_name][:children][el_name] = {\n :signature => el.respond_to?(:sass_signature) ? el.sass_signature(:none) : el,\n :el_type => el_type\n }\n\n ret\nend", "title": "" }, { "docid": "eb7313ce0c3804acc20c7e40c4f98c47", "score": "0.5385866", "text": "def tokens_to_tree\n\n tag_stack = [ ] # stack for element tags\n children_stack = [ ] # stack for lists of children\n children = [ ] # current list of children\n err_count = 0\n\n # Note: the text token pattern test assumes that all text tokens\n # are non-empty. This should be true, because REX doesn't create\n # empty tokens.\n\n @tokens.each_index do |i|\n token = @tokens[i]\n line_num = @line_num[i]\n tok_err = \"Error near line #{line_num}, token #{i+1} (#{token})\"\n case token\n when /\\A[^<]/ # text\n children << text_node(token)\n when /\\A<!--/ # comment\n children << comment_node(token)\n when /\\A<\\?/ # processing instruction\n children << pi_node(token)\n when /\\A<!DOCTYPE/ # DOCTYPE\n children << doctype_node(token)\n when /\\A<!\\[/ # CDATA\n children << cdata_node(token)\n when /\\A<\\// # element close tag\n if tag_stack.empty?\n warn \"#{tok_err}: Close tag w/o preceding open tag; malformed document?\\n\"\n err_count += 1\n next\n end\n if children_stack.empty?\n warn \"#{tok_err}: Empty children stack; malformed document?\\n\"\n err_count += 1\n next\n end\n tag = tag_stack.pop\n open_tag_name = extract_tag_name(tag)\n close_tag_name = extract_tag_name(token)\n if open_tag_name != close_tag_name\n warn \"#{tok_err}: Tag mismatch; malformed document?\\n\"\n warn \" open tag: #{tag}\\n\"\n warn \" close tag: #{token}\\n\"\n print_tag_stack(\"enclosing tags\", tag_stack)\n err_count += 1\n next\n end\n elt = element_node(tag, token, children)\n children = children_stack.pop\n children << elt\n else # element open tag\n # If we reach here, we're seeing the open tag for an element:\n # - If the tag is also the close tag (e.g., <abc/>), close the\n # element immediately, giving it an empty child list.\n # - Otherwise, push tag and child list on stacks, begin new child\n # list for element body.\n case token\n when /\\/>\\Z/ # tag is of form <abc/>\n children << element_node(token, \"\", [ ])\n else # tag is of form <abc>\n tag_stack << token\n children_stack << children\n children = [ ]\n end\n end\n end\n\n # At this point, the stacks should be empty if the document is\n # well-formed.\n\n if !tag_stack.empty?\n warn \"Error at EOF: Unclosed tags; malformed document?\\n\"\n print_tag_stack(\"unclosed tags\", tag_stack)\n err_count += 1\n end\n if !children_stack.empty?\n warn \"Error at EOF: Unprocessed child elements; malformed document?\\n\"\n# TODO: print out info about them\n err_count += 1\n end\n\n @tree = children\n return err_count\n end", "title": "" }, { "docid": "01daba885a7d3448c4b1e505337630eb", "score": "0.53848016", "text": "def test_tree_parser_rewrite_flat_list\n grammar = \"grammar T;\\n\" + \"options {output=AST;}\\n\" + \"a : ID INT;\\n\" + \"ID : 'a'..'z'+ ;\\n\" + \"INT : '0'..'9'+;\\n\" + \"WS : (' '|'\\\\n') {$channel=HIDDEN;} ;\\n\"\n tree_grammar = \"tree grammar TP;\\n\" + \"options {output=AST; ASTLabelType=CommonTree; tokenVocab=T;}\\n\" + \"@members {\\n\" + \"static class V extends CommonTree {\\n\" + \" public V(Object t) { super((CommonTree)t); }\\n\" + \" public String toString() { return token.getText()+\\\"<V>\\\";}\\n\" + \"}\\n\" + \"static class W extends CommonTree {\\n\" + \" public W(Object t) { super((CommonTree)t); }\\n\" + \" public String toString() { return token.getText()+\\\"<W>\\\";}\\n\" + \"}\\n\" + \"}\\n\" + \"a : ID INT -> INT<V> ID<W>\\n\" + \" ;\\n\"\n found = exec_tree_parser(\"T.g\", grammar, \"TParser\", \"TP.g\", tree_grammar, \"TP\", \"TLexer\", \"a\", \"a\", \"abc 34\")\n assert_equals(\"34<V> abc<W>\\n\", found)\n end", "title": "" }, { "docid": "b5502129925c0e2b656e6b5eeed74d89", "score": "0.53702927", "text": "def make_tree(in_list, pid = self.pid)\n [].tap do |top_level|\n left_over = []\n # Categorize into top level, or not top level\n in_list.each do |node|\n if node['parent_page_id'].blank? || node['parent_page_id'] == pid\n top_level.unshift node\n else\n left_over.unshift node\n end\n end\n\n # For each of the top_level nodes make a subtree with the leftovers.\n top_level.each do |node|\n node['children'] = make_tree(left_over, node['id'])\n end\n end\n end", "title": "" }, { "docid": "ca76b3379f90aa2bb6a7f7bf4e1b367d", "score": "0.5367609", "text": "def parse(less)\n error, tree = nil, nil\n Less::JavaScript.exec do\n @parser.parse(less, lambda { |*args| # (error, tree)\n # v8 >= 0.10 passes this as first arg :\n if args.size > 2\n error, tree = args[-2], args[-1]\n elsif args.last.respond_to?(:message) && args.last.message\n # might get invoked as callback(error)\n error = args.last\n else\n error, tree = *args\n end\n fail error.message unless error.nil?\n })\n end\n Tree.new(tree) if tree\n end", "title": "" }, { "docid": "e06ef60851d9f54f557004edbba4f25e", "score": "0.5356814", "text": "def trees_to_html(trees)\nend", "title": "" }, { "docid": "926cab6b738d009b27e2dc970c204af2", "score": "0.5349421", "text": "def build_tree(data_array)\n @root = nil # overwrites tree, even if array is empty\n data_array.each_with_index do |data, index|\n if index == 0\n @root = Node.new(data)\n else\n set_next_node(data)\n end\n end\n end", "title": "" }, { "docid": "903cb70de7a1d9288350a8a347f3a67a", "score": "0.5349123", "text": "def node_tree\n @node_tree ||= Node.all({:fields => \"title, permalink, parent_id, _id, path, _type\", :published_at => { :$lte => Time.zone.now }, :published_to => { :$gte => Time.zone.now }, :order => 'parent_id ASC, position ASC'}).group_by{|n| n.parent_id.to_s }\n end", "title": "" }, { "docid": "846e385012616a13bcc6797fb2eb76a2", "score": "0.5348742", "text": "def build_tree(array)\n first_node = Node.new(nil, nil, array[0])\n this_node = first_node\n i = 1\n\n finished = false\n while !finished\n if array[i] == nil\n finished = true\n elsif array[i] < this_node.data\n if this_node.left_child == nil\n this_node.left_child = Node.new(nil, nil, array[i])\n this_node = first_node\n i += 1\n else\n this_node = this_node.left_child\n end\n elsif array[i] > this_node.data\n if this_node.right_child == nil\n this_node.right_child = Node.new(nil, nil, array[i])\n this_node = first_node\n i += 1\n else\n this_node = this_node.right_child\n end \n elsif array[i] == this_node.data\n i += 1\n end\n end\n return first_node\nend", "title": "" }, { "docid": "89549cc211a87908dcee03db5c60f849", "score": "0.5348368", "text": "def parse(subdata)\n \t\tif subdata.has_key?(:file)\n handle_files(subdata[:file])\n end\n if subdata.has_key?(:directory)\n \t\t handle_folders(subdata[:directory])\n end\n \tend", "title": "" }, { "docid": "3dbed3d8aa8bc393786b97230363f3e1", "score": "0.53480744", "text": "def convert(tree, options = T.unsafe(nil)); end", "title": "" }, { "docid": "38a92d6325c0e4b0aa572d8e3b12c7d9", "score": "0.53470224", "text": "def tree_children\n\n tree[2]\n end", "title": "" }, { "docid": "05f71021d3df831a28d63b9545c928a8", "score": "0.53460324", "text": "def tree\n return nil if messages.size == 0\n build_tree unless @tree\n @tree\n end", "title": "" }, { "docid": "d5ae21b2b37862d93fe635fe9fdde248", "score": "0.5344104", "text": "def build_tree\n root = Sass::SCSS::CssParser.new(@template).parse\n expand_commas root\n parent_ref_rules root\n remove_parent_refs root\n flatten_rules root\n fold_commas root\n root\n end", "title": "" }, { "docid": "ee8e82de8b0fee7626bb701454037dbb", "score": "0.53387696", "text": "def render_process_tree_json (expressions)\n\n OpenWFE::Json.encode(expressions.tree)\n end", "title": "" }, { "docid": "efe6a23a1818a3d452e47e0e344c98b4", "score": "0.5329117", "text": "def jstree\n @obj = @questionnaire.questionnaire_structure_for_js_tree(params)\n respond_to do |format|\n format.js { render :json => @obj.to_json, :callback => params[:callback] }\n end\n end", "title": "" }, { "docid": "f6e7a3b7cb03bc8bae5cafc2d00c4521", "score": "0.5326969", "text": "def tree_canonize\n @tree = tree_canonize2(@tree, \"*DOCUMENT\")\n end", "title": "" }, { "docid": "382c952846619055581bde08a883be1e", "score": "0.5324927", "text": "def tree_params\n params.require(:tree).permit(:title, :content, :special_date)\n end", "title": "" }, { "docid": "dbb7d6b52ac9418619f06efb797ec6f6", "score": "0.5317526", "text": "def build_tree(data, node=self)\n data = data.sort\n build_bin_tree(data, 0, data.length - 1, node)\n end", "title": "" }, { "docid": "3b05e778c6e0486b21860bd5261bcf35", "score": "0.5314061", "text": "def update_tree(element); end", "title": "" }, { "docid": "d11a44fb26593cc399ef74cddb7a4a6e", "score": "0.53139526", "text": "def valid_tree?\n true\n end", "title": "" }, { "docid": "82cb0f2c1408a35d92a1d13ea54eb058", "score": "0.53097636", "text": "def combine_to_tree\n @dependencies.dependencies.each do |dependency|\n matches = /(.*?)\\((.*?)-([0-9]+)'*, (.*?)-([0-9]+)'*\\)/.match(dependency) # cop(disorder-4, is-2) # ROOT! NSUBJ\n if matches.nil?\n p dependency\n end\n dependency_name,word1,number1,word2,number2 = matches[1],matches[2],matches[3],matches[4],matches[5]\n node1=dependency_to_node(number1.to_i)\n node2=dependency_to_node(number2.to_i)\n node1.add_dependency_to(dependency_name, node2)\n node2.add_dependency_from(dependency_name, node1)\n end\n end", "title": "" }, { "docid": "d05fca28aebed7f4c20086a76ec3c6cc", "score": "0.53081983", "text": "def build_tree\n c1 = ComponentNode.new(110)\n c2 = ComponentNode.new(20)\n c3 = ComponentNode.new(20)\n c4 = ComponentNode.new(150)\n c5 = ComponentNode.new(80)\n c6 = ComponentNode.new(120, [c1, c2, c3])\n c7 = ComponentNode.new(180, [c4, c5])\n return(ComponentNode.new(200, [c6, c7]))\n end", "title": "" }, { "docid": "baf213985c11b7a17e48b366a9440cab", "score": "0.53029096", "text": "def array\n # assign the sorted tree to a variable\n newlist = params[:ul].sort\n # initialize the previous item\n previous = nil\n #loop through each item in the new list (passed via ajax)\n newlist.each_with_index do |array, index|\n # get the category id of the item being moved\n moved_item_id = array[1][:id].gsub(/category_/,'')\n # find the object that is being moved (in database)\n @current_category = Category.find_by_id(moved_item_id)\n # if this is the first item being moved, move it to the root.\n unless previous.nil?\n @previous_item = Category.find_by_id(previous)\n @current_category.move_to_right_of(@previous_item)\n else\n @current_category.move_to_root\n end\n # then, if this item has children we need to loop through them\n unless array[1][:children].blank?\n # NOTE: unless there are no children in the array, send it to the recursive children function\n childstuff(array[1], @current_category)\n end\n # set previous to the last moved item, for the next round\n previous = moved_item_id\n end\n Category.rebuild!\n render :nothing => true\n end", "title": "" }, { "docid": "54779fe5d0c6dfa816d57688bd776f09", "score": "0.52965665", "text": "def build_tree(arr)\n #take array, turn into bt with node objs\n return nil if arr.empty?\n\n mid = (arr.size - 1)/2\n current_node = Node.new(arr[mid])\n\n current_node.left = build_tree(arr[0...mid])\n current_node.right = build_tree(arr[(mid+1)..-1])\n \n current_node\n end", "title": "" }, { "docid": "578fc8a4d75ac44551004c2c787ea4fe", "score": "0.5292049", "text": "def reduceTree( rootNode=@root )\n return if rootNode.nil?\n return if (rootNode.leftChild.nil? && rootNode.rightChild.nil? )\n reduceTree( rootNode.leftChild ) \n reduceTree( rootNode.rightChild )\n\n # If both children are numeric values, we can just perform the proper\n # operation on the children values and then replace the current node's\n # data with the result\n if( rootNode.leftChild.isNumeric? && rootNode.rightChild.isNumeric? )\n # This is a little verbose\n case rootNode.data\n when '+'\n rootNode.data = ( Float( rootNode.leftChild.data.to_f + rootNode.rightChild.data.to_f).to_s )\n when '-'\n rootNode.data = ( Float( rootNode.leftChild.data.to_f - rootNode.rightChild.data.to_f).to_s )\n when '*'\n rootNode.data = ( Float( rootNode.leftChild.data.to_f * rootNode.rightChild.data.to_f).to_s )\n when '/'\n rootNode.data = ( Float( rootNode.leftChild.data.to_f / rootNode.rightChild.data.to_f).to_s )\n end\n rootNode.leftChild = nil\n rootNode.rightChild = nil\n end\n\n end", "title": "" }, { "docid": "f31abadbc2fc26f4c9dd66bac2a3b636", "score": "0.52909195", "text": "def build_tree tree_root=nil\n tree_root ||= self.tree_root\n Dir.mkdir(tree_root) unless File.directory?(tree_root)\n Dir.chdir(tree_root) do\n self.files.each do |entry|\n visit_tree entry do |type, name|\n case type\n when :file\n FileUtils.touch(name)\n when :directory\n Dir.mkdir(name)\n else\n throw \"BAD VISIT TREE TYPE. #{type}\"\n end\n end\n end\n end\n end", "title": "" }, { "docid": "92dcba9fec11055ac24cd71cf5476526", "score": "0.52878577", "text": "def data alist=nil\n # if nothing passed, print an empty root, rather than crashing\n alist = [] if alist.nil?\n @data = alist # data given by user\n case alist\n when Array\n @treemodel = Canis::DefaultTreeModel.new(\"/\")\n @treemodel.root.add alist\n when Hash\n @treemodel = Canis::DefaultTreeModel.new(\"/\")\n @treemodel.root.add alist\n when TreeNode\n # this is a root node\n @treemodel = Canis::DefaultTreeModel.new(alist)\n when DefaultTreeModel\n @treemodel = alist\n else\n if alist.is_a? DefaultTreeModel\n @treemodel = alist\n else\n raise ArgumentError, \"Tree does not know how to handle #{alist.class} \"\n end\n end\n # we now have a tree\n raise \"I still don't have a tree\" unless @treemodel\n set_expanded_state(@treemodel.root, true)\n convert_to_list @treemodel\n \n # added on 2009-01-13 23:19 since updates are not automatic now\n #@list.bind(:LIST_DATA_EVENT) { |e| list_data_changed() }\n #create_default_list_selection_model TODO\n fire_dimension_changed\n self\n end", "title": "" }, { "docid": "06f1caa727c33a651754fda7b035d51d", "score": "0.5282901", "text": "def object_tree\n head, *rest = array_tree\n object_subtree(head,rest)\n end", "title": "" }, { "docid": "0fb4b8a865b01a45d13e880f00e77326", "score": "0.5272886", "text": "def build_tree(tree, parts, path)\n path += '/' unless path.empty? || path.end_with?('/')\n parts[0...-1].each do |p|\n path += \"#{p}/\"\n tree[p] ||= { type: :directory, path: path, sub: {} }\n tree = tree[p][:sub]\n end\n fname = parts[-1]\n tree[fname] = { type: :text, path: path + fname }\n end", "title": "" } ]
131de06dd4cfd4790f5394da24289e92
compute event for execution by computing whatever the jig backend needs
[ { "docid": "b38d806f5ec636ee9d5f44fb23305a36", "score": "0.0", "text": "def prepare_for_execution(evt,config)\n # here for sub-classes to override.\n end", "title": "" } ]
[ { "docid": "56d60e6ddfee0be763518502cadcf86b", "score": "0.59101313", "text": "def apply(raw_event); end", "title": "" }, { "docid": "53e5752ccf8265a391d4d45d284e2e7f", "score": "0.5835086", "text": "def result\n main_event\n end", "title": "" }, { "docid": "0e276fcca6b34a031f73b0f330985a8d", "score": "0.57970816", "text": "def event; end", "title": "" }, { "docid": "0e276fcca6b34a031f73b0f330985a8d", "score": "0.57970816", "text": "def event; end", "title": "" }, { "docid": "0e276fcca6b34a031f73b0f330985a8d", "score": "0.57970816", "text": "def event; end", "title": "" }, { "docid": "68f37b62339dc837237620ca0286d713", "score": "0.57797354", "text": "def run_next\n event = plan.action(state).new(event_log).execute\n event_log << event\n end", "title": "" }, { "docid": "98db5046fe235c40978f79731257d6b9", "score": "0.5732829", "text": "def call(event)\n catch :halt_conrad_processing do\n processors.reduce(event) do |previous_built_event, processor|\n processor.call(previous_built_event)\n end\n end\n end", "title": "" }, { "docid": "1d643f9839a34104affa0ac1c6456dd6", "score": "0.56895846", "text": "def on_backends_inline_process(event)\n count = event[:caller].send(:params_batch).to_a.size\n topic = event[:caller].topic.name\n time = event[:time]\n info \"Inline processing of topic #{topic} with #{count} messages took #{time} ms\"\n end", "title": "" }, { "docid": "148d11f4a3d35ff973d8d5495633e68a", "score": "0.568556", "text": "def process(event)\n # Nothing\n end", "title": "" }, { "docid": "846efc3ed188877174a2180344ee9e7a", "score": "0.5682962", "text": "def processEvent(eventName)\n\tend", "title": "" }, { "docid": "8235ebf7058af650a1d4fa0d7e5d7c56", "score": "0.56818056", "text": "def executor; end", "title": "" }, { "docid": "8235ebf7058af650a1d4fa0d7e5d7c56", "score": "0.56818056", "text": "def executor; end", "title": "" }, { "docid": "8235ebf7058af650a1d4fa0d7e5d7c56", "score": "0.56818056", "text": "def executor; end", "title": "" }, { "docid": "158475ad8b13412fdaa6af9fe2ac390f", "score": "0.5566646", "text": "def invoke_for_event(evt)\n processor = Apotomo::EventProcessor.instance\n processor.init\n \n fire(evt) # this stores the content in the EventProcessor, which is semi-clean.\n \n return processor.process_queue_for(root, evt)\n end", "title": "" }, { "docid": "07a7e7d12f890ce96b993d562276d89c", "score": "0.5532933", "text": "def run() end", "title": "" }, { "docid": "4f02dd8dfd5bb329e2026d3452b2365e", "score": "0.5519579", "text": "def ev_do_postprocess(was_events); end", "title": "" }, { "docid": "630a75b238699389e4b7eee1688ca82a", "score": "0.5450888", "text": "def exec_event(ce)\r\n if ce.event\r\n @direction, @completed, @message = ce.event.happens(@pc)\r\n ce.update_attribute(:completed, @completed)\r\n @pc.reload\r\n else\r\n Rails.logger.warn \"!!! No event found for current event; #{ce.inspect}\"\r\n ce.update_attribute(:completed, @completed)\r\n @pc.reload\r\n end\r\n\r\n if @direction\r\n flash[:notice] = @message\r\n redirect_to @direction\r\n else\r\n render :file => 'game/complete', :layout => true\r\n end\r\n end", "title": "" }, { "docid": "bb60dc7dce8d28230732f762c6376515", "score": "0.5430102", "text": "def value\n @value ||= ComputationContext.new(events).compute(&calculated_as)\n end", "title": "" }, { "docid": "38c9494f94a61432bd33ce963af45c85", "score": "0.5386615", "text": "def func_multiply_1000000(event, context)\n multiply(1000000)\n\n return {\n :status => 200,\n :data => 'OK',\n }\nend", "title": "" }, { "docid": "b4d91747d87f9859649fc585e5cd6bb9", "score": "0.53765875", "text": "def func_multiply_100000(event, context)\n multiply(100000)\n\n return {\n :status => 200,\n :data => 'OK',\n }\nend", "title": "" }, { "docid": "b54564bf1f9a57917e9e36ba50abe060", "score": "0.5355178", "text": "def run_and_transform; end", "title": "" }, { "docid": "6a580931a1781238fd4518fdb62728d7", "score": "0.53291756", "text": "def process; end", "title": "" }, { "docid": "6a580931a1781238fd4518fdb62728d7", "score": "0.53291756", "text": "def process; end", "title": "" }, { "docid": "6a580931a1781238fd4518fdb62728d7", "score": "0.53291756", "text": "def process; end", "title": "" }, { "docid": "6a580931a1781238fd4518fdb62728d7", "score": "0.53291756", "text": "def process; end", "title": "" }, { "docid": "6a580931a1781238fd4518fdb62728d7", "score": "0.53291756", "text": "def process; end", "title": "" }, { "docid": "6a580931a1781238fd4518fdb62728d7", "score": "0.53291756", "text": "def process; end", "title": "" }, { "docid": "6a580931a1781238fd4518fdb62728d7", "score": "0.53291756", "text": "def process; end", "title": "" }, { "docid": "6a580931a1781238fd4518fdb62728d7", "score": "0.53291756", "text": "def process; end", "title": "" }, { "docid": "36af67eeedc38d319e3ccbdae6f5a640", "score": "0.53225017", "text": "def event_requirement; end", "title": "" }, { "docid": "259858f296ba4779ebf0d8d6bcede9d8", "score": "0.52796066", "text": "def process_custom_method\n # da implementare per eventuali estensioni\n end", "title": "" }, { "docid": "7b4b6a5d5a1df943927e583109e9a16a", "score": "0.52694696", "text": "def pbCommonEvent(id)\n return false if id<0\n ce=$data_common_events[id]\n return false if !ce\n celist=ce.list\n interp=Interpreter.new\n interp.setup(celist,0)\n begin\n Graphics.update\n Input.update\n interp.update\n pbUpdateSceneMap\n end while interp.running?\n return true\nend", "title": "" }, { "docid": "d8c09ad31e896e9ad34430e003861edb", "score": "0.52672374", "text": "def _process_changes(event)\n _reset_no_unprocessed_events\n\n changes = [event]\n changes << config.event_queue.pop until config.event_queue.empty?\n\n return unless config.callable?\n\n hash = config.optimize_changes(changes)\n result = [hash[:modified], hash[:added], hash[:removed]]\n return if result.all?(&:empty?)\n\n block_start = MonotonicTime.now\n exception_note = \" (exception)\"\n ::Listen::Thread.rescue_and_log('_process_changes') do\n config.call(*result)\n exception_note = nil\n end\n Listen.logger.debug \"Callback#{exception_note} took #{MonotonicTime.now - block_start} sec\"\n end", "title": "" }, { "docid": "8b665f2299c613a9b4cb83683f6c86ef", "score": "0.52620786", "text": "def run(_); end", "title": "" }, { "docid": "8b665f2299c613a9b4cb83683f6c86ef", "score": "0.52620786", "text": "def run(_); end", "title": "" }, { "docid": "1b1b3df713ab00137eb5174f9d5f432a", "score": "0.52550507", "text": "def execute\n raise \"Event.execute is abstract\"\n end", "title": "" }, { "docid": "21285f144ebfbd592c392207b2f42f45", "score": "0.5233326", "text": "def process(event)\n event_data = build_event_data(event)\n transform_and_write(event, event_data)\n end", "title": "" }, { "docid": "56bd26f6667c65b36ec66522a7f1f1e3", "score": "0.52313924", "text": "def handle_workflow_execution_signaled(event)\n signal_name = event.attributes[:signal_name]\n input = event.attributes[:input] if event.attributes.keys.include? :input\n input ||= NoInput.new\n # TODO do stuff if we are @completed\n t = Task.new(nil) do\n @definition.signal_received(signal_name, input)\n end\n task_context = TaskContext.new(:parent => @workflow_async_scope.get_closest_containing_scope, :task => t)\n @workflow_async_scope.get_closest_containing_scope << t\n end", "title": "" }, { "docid": "1c0dece6ab1be7ce0b0a13a6f8632536", "score": "0.5222123", "text": "def func_multiply_100(event, context)\n multiply(100)\n\n return {\n :status => 200,\n :data => 'OK',\n }\nend", "title": "" }, { "docid": "716b5b021733fe218de0a4aca3da4358", "score": "0.521774", "text": "def human_event; end", "title": "" }, { "docid": "3d9abab6384f891b3bc8138a5a311580", "score": "0.51972866", "text": "def op; end", "title": "" }, { "docid": "9b14c188f2256cdf49f0e475db39d2ef", "score": "0.51957434", "text": "def exec!\n listener = Collector.listen!\n Thread.new do\n loop do\n sleep(15)\n planner.next_histogram(Collector.next_workload_histogram!)\n end\n end\n end", "title": "" }, { "docid": "c35fa5d920fd6b79689e863cd0397422", "score": "0.51831526", "text": "def create_work_event\n\t\n end", "title": "" }, { "docid": "01d8929631741cadcd09e38a0b164638", "score": "0.51816416", "text": "def interprete event\n @start ||= event.timestamp\n case event\n when UsbMon::Submission then interprete_submission event\n when UsbMon::Callback then interprete_callback event\n when UsbMon::Error then interprete_error event\n else\n raise \"Unknown event class #{event.class}\"\n end\n end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.51667434", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.51667434", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.51667434", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.51667434", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.51667434", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.51667434", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.51667434", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.51667434", "text": "def run; end", "title": "" }, { "docid": "5ab49f4a4e76cf57dddfec246839f72d", "score": "0.51667434", "text": "def run; end", "title": "" }, { "docid": "7cf1cae703531567552407664691f41d", "score": "0.51654357", "text": "def run(event, params = nil)\n @events[event].call(params)\n end", "title": "" }, { "docid": "af1e34014a05bd7f9ca7227b2234e752", "score": "0.5162786", "text": "def on_inc\n end", "title": "" }, { "docid": "ff1cb32628977acc28cd1a7e6b85541e", "score": "0.51593137", "text": "def events; end", "title": "" }, { "docid": "ff1cb32628977acc28cd1a7e6b85541e", "score": "0.51593137", "text": "def events; end", "title": "" }, { "docid": "ff1cb32628977acc28cd1a7e6b85541e", "score": "0.51593137", "text": "def events; end", "title": "" }, { "docid": "ff1cb32628977acc28cd1a7e6b85541e", "score": "0.51593137", "text": "def events; end", "title": "" }, { "docid": "ff1cb32628977acc28cd1a7e6b85541e", "score": "0.51593137", "text": "def events; end", "title": "" }, { "docid": "ff1cb32628977acc28cd1a7e6b85541e", "score": "0.51593137", "text": "def events; end", "title": "" }, { "docid": "ff1cb32628977acc28cd1a7e6b85541e", "score": "0.51593137", "text": "def events; end", "title": "" }, { "docid": "ff1cb32628977acc28cd1a7e6b85541e", "score": "0.51593137", "text": "def events; end", "title": "" }, { "docid": "a2f3b2c9cfa7a3cb7ebf21d716c536e8", "score": "0.5152864", "text": "def on_worker_processed(event)\n job = event[:job]\n time = event[:time]\n job_type = job.class.to_s.split('::').last\n consumer = job.executor.topic.consumer\n topic = job.executor.topic.name\n info \"[#{job.id}] #{job_type} job for #{consumer} on #{topic} finished in #{time}ms\"\n end", "title": "" }, { "docid": "50f3733b42b7b058f267c783cd6c6dd0", "score": "0.5146822", "text": "def calculated; end", "title": "" }, { "docid": "cdce0835f9067df978ed654e37de5fc7", "score": "0.51240075", "text": "def run_cond; end", "title": "" }, { "docid": "adc143d9921490a32ce81e2ec1b81602", "score": "0.5123713", "text": "def invoke; end", "title": "" }, { "docid": "9ef74626a9f16e1b82ad062e59ad0de2", "score": "0.5121464", "text": "def profiling_command_submit\n ptr = MemoryPointer::new( :cl_ulong )\n error = OpenCL.clGetEventProfilingInfo(self, PROFILING_COMMAND_SUBMIT, ptr.size, ptr, nil )\n error_check(error)\n return ptr.read_cl_ulong\n end", "title": "" }, { "docid": "dbe8c344ecefd34fa3f872b5bdca6094", "score": "0.507915", "text": "def process\n end", "title": "" }, { "docid": "9852bf6945e63a279b2072969c359240", "score": "0.5072178", "text": "def queue_event (event, *args)\n\n #ldebug { \"queue_event() :#{event}\" }\n\n return if event == :stop\n return if event == :launch\n return if event == :reschedule\n\n wfid = extract_fei(args[0]).parent_wfid\n #\n # maybe args[0] could be a FlowExpression instead\n # of a FlowExpressionId instance\n #puts \"___#{event}__wfid : #{wfid}\"\n\n e = serialize_event(event, *args)\n\n bucket = nil\n\n synchronize do\n\n bucket = get_bucket(wfid)\n bucket << e\n\n #ldebug { \"queue_event() bucket : #{bucket.object_id}\" }\n\n if event == :terminate\n\n bucket.flush\n @buckets.delete(wfid)\n end\n end\n #\n # minimizing the sync block\n\n # TODO : spin that off this thread, to the\n # flush thread...\n #\n if event == :terminate\n if @application_context[:keep_journals] == true\n #\n # 'move' journal to the done/ subdir of journal/\n #\n FileUtils.cp(\n bucket.path,\n @donedir + \"/\" + File.basename(bucket.path))\n end\n FileUtils.rm bucket.path\n end\n end", "title": "" }, { "docid": "bd395ef5570ec94ad67ca3120a943fca", "score": "0.50699824", "text": "def operation; end", "title": "" }, { "docid": "e72989dfd9c07bd0cf65664ff6b1a9f6", "score": "0.5069345", "text": "def run\n end", "title": "" }, { "docid": "e1f767b74c3fc3e1182f284b676efa68", "score": "0.5067121", "text": "def pbCommonEvent(id)\n return false if id<0\n ce = $data_common_events[id]\n return false if !ce\n celist = ce.list\n interp = Interpreter.new\n interp.setup(celist,0)\n begin\n Graphics.update\n Input.update\n interp.update\n pbUpdateSceneMap\n end while interp.running?\n return true\nend", "title": "" }, { "docid": "84143ceb26504dda05637bb1668a02df", "score": "0.50655806", "text": "def invoke!(state)\n ### TODO: encapsulate in PageUpdateQueue:\n Apotomo::EventProcessor.instance.processed_handlers << [name, invoke(:state)]\n end", "title": "" }, { "docid": "d27f5c7269761458f35bd8d0202ebf07", "score": "0.50490594", "text": "def call event\n fire(event)\n end", "title": "" }, { "docid": "2bf4b8a6522c417ddf02ea25aa5a6070", "score": "0.5045779", "text": "def emitting_event(event, context) # :nodoc:\n\t if !executable?\n\t\traise TaskNotExecutable.new(self), \"trying to emit #{symbol} on #{self} but #{self} is not executable\"\n\t end\n\n if finished? && !event.terminal?\n raise EmissionFailed.new(nil, event),\n \"#{self}.emit(#{event.symbol}, #{context}) called by #{execution_engine.propagation_sources.to_a} but the task has finished. Task has been terminated by #{stop_event.last.sources}.\"\n elsif pending? && event.symbol != :start\n raise EmissionFailed.new(nil, event),\n\t\t \"#{self}.emit(#{event.symbol}, #{context}) called by #{execution_engine.propagation_sources.to_a} but the task has never been started\"\n elsif running? && event.symbol == :start\n raise EmissionFailed.new(nil, event),\n \"#{self}.emit(#{event.symbol}, #{context}) called by #{execution_engine.propagation_sources.to_a} but the task is already running. Task has been started by #{start_event.last.sources}.\"\n end\n end", "title": "" }, { "docid": "740a9ed6f93b32f0f890d91869fcafba", "score": "0.5041465", "text": "def event(proc)\r\n ProcEvent.new(proc)\r\n end", "title": "" }, { "docid": "79e53c28dd80a0419892618b4e8ec37a", "score": "0.5040104", "text": "def event(proc)\n ProcEvent.new(proc)\n end", "title": "" }, { "docid": "4e9945bf27835ec54db640d2800c5466", "score": "0.5033576", "text": "def exec; end", "title": "" }, { "docid": "4e9945bf27835ec54db640d2800c5466", "score": "0.5033576", "text": "def exec; end", "title": "" }, { "docid": "d58b5d490f5d50c12aaa3d60c901057c", "score": "0.5033499", "text": "def process_next_gevent\r\n #@log.info \"Process next event\"\r\n return if @suspend_queue_proc == true\r\n while @proc_queue.size > 0\r\n next_ev_handl = @proc_queue.pop\r\n send(next_ev_handl)\r\n return if @suspend_queue_proc == true\r\n end\r\n \r\n end", "title": "" }, { "docid": "e19751e9808c1f5ec290dcb61b11d388", "score": "0.5024846", "text": "def perform(&block); end", "title": "" }, { "docid": "d0f3f8d726cc13cf08a7ef7b178cedff", "score": "0.5023699", "text": "def compute\n \tself.start_time = DateTime.now\n\n #call API request methods to fetch products\n\t\tApiRequestLog.process(self, endpoint)\n\n\t\tproducts = if category.present?\n\t\t\tProduct.where(category: category)\n\t\telse\n\t\t\tProduct.all\n\t\tend\n\n #compute average cubic weight\n\t\tif products.count > 0\n\t\t\t_total_cubic_weight = products.inject(0) {|r, p| r += p.volume.to_f * conversion_factor} \n\t\t\tself.average_cubic_weight = _total_cubic_weight.to_f / products.count \n\t\tend\n\n #update tracking data\n\t\tself.finished = true\n\t\tself.end_time = DateTime.now\n\t\tself.duration = end_time - start_time\n\t\tself.save(validate: false)\n\n #broadcast to client side to notify with calcualted average cubic weight of a related category\n if category.present?\n ActionCable.server.broadcast \"api_request_notifications_channel\", weight: \"#{average_cubic_weight} kg\", category: category\n else\n ActionCable.server.broadcast \"api_request_notifications_channel\", weight: \"#{average_cubic_weight} kg\"\n end\n\trescue\n end", "title": "" }, { "docid": "e01a24f007fc0123b90e7d4b10aeeb3c", "score": "0.50231", "text": "def _ta(label)\n $agg[label] ||= { time: 0, num_calls: 0 }\n t = Process.clock_gettime(Process::CLOCK_MONOTONIC)\n ret = yield\n ensure\n $agg[label][:time] += (Process.clock_gettime(Process::CLOCK_MONOTONIC) - t)\n $agg[label][:num_calls] += 1\n ret\n end", "title": "" }, { "docid": "0045c99d9a89a8fa99515b98b1b9bde2", "score": "0.50219655", "text": "def perform()\n 2 + 2\n end", "title": "" }, { "docid": "63448c3afa89efb6cd778e68c4bc0b11", "score": "0.5013719", "text": "def run events\n events.each do |event| \n interprete event\n end\n# return\n puts \"Statistics:\"\n @counts.each do |k,v|\n puts \"#{k.inspect} =>\"\n i = 0\n step = 6\n while i < v.size\n puts \"\\t#{v[i,step]}\"\n i += step\n end\n end\n end", "title": "" }, { "docid": "10681a7b1f51e27dffdb314c6071268d", "score": "0.5008902", "text": "def event\n @event ||= Hyrax::Event.create( action, Time.current.to_i )\n end", "title": "" }, { "docid": "bc0ee4a77c0fd1f0f5d24c52657cadb8", "score": "0.50063634", "text": "def on_process(&block); end", "title": "" }, { "docid": "3b1962cf22cc05aa1f568f6aeaa3544f", "score": "0.500601", "text": "def calculation\n end", "title": "" }, { "docid": "f1d3469028b9cb47c6fb9605be56972a", "score": "0.4999292", "text": "def call(event)\n @update.each_pair do |key, value|\n next unless event.key?(key)\n\n value = value.call(event) if value.respond_to?(:call)\n event[key] = value\n end\n event\n end", "title": "" }, { "docid": "e7d07162db5f4dcd225b789f3fa1520f", "score": "0.49930874", "text": "def alaram_operation action\n @state = action\n notify\nend", "title": "" }, { "docid": "2452dec2201c71198683c8e20930a2cd", "score": "0.49890533", "text": "def process!\n events.each(&:process!)\n end", "title": "" }, { "docid": "f8dccfdfb4135daab3df5cc0d5f7b530", "score": "0.49805096", "text": "def ev_do_calculate_rw_wait(wait); end", "title": "" }, { "docid": "1d65c7d7e4cbeaff148045bb5a001a1f", "score": "0.49764484", "text": "def ev_preprocess(&block); end", "title": "" }, { "docid": "1d65c7d7e4cbeaff148045bb5a001a1f", "score": "0.49764484", "text": "def ev_preprocess(&block); end", "title": "" }, { "docid": "5748aa0a0c912e6ed47e8c07f2e065a4", "score": "0.49739948", "text": "def event_bus; end", "title": "" }, { "docid": "5748aa0a0c912e6ed47e8c07f2e065a4", "score": "0.49739948", "text": "def event_bus; end", "title": "" }, { "docid": "b8f95ffea11457072412391088507464", "score": "0.4971862", "text": "def execute; end", "title": "" }, { "docid": "b8f95ffea11457072412391088507464", "score": "0.4971862", "text": "def execute; end", "title": "" }, { "docid": "4962acf22af4685bb9128154f75525c4", "score": "0.496746", "text": "def process_event(event, session)\n logger = session.logger\n logger.debug \"#{self.class.name} running...\"\n @block.call(event, session) if @block\n end", "title": "" }, { "docid": "ccf50d8d52502c8cbf4e307ce22a3f38", "score": "0.49571165", "text": "def work(raw_event)\n event = JSON.parse(raw_event)\n EventManager.new.handle_event(event)\n end", "title": "" } ]
f0088bad92e03ed5ff023ce7262149a2
Remove raw message tables in order order until size is under the given size (given in MB)
[ { "docid": "e5bde90e8fce57fd617793ac96755f7b", "score": "0.7515886", "text": "def remove_raw_tables_until_less_than_size(size)\n tables = self.raw_tables(nil)\n tables_removed = []\n until @database.total_size <= size\n table = tables.shift\n tables_removed << table\n remove_raw_table(table)\n end\n tables_removed\n end", "title": "" } ]
[ { "docid": "a4e9e8c157398a473d041335dfc5e255", "score": "0.60374284", "text": "def remove_raw_table(table)\n @database.query(\"UPDATE `#{@database.database_name}`.`messages` SET raw_table = NULL, raw_headers_id = NULL, raw_body_id = NULL, size = NULL WHERE raw_table = '#{table}'\")\n @database.query(\"DELETE FROM `#{@database.database_name}`.`raw_message_sizes` WHERE table_name = '#{table}'\")\n drop_table(table)\n end", "title": "" }, { "docid": "0ace9054e9c424dfdeb401adade93e78", "score": "0.59981596", "text": "def clean_up_old_messages(how_many_to_keep = 1000)\n while @messages.length > how_many_to_keep\n # We need to shift, as we want to remove the oldest first\n @messages.shift\n end\n end", "title": "" }, { "docid": "7f110033ad39dfa458fba425c9a34feb", "score": "0.5974716", "text": "def evict_lru_for_size(size)\n evict(@data.keys.first) while (@data.length >= max_size_elements || @current_size_bytes + size > max_size_bytes)\n end", "title": "" }, { "docid": "053f0b4b8b3841dd804ffdbd50e041d4", "score": "0.5962517", "text": "def remove_large_words(size=6)\n @wordlist.delete_if{|word| word.length > size}\n end", "title": "" }, { "docid": "36acff28178ab573041eac62af781aa7", "score": "0.58375674", "text": "def trim_messages room\n while room['messages'].length > 250\n room['messages'].shift\n end\n end", "title": "" }, { "docid": "904e7792c10c9804f8edaf9eba352aa3", "score": "0.5664376", "text": "def trim_to_size(user_id, size, aggregate = ActivityFeed.aggregate)\n ActivityFeed.feederboard_for(user_id, aggregate).remove_members_outside_rank(size)\n end", "title": "" }, { "docid": "a975de0db5bf8aa4e21f6848e7e90772", "score": "0.55948377", "text": "def trim_size(*args, &block)\n input, bytes = args.first, args.last\n input = yield if block_given?\n input = input.dup\n input = input[0...bytes] if input.respond_to?(:size) && input.size > bytes\n input\n end", "title": "" }, { "docid": "f95bece9817c9dd92c7b97b7cc11cb1e", "score": "0.5484615", "text": "def trim_messages room\n room = room_object(room) if room.is_a?(String)\n while room['messages'].length > 250\n room['messages'].shift\n end\n end", "title": "" }, { "docid": "49bd0f901ef6340e45159893868d8cc9", "score": "0.5433956", "text": "def trim( selected, size )\n raise ArgumentError.new( \"Can't trim to a nil size\" ) unless size\n while self.class.elements_count( selected ) > size\n candidates = self.trim_candidates( selected, @wanted_distribution )\n selected[candidates.first].pop\n end\n \n selected\n end", "title": "" }, { "docid": "b59bb11edce970b2247432b673638d5e", "score": "0.54227936", "text": "def check_LRU_size(size)\n\t\tif cache_size+size > @size\n\t\t\t@hashmap.delete(@last.key)\n\t\t\tremove_node(@last)\n\t\tend\n\tend", "title": "" }, { "docid": "c642aa61f1e853e6ebb224ac1e0744d3", "score": "0.5421554", "text": "def discard_max_size\n @discard_max_size\n end", "title": "" }, { "docid": "59520e4d6461b8b27db6a3350cac121a", "score": "0.53562295", "text": "def prune_large_patch(patch)\n size = 0\n\n patch.each_hunk do |hunk|\n hunk.each_line do |line|\n size += line.content.bytesize\n\n if size >= SIZE_LIMIT\n too_large!\n return true\n end\n end\n end\n\n if !expanded && size >= COLLAPSE_LIMIT\n collapse!\n return true\n end\n\n false\n end", "title": "" }, { "docid": "1e9ad7758ff22344a639f07bcf51f0e6", "score": "0.5286791", "text": "def split_document_list_to_sublists_by_max_size(all_documents, documents_byte_size)\r\n number_of_sublists = (documents_byte_size.to_f / @logstashLoganalyticsConfiguration.MAX_SIZE_BYTES.to_f).ceil # If max size is 1MB and actual size is 2.5MB - this will return 3.\r\n split_documents_lists = all_documents.each_slice((all_documents.size/number_of_sublists.to_f).round).to_a\r\n final_documents_lists = Array.new\r\n\r\n for documents_sublist in split_documents_lists do\r\n documents_sublist_byte_size = documents_sublist.to_json.bytesize\r\n\r\n if (documents_sublist_byte_size >= @logstashLoganalyticsConfiguration.MAX_SIZE_BYTES)\r\n if (documents_sublist.length > 1)\r\n final_documents_lists.concat(split_document_list_to_sublists_by_max_size(documents_sublist, documents_sublist_byte_size))\r\n else\r\n @logger.error(\"Received document above the max allowed size - dropping the document [document size: #{current_document_size}, max allowed size: #{@logstashLoganalyticsConfiguration.MAX_SIZE_BYTES}\")\r\n end\r\n else\r\n final_documents_lists.push(documents_sublist)\r\n end\r\n end\r\n\r\n return final_documents_lists\r\n end", "title": "" }, { "docid": "8cf6ac47e72662c6924c3764b65d5918", "score": "0.52814007", "text": "def find_equal_or_larger_space(size)\n node = self\n\n loop do\n if node.size < size\n if node.larger\n # The current space is not yet large enough. If we have a larger sub\n # node check that one next.\n node = node.larger\n else\n break\n end\n elsif node.size == size ||\n node.size >= size * 2 + FlatFileBlobHeader::LENGTH\n # We've found a space that is either a perfect match or is large\n # enough to hold at least one more record. Remove it from the list and\n # return it.\n actual_size = node.size\n address = node.blob_address\n node.delete_node\n return [ address, actual_size ]\n elsif node.smaller\n # The current space is larger than size but not large enough for an\n # additional record. So check if we have a perfect match in the\n # smaller brach if available.\n node = node.smaller\n else\n break\n end\n end\n\n return nil\n end", "title": "" }, { "docid": "96cf96425d40bcf8fc0f2df9b4a22545", "score": "0.5266057", "text": "def deleteOver6digits data, lll\n\t\tdata.each do |date, orders|\n\t\t\torders.delete_if do |order|\n\t\t\t\torder[:orderNo].length > 4\n\t\t\tend\n\t\tend\n\n\tdata\nend", "title": "" }, { "docid": "f8e61ffebeae90dfcbbc2a93c84d526d", "score": "0.52588606", "text": "def filter_size size\n return true if not @opts[:size]\n\n s = @opts[:size]\n cmp = :== \n case s[0].chr\n when '-'\n cmp = :<\n when '+'\n cmp = :>\n end\n\n multi = 1\n case s[-1].chr.upcase\n when 'K'\n multi = 1024\n when 'M'\n multi = 1024 * 1024\n when 'G'\n multi = 1024 * 1024 * 1024\n when 'T'\n multi = 1024 * 1024 * 1024 * 1024\n when 'P'\n multi = 1024 * 1024 * 1024 * 1024 * 1024\n end\n filter_size = s.to_i.abs * multi\n\n size.send(cmp, filter_size)\n end", "title": "" }, { "docid": "119af1cb6191e736b0f92af0a756300d", "score": "0.5250361", "text": "def do_squeeze!\n\n while size > @maxsize\n delete(@lru_keys.shift)\n end\n end", "title": "" }, { "docid": "103da9d291c3bb87d37a48b90b545ac0", "score": "0.5232253", "text": "def stripped_size\n 80 + Bitcoin.pack_var_int(transactions.size).bytesize +\n transactions.inject(0){|sum, tx| sum + tx.serialize_old_format.bytesize}\n end", "title": "" }, { "docid": "deebb1addcc27d0ca88c214dc4d5418f", "score": "0.52273995", "text": "def trimqueue(content)\n \t# Destroy any service requests not taken by someone in the database or that isn't in the queue\n \tServiceRequest.all.each do |exists|\n\t\t\tunless exists.taken || content.include?(\"#{exists.number}\")\n\t\t\t\texists.destroy\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "e122a7aef0898df09ea1bf65c01c2f4e", "score": "0.5215056", "text": "def incomplete_files\n files.find_all {|f| f[\"size\"].to_i < 0 ||\n (f[\"size\"].to_i > f[\"bytesTransferred\"].to_i)}\n end", "title": "" }, { "docid": "541059f805dd0ad1a990043ef3a26e91", "score": "0.52117854", "text": "def defragmentize\n distance = 0\n new_file_size = 0\n deleted_blobs = 0\n corrupted_blobs = 0\n valid_blobs = 0\n\n # Iterate over all entries.\n @progressmeter.start('Defragmenting blobs file', @f.size) do |pm|\n each_blob_header do |header|\n # If we have stumbled over a corrupted blob we treat it similar to a\n # deleted blob and reuse the space.\n if header.corruption_start\n distance += header.addr - header.corruption_start\n corrupted_blobs += 1\n end\n\n # Total size of the current entry\n entry_bytes = FlatFileBlobHeader::LENGTH + header.length\n if header.is_valid?\n # We have found a valid entry.\n valid_blobs += 1\n if distance > 0\n begin\n # Read current entry into a buffer\n @f.seek(header.addr)\n buf = @f.read(entry_bytes)\n # Write the buffer right after the end of the previous entry.\n @f.seek(header.addr - distance)\n @f.write(buf)\n # Mark the space between the relocated current entry and the\n # next valid entry as deleted space.\n FlatFileBlobHeader.new(@f, @f.pos, 0,\n distance - FlatFileBlobHeader::LENGTH,\n 0, 0).write\n @f.flush\n rescue IOError => e\n PEROBS.log.fatal \"Error while moving blob for ID \" +\n \"#{header.id}: #{e.message}\"\n end\n end\n new_file_size = header.addr - distance +\n FlatFileBlobHeader::LENGTH + header.length\n else\n deleted_blobs += 1\n distance += entry_bytes\n end\n\n pm.update(header.addr)\n end\n end\n\n PEROBS.log.info \"#{distance / 1000} KiB/#{deleted_blobs} blobs of \" +\n \"#{@f.size / 1000} KiB/#{valid_blobs} blobs or \" +\n \"#{'%.1f' % (distance.to_f / @f.size * 100.0)}% reclaimed\"\n if corrupted_blobs > 0\n PEROBS.log.info \"#{corrupted_blobs} corrupted blob(s) found. Space \" +\n \"was recycled.\"\n end\n\n @f.flush\n @f.truncate(new_file_size)\n @f.flush\n\n sync\n end", "title": "" }, { "docid": "f36d1656eee6a3d454a67133fc57a570", "score": "0.52026623", "text": "def attachment_size\n attachment.each do |a|\n \tif a.size > 5.megabytes\n \t\terrors.add(:attachment, \"should be less than 5MB\")\n \tend\n end\n end", "title": "" }, { "docid": "21c398855ae2f1ebb0e37bbb0a654f47", "score": "0.5199284", "text": "def resize\n return unless size > @maximum\n\n to_remove = @keys.shift(size - @maximum)\n\n to_remove.each { |key| @cache.delete(key) }\n end", "title": "" }, { "docid": "782be63fe537c407ef43a1dd68d51b45", "score": "0.5182364", "text": "def change_message_limit_size(amount_of_documents, documents_byte_size)\r\n new_buffer_size = @logstashLoganalyticsConfiguration.max_items\r\n average_document_size = documents_byte_size / amount_of_documents\r\n # If window is full we need to increase it \r\n # \"amount_of_documents\" can be greater since buffer is not synchronized meaning \r\n # that flush can occur after limit was reached.\r\n if amount_of_documents >= @logstashLoganalyticsConfiguration.max_items\r\n # if doubling the size wouldn't exceed the API limit\r\n if ((2 * @logstashLoganalyticsConfiguration.max_items) * average_document_size) < @logstashLoganalyticsConfiguration.MAX_SIZE_BYTES\r\n new_buffer_size = 2 * @logstashLoganalyticsConfiguration.max_items\r\n else\r\n new_buffer_size = (@logstashLoganalyticsConfiguration.MAX_SIZE_BYTES / average_document_size) -1000\r\n end\r\n\r\n # We would like to decrease the window but not more then the MIN_MESSAGE_AMOUNT\r\n # We are trying to decrease it slowly to be able to send as much messages as we can in one window \r\n elsif amount_of_documents < @logstashLoganalyticsConfiguration.max_items and @logstashLoganalyticsConfiguration.max_items != [(@logstashLoganalyticsConfiguration.max_items - @logstashLoganalyticsConfiguration.decrease_factor) ,@logstashLoganalyticsConfiguration.MIN_MESSAGE_AMOUNT].max\r\n new_buffer_size = [(@logstashLoganalyticsConfiguration.max_items - @logstashLoganalyticsConfiguration.decrease_factor) ,@logstashLoganalyticsConfiguration.MIN_MESSAGE_AMOUNT].max\r\n end\r\n\r\n change_buffer_size(new_buffer_size)\r\n end", "title": "" }, { "docid": "fb0867d9f78f70c048324f29c4c8c7ad", "score": "0.5177034", "text": "def change_message_limit_size(amount_of_documents, documents_byte_size)\r\n current_buffer_size = @buffer_config[:max_items]\r\n new_buffer_size = current_buffer_size \r\n average_document_size = documents_byte_size / amount_of_documents\r\n\r\n # If window is full we need to increase it \r\n # \"amount_of_documents\" can be greater since buffer is not synchronized meaning \r\n # that flush can occur after limit was reached.\r\n if amount_of_documents >= current_buffer_size\r\n # if doubling the size wouldn't exceed the API limit\r\n if ((2 * current_buffer_size) * average_document_size) < @buffer_config[:flush_each]\r\n new_buffer_size = 2 * current_buffer_size\r\n # If doubling the size will exceed the API limit, change it to be as close as possible to the API limit (minus 4kb just to be safe) - but don't cause it to decrease\r\n else\r\n average_documents_in_4kb = (average_document_size / 4000).ceil\r\n potential_new_buffer_size = (@buffer_config[:flush_each] / average_document_size) -average_documents_in_4kb\r\n if potential_new_buffer_size > new_buffer_size\r\n new_buffer_size = potential_new_buffer_size\r\n end\r\n end\r\n\r\n # We would like to decrease the window but not more then the MIN_MESSAGE_AMOUNT\r\n # We are trying to decrease it slowly to be able to send as much messages as we can in one window \r\n elsif amount_of_documents < current_buffer_size and current_buffer_size != [(current_buffer_size - @logstashLoganalyticsConfiguration.decrease_factor) ,@logstashLoganalyticsConfiguration.MIN_MESSAGE_AMOUNT].max\r\n new_buffer_size = [(current_buffer_size - @logstashLoganalyticsConfiguration.decrease_factor) ,@logstashLoganalyticsConfiguration.MIN_MESSAGE_AMOUNT].max\r\n end\r\n\r\n change_buffer_size(new_buffer_size)\r\n end", "title": "" }, { "docid": "688f24edb5b7262f2dd1df261e9a24d2", "score": "0.5164304", "text": "def trim_daily_messages\n if(DailyMessage.count > 3)\n DailyMessage.destroy(DailyMessage.first.id)\n end\n end", "title": "" }, { "docid": "0b19f2c41a076a2ae70ec4a5168e1fd4", "score": "0.5140864", "text": "def dequeue_each(&block)\n until @messages.empty?\n message = @messages.first\n\n yield message\n\n @size -= 1\n @bytesize -= message.bytesize\n @messages.shift\n end\n end", "title": "" }, { "docid": "fe367af68c771ad596bff3b67bf0f3af", "score": "0.5136151", "text": "def maximum_message_size=( size=307200 )\n\t\tif size.to_i.zero?\n\t\t\tself.unlink( 'msgsize' )\n\t\telse\n\t\t\tself.write( 'msgsize' ) {|f| f.puts \"#{size.to_i}:0\" }\n\t\tend\n\tend", "title": "" }, { "docid": "face447a1ad31ac674d7eedc9196873b", "score": "0.51357764", "text": "def _compact\n nonces = rds.hkeys hpk_tag\n # select all nonces that no longer have corresponding message stored\n toDel = nonces.select { |n| not rds.exists? msg_tag n }\n\n # delete all these nonces from hash index\n unless toDel.empty?\n _resetCount()\n runRedisTransaction(hpk_tag, @hpk, 'compact') { toDel.each { |n| rds.hdel hpk_tag, n } }\n end\n end", "title": "" }, { "docid": "548a16397833edddae6b5db00526f04d", "score": "0.5131277", "text": "def keep size = nil\n return false unless @fsm.state == :made\n\n if size.nil?\n @push_stream.data @body\n else\n body = @body\n\n if body.bytesize > size\n body = @body.dup\n while body.bytesize > size\n @push_stream.data body.slice!(0, size), end_stream: false\n yield if block_given?\n end\n else\n yield if block_given?\n end\n\n @push_stream.data body\n end\n\n @fsm.transition :kept\n log :info, self\n @stream.on_complete\n end", "title": "" }, { "docid": "68aebad4ec8c402c517a2ea53f1a5003", "score": "0.5127105", "text": "def _make_space_for(bytes)\n raise ArgumentError(\"cannot store files larger than the cache\") if bytes > _max_bytes\n _edit_metadata do |metadata|\n while bytes > _max_bytes - metadata[:bytes]\n key,(size,_,_) = metadata[:files].first\n Log.warn \"FILECACHE evicting #{key}\"\n _cache_file(key).delete\n metadata[:files].delete(key)\n metadata[:bytes] -= size\n end\n end\n end", "title": "" }, { "docid": "2d0a33113e2429adae319b4681ca124e", "score": "0.5119845", "text": "def consume_disk(requested_size)\n unless @sizes.empty?\n @sizes.sort! { |a, b| b <=> a }\n if @sizes[0] >= requested_size + VSphereCloud::Resources::Datastore::DISK_HEADROOM\n @sizes[0] -= requested_size\n return true\n end\n end\n\n false\n end", "title": "" }, { "docid": "ac408834b17d4a4a190f25498bcf9ea5", "score": "0.51085544", "text": "def adjust_chunk_size(data, chunk_size)\n chunk_size && chunk_size >= data.size ? nil : chunk_size\n end", "title": "" }, { "docid": "44bf36366a6e3e52eae9a8c96be9647d", "score": "0.51062113", "text": "def incomplete_files\n files.find_all { |f| f[\"size\"].to_i < 0 ||\n (f[\"size\"].to_i > f[\"bytesTransferred\"].to_i) }\n end", "title": "" }, { "docid": "c6c116fd536a1db6383b3ea70105ba7b", "score": "0.50932264", "text": "def resize(size)\n @threshold = size * LOAD_FACTOR\n new_a = Array.new(size)\n @table.each do |x|\n while x\n idx = x.key.hash % size\n new_a[idx] = Couple.new(x.key, x.value, new_a[idx])\n x = x.n\n end\n end\n @M = size\n @table = new_a\n end", "title": "" }, { "docid": "8c1d35572e02e5c302f748ee9562cddb", "score": "0.5090908", "text": "def remove_empty_layer_parts(max_layer_sum)\n layer_model.part.each do |part|\n next if part.sum > max_layer_sum\n next if file_size(part.states_vbyte.to_s) > 0\n part.destroy!\n end\n end", "title": "" }, { "docid": "dc5d94591e709cd12f3bb45fc22faec8", "score": "0.5075321", "text": "def prune(target_size, max_time = T.unsafe(nil)); end", "title": "" }, { "docid": "24703804e6887860f00267fa9d4e22ba", "score": "0.5071701", "text": "def filter_result_file(file_name)\n s = IO.read(file_name).split(\"\\n\") \n s_new = s.find_all{|l|l.split(/\\s+/).size > 5}\n info \"[filter_result_file] inconsistent result was filtered!\" if s.size != s_new.size\n File.open(file_name,'w'){|f|f.puts s_new.join(\"\\n\")}\nend", "title": "" }, { "docid": "faece4d4e52b92abc078f6e8a96c406a", "score": "0.50473857", "text": "def remove(offset, size)\n raise ArgumentError, \"Invalid offset & size!\" if (offset + size) > @_buffer.length\n\n @_buffer.slice!(offset, size)\n @_size -= size\n if @_offset >= (offset + size)\n @_offset -= size\n elsif @_offset >= offset\n @_offset -= @_offset - offset\n @_offset = @_size if @_offset > @_size\n end\n end", "title": "" }, { "docid": "7afe03ed4595799942d45c44649fd7d5", "score": "0.50405025", "text": "def each_page_delete(size, state = -1, extended = false)\n loop_page(size, state, extended) do |element, page|\n no_deleted = 0\n\n page.each(\"//#{element}\") do |obj|\n no_deleted += 1 if !yield(obj)\n end\n\n no_deleted\n end\n end", "title": "" }, { "docid": "6c7c065439f8f6aec77dcdb7f7d42433", "score": "0.5033249", "text": "def find_matching_space(size)\n node = self\n\n loop do\n if node.size < size\n if node.larger\n # The current space is not yet large enough. If we have a larger sub\n # node check that one next.\n node = node.larger\n else\n break\n end\n elsif node.size == size\n # We've found a space that is an exact match. Remove it from the\n # list and return it.\n address = node.blob_address\n node.delete_node\n return [ address, size ]\n else\n break\n end\n end\n\n return nil\n end", "title": "" }, { "docid": "b34f064b909b759dff3fde72bfc93568", "score": "0.5007316", "text": "def verify_sizing(size, concurrency); end", "title": "" }, { "docid": "9f60216211d086e0e94f308530afcc19", "score": "0.4991228", "text": "def get_minimum_order_size(crypto, fiat) end", "title": "" }, { "docid": "5a287aed31143f45c20421d39801c6c8", "score": "0.4974344", "text": "def max_size=(newsz)\n @mutex.synchronize do\n if newsz < size\n (size - newsz).times do\n old = @index.delete_at(0)\n @objects.delete(old.obj)\n end\n resort\n end\n\n @max_size = newsz\n end\n end", "title": "" }, { "docid": "73604ce7808767a421495f57e4ba095b", "score": "0.49725094", "text": "def table_size\n sql = %q(\n SELECT c.relname AS name,\n pg_size_pretty(pg_table_size(c.oid)) AS size\n FROM pg_class c\n LEFT JOIN pg_namespace n ON (n.oid = c.relnamespace)\n WHERE n.nspname NOT IN ('pg_catalog', 'information_schema')\n AND n.nspname !~ '^pg_toast'\n AND c.relkind='r'\n ORDER BY pg_table_size(c.oid) DESC;\n )\n\n track_extra('table_size') if can_track?\n puts exec_sql(sql)\n end", "title": "" }, { "docid": "16f242c5c6c5cc68f5e27bc59bb3e8f9", "score": "0.497028", "text": "def remove_zeros(n, message)\n message.slice!(n, message.bytesize - n)\n end", "title": "" }, { "docid": "6c3e08d95599d534efef1f20c4ab9e71", "score": "0.49660277", "text": "def optimize_page_size(size)\n SIZE_PATTERN.reverse_each do |n|\n return n if size >= n\n end\n\n SIZE_DEFAULT\n end", "title": "" }, { "docid": "f4d8b026771bf36f060a447d01024703", "score": "0.49619266", "text": "def isLongMessage(size)\n size > MessageSize_Threshold ;\n end", "title": "" }, { "docid": "3b1e747c0ffbc89283f277ed40235836", "score": "0.4953258", "text": "def check_hashSize tags\n len = 0\n tags.collect{|t| len=len+ t.name.size}\n if len <= HASH_SIZE \n return tags\n else\n tags.pop\n check_hashSize tags \n end \n end", "title": "" }, { "docid": "164e78ab9693ba935bf88d470f7ce1de", "score": "0.4950988", "text": "def process_leftovers\n #puts \"Processing leftovers\"\n\n @context.storage.get_many('msgs').each do |msg|\n #puts \"Processing #{msg.inspect}\"\n\n process msg\n end\n\n #puts \"Finished processing leftovers\"\n end", "title": "" }, { "docid": "f9679d0980177a3ef52e7ba90bcba367", "score": "0.49484769", "text": "def trim\n smallest = find_smallest_dist(@nid_peers.values)\n\n# puts \"Removing #{smallest.inspect}.\"\n\n GoSim::Data::DataSet[:link].log(:remove, @nid, smallest)\n @nid_peers.delete(smallest) { | key | raise \"#{key} removed val not found.\" }\n\n# puts \"#{@nid}: Table size is now #{@nid_peers.length}.\"\n end", "title": "" }, { "docid": "d8a96f5422601aa157d5b52c2b502c2d", "score": "0.4942527", "text": "def get_chunks(size)\n chunks = []\n p = pp = 0\n i = 1\n\n while i <= 8 and p < size - i * 0x20000 do\n chunk_size = i * 0x20000\n chunks << [p, chunk_size]\n pp = p\n p += chunk_size\n i += 1\n end\n\n while p < size - 0x100000 do\n chunk_size = 0x100000\n chunks << [p, chunk_size]\n pp = p\n p += chunk_size\n end\n\n chunks << [p, size - p] if p < size\n\n chunks\n end", "title": "" }, { "docid": "18ef9565cce229e0d9b66ad97ed705c3", "score": "0.49417102", "text": "def cleanup(hpk)\n mbx = Mailbox.new hpk.to_b64\n results = mbx.read_all\n return unless results\n results_count = results.length\n count = results_count - 1\n results.each do |item|\n mbx.delete item[:nonce].to_b64\n assert_equal(mbx.count, count)\n count -= 1\n end\n assert_equal(mbx.count, 0)\n end", "title": "" }, { "docid": "81a799bd00a9f120e6703f101c13af8e", "score": "0.49404705", "text": "def dec_size\n @size -= 1\n end", "title": "" }, { "docid": "ea50a6ec0ca347fda470198a6b4d713c", "score": "0.49319386", "text": "def flush_all\n Log.info \"******************* Dropped messages ********************\"\n @peers.each do |id,p|\n Log.info \"Dropped message from: #{p.address} total_size: #{p.total_size} left: #{p.counter} which: #{p.buffer.keys.sort.inspect} start: #{p.start}\"\n end\n end", "title": "" }, { "docid": "1b4c859e268e6a24023a13b13b012fac", "score": "0.493188", "text": "def clean_buffers_other_than(used_keys)\n @buffer_hash.each { |key, value|\n if !used_keys.index(key) then\n if value[Rula::CONST[:buffer_has_data]] then\n Rula.log(Logger::DEBUG,\"Cleaning buffer #{key}\",self)\n @loaded_data_size -= calculate_size(value[Rula::CONST[:buffer]])\n value[Rula::CONST[:buffer]]=[]\n value[Rula::CONST[:buffer_has_data]]=false\n end\n end\n }\n @loaded_data_size = @loaded_data_size < 0 ? 0: @loaded_data_size\n end", "title": "" }, { "docid": "e734d80d8f3e06388f598a6bb663898a", "score": "0.49153423", "text": "def condense(size)\n\n end", "title": "" }, { "docid": "7e2f437e5795df3a4ee146272a4fee51", "score": "0.49040547", "text": "def get_limited_files(files, size_limit)\n ret = files.dup\n if size_limit > 0\n # Prioritize the files\n while ret.inject(0) { |tot, f| tot + f.file_size } > size_limit\n # We have too many files and need to prune some entries\n ret.delete(ret.last)\n end\n end\n ret\n end", "title": "" }, { "docid": "f6f5078c2229fa5d5f75e6c4200473cd", "score": "0.4903954", "text": "def puts_small(bytes, size)\n packet_list = API.get_midi_packet_list(bytes, size)\n API.MIDISend(@handle, @resource, packet_list)\n true\n end", "title": "" }, { "docid": "535f2e1471c43db9ca2d948c63d0c43f", "score": "0.4897041", "text": "def amountChunks\n @put.msgSize % @helo.chunkSize == 0 ? (@put.msgSize/@helo.chunkSize)-1 : @put.msgSize/@helo.chunkSize\n end", "title": "" }, { "docid": "8ad2b68b1bb505956b0cde84ddc17ab8", "score": "0.48945603", "text": "def sort_clean\n\n stats = Hash.new\n stats = DB_BKUP1.map do |dbfile|\n [dbfile, File.stat(dbfile)]\n end\n\n stats = stats.sort_by do |dbfile,stat|\n stat.mtime\n end\n\n\n################################\n=begin\nThis is cleanup, sweep sweep.\n=end\n################################\n\n oldestfile = \"#{stats.first[0]}\"\n if File.exists?(oldestfile)\n File.unlink(oldestfile)\n end\n\n onemb = 1048600.to_i\n if File.size(RUNLOG) > onemb\n File.truncate( \"#{RUNLOG}\", 0 )\n end\nend", "title": "" }, { "docid": "265d58fe80749bf88eadf62ee0dd5be0", "score": "0.48934323", "text": "def prune(target_size, max_time = nil)\n return if pruning?\n @pruning = true\n begin\n start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)\n cleanup\n instrument(:prune, target_size, from: @cache_size) do\n keys = synchronize { @data.keys }\n keys.each do |key|\n delete_entry(key, **options)\n return if @cache_size <= target_size || (max_time && Process.clock_gettime(Process::CLOCK_MONOTONIC) - start_time > max_time)\n end\n end\n ensure\n @pruning = false\n end\n end", "title": "" }, { "docid": "2c7ee9603715ff615153d2725ba892f4", "score": "0.48900908", "text": "def unprune(level)\n @sizes = (level==0 ? [@domain.length] : @sizes[0...level])\n @pruned.collect! {|value| value >= level ? MAXINT : value}\n end", "title": "" }, { "docid": "8f2482ae90cb7b415b24e27ed0bdbca8", "score": "0.48631155", "text": "def down\n \n #just to verify if there are more clobs\n #select count(*)\n #from system_lobs.lob_ids \n \n #and their dimension\n #SELECT sum(lob_length)/(1024.0*1024.0) FROM system_lobs.lob_ids\n \n end", "title": "" }, { "docid": "d2ca9a28bdfaecae3d6b3d96a3a3ffe8", "score": "0.48580736", "text": "def remove_excess_entry\n TransportImport.first.destroy if TransportImport.count > 15\n end", "title": "" }, { "docid": "5e0dd077b1bce192e4f7212caac688bd", "score": "0.4848662", "text": "def table_size\n sql = %q(\n SELECT\n c.relname AS name,\n pg_size_pretty(pg_table_size(c.oid)) AS size\n FROM\n pg_class c\n LEFT JOIN pg_namespace n ON (n.oid = c.relnamespace)\n WHERE\n n.nspname NOT IN ('pg_catalog', 'information_schema')\n AND n.nspname !~ '^pg_toast'\n AND c.relkind='r'\n ORDER BY\n pg_table_size(c.oid) DESC;\n )\n\n execute_sql(sql)\n end", "title": "" }, { "docid": "c54ac8cebb1610c0cdfe86884efcd9c8", "score": "0.48401242", "text": "def shrink(n)\n n.times do\n @h.delete(@size - 1)\n @size -= 1\n end\n end", "title": "" }, { "docid": "73dc0398de9060b381812475f23567ae", "score": "0.48332858", "text": "def number_of_words_to_exclude( size, desired = nil )\n return 0 if size <= 1 || size.class != Fixnum # if we don't have a number or enough elements, no exclusion array\n if( desired.class == Fixnum && size > desired ) # only allow desired size if provided AND it's smaller than total word array size\n desired\n else\n (1..([(size/2),5].min)).to_a.sample if size > 1 # else, let's specify an exclusion array size of at least 1 up to half the total number of words\n # up to a max of 5\n end\nend", "title": "" }, { "docid": "edbb4a0b6340dbc7085021c627ef48d9", "score": "0.48181444", "text": "def split_large_sms (message)\n arraySMS = []\n if message.length > 150 \n arraySMS = message.scan(/.{1,145}/)\n elsif message.length < 150 && message.length > 20\n arraySMS[0] = message\n else\n arraySMS[0] = message\n end\n return arraySMS\n end", "title": "" }, { "docid": "52d9cb415521da52f4ea6f77b6ee7871", "score": "0.48165762", "text": "def preserve_size\n cache.delete cache.last if count == capacity\n end", "title": "" }, { "docid": "5c3bb56dd31ba1bb9d454001d4cfb0bd", "score": "0.48157904", "text": "def table_size=(size); end", "title": "" }, { "docid": "087052d2dc93b9fd36fd04a41639a370", "score": "0.48092043", "text": "def warn_unless_size(approximate_size, options = {})\n TableWarnings.registry.add_warning self, TableWarnings::Size.new(self, approximate_size, options)\n end", "title": "" }, { "docid": "be6ba8c7da9394e13a9fd28bb2632669", "score": "0.47964722", "text": "def prune\n GDBM.open(file_path, 0664, GDBM::WRCREAT) do |index|\n index.delete_if { |key, value| Marshal.load(value).empty? }\n index.reorganize # clear up wasted disk space\n end\n end", "title": "" }, { "docid": "e278da23b8633b85582d6d7b10071f15", "score": "0.4792128", "text": "def invalid_payload_size(payload)\n size = payload_size(payload)\n size unless size < MAX_PAYLOAD_SIZE\n end", "title": "" }, { "docid": "5133d551b7bd97396a4a5cad5fd4e717", "score": "0.47916847", "text": "def check_filesize!(file)\n if file.size > max_size\n file.delete\n megabytes = max_size.to_f / 1024 / 1024\n error! 413, \"The file is too big (maximum size is #{megabytes} MB).\"\n end\n end", "title": "" }, { "docid": "5133d551b7bd97396a4a5cad5fd4e717", "score": "0.47916847", "text": "def check_filesize!(file)\n if file.size > max_size\n file.delete\n megabytes = max_size.to_f / 1024 / 1024\n error! 413, \"The file is too big (maximum size is #{megabytes} MB).\"\n end\n end", "title": "" }, { "docid": "5133d551b7bd97396a4a5cad5fd4e717", "score": "0.47916847", "text": "def check_filesize!(file)\n if file.size > max_size\n file.delete\n megabytes = max_size.to_f / 1024 / 1024\n error! 413, \"The file is too big (maximum size is #{megabytes} MB).\"\n end\n end", "title": "" }, { "docid": "5133d551b7bd97396a4a5cad5fd4e717", "score": "0.47916847", "text": "def check_filesize!(file)\n if file.size > max_size\n file.delete\n megabytes = max_size.to_f / 1024 / 1024\n error! 413, \"The file is too big (maximum size is #{megabytes} MB).\"\n end\n end", "title": "" }, { "docid": "288c884e4c5fb1ed220c5e85ed7ed28d", "score": "0.478883", "text": "def drop_policy_maximum_queue_size(opts)\n opts = check_params(opts,[:drop_policies])\n super(opts)\n end", "title": "" }, { "docid": "1a76b8f9f594a9529ebe5dcfcc58b4d0", "score": "0.4786968", "text": "def cleanup_with_limit(files, limit, &block)\n return unless files.size > limit\n\n to_remove = files[0..(files.size - limit - 1)]\n # TODO: validate here\n to_remove.each(&block)\n end", "title": "" }, { "docid": "1a76b8f9f594a9529ebe5dcfcc58b4d0", "score": "0.4786968", "text": "def cleanup_with_limit(files, limit, &block)\n return unless files.size > limit\n\n to_remove = files[0..(files.size - limit - 1)]\n # TODO: validate here\n to_remove.each(&block)\n end", "title": "" }, { "docid": "dd604f87de0d2d5195bfb051f44f2418", "score": "0.4786641", "text": "def flush_queue (queue)\n\n count = 0\n\n loop do\n\n l = get_messages queue, :timeout => 0, :count => 255\n\n break if l.length < 1\n\n l.each do |m|\n m.delete\n count += 1\n end\n end\n\n count\n end", "title": "" }, { "docid": "24202295aad35cb855dac9430d976e28", "score": "0.4784964", "text": "def deleteMessages(mbx, messages)\n halfdelete = _getHalfOfNumber(messages.length)\n half = halfdelete - 1\n 0.upto(half) do |i|\n nonce = b64enc messages[i][:nonce]\n value = mbx.delete(nonce)\n rds.decrby(@config[:total_number_of_messages], 1)\n end\n end", "title": "" }, { "docid": "f31600deaab4db5501e554bf6a9841c6", "score": "0.47830838", "text": "def reduce_max_size\n @max_size /= 2\n end", "title": "" }, { "docid": "3914cbd9fdcd59e996a65064d6e7c718", "score": "0.4782856", "text": "def remove(offset, size)\n @_buffer.remove(offset, size)\n end", "title": "" }, { "docid": "633581723cb44b5624518b6e4dfc62b6", "score": "0.4781561", "text": "def downgrade_order_size_for_all_market(order, clients)\n\t\t\tsize = clients.map { |c|\n\t\t\t\tnext nil if c.quantity_in_orderbook() != :asset\n\t\t\t\tnext c.format_size(order)\n\t\t\t}.select { |s| s != nil }.min\n\t\t\torder['s'] = size if size != nil\n\t\t\torder\n\t\tend", "title": "" }, { "docid": "51b8513bc453223fd61e617570fe3fdb", "score": "0.47799763", "text": "def limit_utf8_size(str, size)\n # Start with a string of the correct byte size, but with a possibly\n # incomplete char at the end.\n new_str = str.byteslice(0, size)\n\n # We need to force_encoding from utf-8 to utf-8 so ruby will\n # re-validate (idea from halfelf).\n until new_str[-1].force_encoding('utf-8').valid_encoding?\n # Remove the invalid char\n new_str = new_str.slice(0..-2)\n end\n new_str\n end", "title": "" }, { "docid": "21e52c5a882bbf8c62e158425f6ad388", "score": "0.47590208", "text": "def reserve_buffer(size)\n if self[:free] >= size\n true\n else\n MsgPack.msgpack_unpacker_expand_buffer(self,size)\n end\n end", "title": "" }, { "docid": "15a4af1ada1baa6225fe8136d2a0525f", "score": "0.47509187", "text": "def downloadMessages\n ary = getHpks\n total = 0\n ary.each do |hpk|\n mbx = Mailbox.new hpk\n download = mbx.read_all\n total += download.length\n deleteMessages(mbx, download)\n end\n end", "title": "" }, { "docid": "75a3bc4ede514acd159932bfb70f6f68", "score": "0.47467437", "text": "def each_chunk_byterange(str, max_bytesize_per_chunk); end", "title": "" }, { "docid": "39bf264c184fff376d0048469f1df71b", "score": "0.47449443", "text": "def solve_naked_group(size)\r\n empty_cells.each do |cell|\r\n next if cell.candidates.size != size\r\n partners = find_cells_with_candidate_subsets(cell)\r\n # puts \"Partners size: #{partners.size}\"\r\n next if partners.size != size-1\r\n partners << cell\r\n empty_cells.each do |other|\r\n next if partners.include?(other)\r\n cell.candidates.each { |x| other.eliminate(x) }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "e11c1c93b8f7be466511a3e27ab4325d", "score": "0.47388577", "text": "def prune(target_size, max_time = nil)\n return if pruning?\n @pruning = true\n begin\n start_time = Time.now\n cleanup\n instrument(:prune, target_size, :from => @cache_size) do\n keys = synchronize{ @key_access.keys.sort{|a,b| @key_access[a].to_f <=> @key_access[b].to_f} }\n keys.each do |key|\n delete_entry(key, options)\n return if @cache_size <= target_size || (max_time && Time.now - start_time > max_time)\n end\n end\n ensure\n @pruning = false\n end\n end", "title": "" }, { "docid": "9d52d6cdbfd5ece69aa5413076caacaf", "score": "0.47370046", "text": "def strip_size\n @size = params[:size] || nil\n @size = @size.split('.')[0] if !@size.nil?\n end", "title": "" }, { "docid": "a0643356e9e778c4908fecca281bed1b", "score": "0.47319633", "text": "def max_message_size\n super\n end", "title": "" }, { "docid": "6eb069598dd9d3cf3595c6829c7f1da3", "score": "0.47296172", "text": "def test_delete_small()\n\t\tCfruby::FileOps.delete(@basedir, :glob => \"README\", :smallerthan => 100, :recursive => true)\n\t\tcount = get_find_count()\n\t\tassert_equal(211-(6+6*6), count, \"#{count} files remaining after delete, expected #{211-(6+6*6)}\")\t\t\n\tend", "title": "" }, { "docid": "01b60ec690dbddfaf731778c73c7ae93", "score": "0.47283918", "text": "def specific_max_size(number); end", "title": "" }, { "docid": "3a35d01cf6db0ae35d26e36ebb2bc975", "score": "0.47281814", "text": "def resize_buffer(size)\n talk(\"RESIZE-BUFFER #{size}\")\n end", "title": "" }, { "docid": "9afb02d6358d2d9b353ed7488996a5df", "score": "0.47262165", "text": "def constrain_size(arr, size)\n arr.shift(arr.size - size) if arr && arr.size > size\n end", "title": "" }, { "docid": "f01a48f7e487b9322aa253e1e13150e1", "score": "0.47201148", "text": "def test_delete_large()\n\t\tCfruby::FileOps.delete(@basedir, :glob => \"README\", :largerthan => 100, :recursive => true)\n\t\tcount = get_find_count()\n\t\tassert_equal(211, count, \"#{count} files remaining after delete, expected 211\")\t\t\n\tend", "title": "" }, { "docid": "1dddd995c2a59f768ff2e868b02ac880", "score": "0.47193843", "text": "def break_message_into_messages(message)\n return [message] if message.length <= 160\n\n messages = []\n number_of_messages = message.length / 155 + 1\n (1..number_of_messages).each do |message_number|\n short_message = message.slice((message_number - 1) * 155, 155)\n\n short_message.prepend \"(#{message_number}/#{number_of_messages})\"\n messages.push short_message\n end\n\n return messages\n end", "title": "" } ]
0f562463d5cedc75908657f3b84f9594
Deploy the clusterwide client configuration.\n\nFor each service in the cluster, deploy the service&39;s client configuration\nto all the hosts that the service runs on.\n\nAvailable since API v2.
[ { "docid": "a408fc21785073b6b15ef8f9fbee0d3a", "score": "0.0", "text": "def api_v11_clusters_cluster_name_commands_deploy_client_config_post(cluster_name, opts = {})\n api_v11_clusters_cluster_name_commands_deploy_client_config_post_with_http_info(cluster_name, opts)\n return nil\n end", "title": "" } ]
[ { "docid": "969d80472736af37fced831c973ed7be", "score": "0.6487035", "text": "def deployClusters\n\n $cluster = @parsed_obj['environment_cluster']\n\n # for each layer in --deploy parameter.\n @opt.deploy.each do |d|\n case d\n when 'batch'\n if !@opt.nofacts\n # This is the only method using the JSON information\n # The reamin methods, puppetRunBatch, handleBatchLayer,\n # are using the mcollective discoverty feature using\n # the deployed facts. Uses the global @host_facts variable.\n deployFactsLayer 'batch'\n end\n if !@opt.norun\n # this method uses the mc discovery subsystem.\n @mchandler.puppetRunBatch $cluster, 'batch', 2\n end\n if !@opt.onlyrun\n # this method uses the mc discovery subsystem.\n @mchandler.handleBatchLayer $cluster, 'bootstrap'\n end\n when 'bus'\n if !@opt.nofacts\n deployFactsLayer 'bus'\n end\n if !@opt.norun\n @mchandler.puppetRunBatch $cluster, 'bus', 2\n end\n @mchandler.handleBusLayer $cluster, 'bootstrap'\n when 'speed'\n if !@opt.nofacts\n deployFactsLayer 'speed'\n end\n if !@opt.norun\n @mchandler.puppetRunBatch $cluster, 'speed', 2\n end\n @mchandler.handleSpeedLayer $cluster, 'bootstrap'\n when 'serving'\n if !@opt.nofacts\n deployFactsLayer 'serving'\n end\n if !@opt.norun\n @mchandler.puppetRunBatch $cluster, 'serving', 2\n end\n @mchandler.handleServingLayer $cluster, 'bootstrap'\n end\n end\n end", "title": "" }, { "docid": "ce7eafd636e26c5d648da95f693365f2", "score": "0.6174002", "text": "def cluster(cmd, registry:nil)\n puts(\":: Deploying Kubernetes Cluster...\".colorize(:light_yellow))\n proxy_export = \"[ -f /etc/profile.d/setproxy.sh ] && source /etc/profile.d/setproxy.sh\"\n elapse = Time.now\n ips = getnodes.map{|x| x.ip}\n all = cmd.include?('all')\n init = cmd.include?('init')\n config = cmd.include?('config')\n dashboard = cmd.include?('dashboard')\n helm = cmd.include?('helm')\n weave = cmd.include?('weave')\n flannel = cmd.include?('flannel')\n flannel = true if !weave\n\n # Validate host environment\n #---------------------------------------------------------------------------\n puts(\":: Validating the K8s host environment\".colorize(:cyan))\n Log.die(\"Ensure 'kubectl' is installed and on the $PATH\") unless FileUtils.exec?('kubectl')\n host_k8sver = `kubectl version --client`[/GitVersion.*v([\\d]+\\.[\\d]+\\.[\\d]+)/, 1]\n !puts(\"Kubectl needs to be version #{@k8sver} or higher\".colorize(:red)) and\n exit unless Gem::Version.new(host_k8sver) >= Gem::Version.new(@k8sver)\n puts(\"Host K8s Version: #{host_k8sver}\".colorize(:green))\n\n Log.die(\"Ensure 'helm' is installed and on the path\") unless FileUtils.exec?('helm')\n host_helmver = `helm version --client`[/\\d+\\.\\d+\\.\\d+/]\n !puts(\"Helm needs to be version #{@helmver} or higher\".colorize(:red)) and\n exit unless Gem::Version.new(host_helmver) >= Gem::Version.new(@helmver)\n puts(\"Host Helm Version: #{host_helmver}\".colorize(:green))\n\n # Validate node environment\n #---------------------------------------------------------------------------\n puts(\":: Validating the K8s node environment\".colorize(:cyan))\n node_k8sver = nil\n puts(\"Nodes: #{ips * ', '}\".colorize(:cyan))\n Net::SSH.start(ips.first, @user, password:@pass, verify_host_key: :never){|ssh|\n node_k8sver = ssh.exec!(\"kubectl version --client\")[/GitVersion.*v([\\d]+\\.[\\d]+\\.[\\d]+)/, 1]\n !puts(\"Node K8s needs to be version #{@k8sver} or higher\".colorize(:red)) and\n exit unless Gem::Version.new(node_k8sver) >= Gem::Version.new(@k8sver)\n puts(\"Node K8s Version: #{node_k8sver}\".colorize(:green))\n\n node_helmver = ssh.exec!(\"helm version --client\")[/SemVer.*v([\\d]+\\.[\\d]+\\.[\\d]+)/, 1]\n !puts(\"Node Helm needs to be version #{@helmver} or higher\".colorize(:red)) and\n exit unless Gem::Version.new(node_helmver) >= Gem::Version.new(@helmver)\n puts(\"Node Helm Version: #{node_helmver}\".colorize(:green))\n }\n\n # (Idempotent) Configure nodes for clustering\n # ==========================================================================\n threads = []\n ips.each{|ip| threads << Thread.new{\n Net::SSH.start(ip, @user, password:@pass, verify_host_key: :never) do |ssh|\n puts(\":: Configure nodes for clustering\".colorize(:cyan))\n\n # Configure journald for persistent storage\n journald_conf = '/etc/systemd/journald.conf'\n if not ssh.exec!(\"cat #{journald_conf}\").include?('persistent')\n ssh.exec!(\"sudo sed -i -e 's/.*\\\\(Storage=\\\\).*/\\\\1persistent/' #{journald_conf}\")\n ssh.exec!(\"sudo systemctl restart systemd-journald\")\n puts(\"#{ip}: Configured node journald...done\".colorize(:cyan))\n else\n puts(\"#{ip}: Configure node journald...skipped\".colorize(:cyan))\n end\n\n # Configure kubelet node ip\n kubelet = '/etc/default/kubelet'\n if not ssh.exec!(\"cat #{kubelet}\").include?(ip)\n args = [\"--node-ip=#{ip}\"] * ' '\n ssh.exec!(\"sudo sed -i -e 's/\\\\(KUBELET_EXTRA_ARGS=\\\\)\\\\(.*$\\\\)/\\\\1#{args} \\\\2/' #{kubelet}\")\n ssh.exec!(\"sudo systemctl restart kubelet\")\n puts(\"#{ip}: Configured Kubelet private network ip...done\".colorize(:cyan))\n else\n puts(\"#{ip}: Configure Kubelet private network ip...skipped\".colorize(:cyan))\n end\n\n # Configure kernel for Elasticsearch\n sysctl_conf = '/etc/sysctl.d/10-cyberlinux.conf'\n if not ssh.exec!(\"cat #{sysctl_conf}\").include?('max_map_count')\n ssh.exec!(\"echo 'vm.max_map_count = 262144' | sudo tee -a #{sysctl_conf}'\")\n ssh.exec!(\"sudo sysctl -w vm.max_map_count=262144\")\n else\n puts(\"#{ip}: Configure kernel params...skipped\".colorize(:cyan))\n end\n\n # Optionally - configure private registry\n# if registry\n# docker_opts = [ \"--registry-mirror=http://#{registry}\", \"--insecure-registry #{registry}\" ]\n# override_conf = '/etc/systemd/system/docker.service.d/override.conf'\n# if not ssh.exec!(\"[ -e #{override_conf} ] && echo 'exists'\").include?('exists')\n#\n# # Configure kubernetes for private registry\n# docker_conf = \"{\\\\\\\"auths\\\\\\\":{\\\\\\\"#{registry}\\\\\\\":{\\\\\\\"auth\\\\\\\":\\\\\\\"YW5vbnltb3VzOmFub255bW91cw==\\\\\\\"}}}\"\n# ssh.exec!(\"sudo bash -c 'mkdir -p /root/.docker'\")\n# ssh.exec!(\"sudo bash -c 'echo \\\"#{docker_conf}\\\" > /root/.docker/config.json'\")\n#\n# # Configure docker for private registry\n# ssh.exec!(\"sudo bash -c 'echo \\\"[Service]\\\" > #{override_conf}'\")\n# ssh.exec!(\"sudo bash -c 'echo \\\"ExecStart=\\\" >> #{override_conf}'\")\n# ssh.exec!(\"sudo bash -c 'echo \\\"ExecStart=/usr/bin/dockerd #{docker_opts * ' '} -H fd://\\\" >> #{override_conf}'\")\n# ssh.exec!(\"sudo systemctl daemon-reload\")\n# ssh.exec!(\"sudo systemctl restart docker\")\n# puts(\"#{ip}: Configured Docker overrides...done\".colorize(:cyan))\n# else\n# puts(\"#{ip}: Configure Docker overrides...skipped\".colorize(:cyan))\n# end\n# end\n end\n }}\n threads.each{|x| x.join}\n\n # (Idempotent) Initialize cluster via kubeadm\n # ==========================================================================\n # https://kubernetes.io/docs/getting-started-guides/kubeadm\n # https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-init/\n # https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-init/#config-file\n # --------------------------------------------------------------------------\n join = nil\n if all or init\n Net::SSH.start(ips.first, @user, password:@pass, verify_host_key: :never){|ssh|\n if not ssh.exec!(\"docker ps\").include?(\"apiserver\")\n puts(\":: Initialize master node '#{ips.first}'\".colorize(:cyan))\n ssh.exec!(\"mkdir -p ~/manifest\")\n\n # Cluster cidr is required for flannel and some other pod networks.\n # https://github.com/coreos/flannel/blob/master/Documentation/kubernetes.md\n # It is the same cidr range that gets assigned to --cluster-cidr if you check with\n # 'kubectl cluster-info dump | grep cidr' and thus the same value that should be used for\n # the kube-proxy --cluster-cidr argument as well.\n cluster_cidr = \"10.32.0.0/12\" if weave\n cluster_cidr = \"10.244.0.0/16\" if flannel\n\n # Execute kubeadm with config template\n if config\n FileUtils.cp('template/kubeadm.tpl', 'manifest/kubeadm.yaml')\n FileUtils.resolve('manifest/kubeadm.yaml', {\n advertise_address: ips.first,\n kubernetes_version: @k8sver,\n kube_proxy_mode: \"iptables\",\n cgroup_driver: \"cgroupfs\", # kubeadm default: cgroupfs\n cluster_domain: \"cluster.local\", # kubeadm default: cluster.local\n cluster_dns: \"10.96.0.10\", # kubeadm default: 10.96.0.10\n service_cidr: \"10.96.0.0/12\", # kubeadm default: 10.96.0.0/12\n cluster_cidr: cluster_cidr # cidr for pod networking\n })\n Net::SCP.upload!(ips.first, @user, 'manifest/kubeadm.yaml', 'manifest/kubeadm.yaml',\n ssh:{verify_host_key: :never, password: @pass})\n cmd = \"sudo kubeadm init --config manifest/kubeadm.yaml\"\n else\n cmd = \"sudo kubeadm init --kubernetes-version=v#{@k8sver} \"\n cmd += \"--apiserver-advertise-address=#{ips.first} \"\n cmd += \"--pod-network-cidr=#{cluster_cidr}\"\n end\n\n # Capture join for worker nodes\n # e.g. kubeadm join 192.168.56.10:6443 --token u6wor2.6kinrlvcbtxcoqo4 --discovery-token-ca-cert-hash\n # sha256:1112aafe50e27d54bccfd45d956f658a18b05e8b0ccf90c264ec17b026d01a8f\n ssh.exec!(cmd){|c,s,o|\n puts(o)\n join = o.split(\"\\n\").find{|x| x.include?(\"kubeadm join\")}.strip if o.include?(\"kubeadm join\")\n }\n\n # Setup kubectl on master node for both vagrant and root users\n ssh.exec!(\"mkdir -p ~/.kube\")\n ssh.exec!(\"sudo mkdir -p /root/.kube\")\n ssh.exec!(\"sudo cp /etc/kubernetes/admin.conf /root/.kube/config\")\n ssh.exec!(\"sudo cp /etc/kubernetes/admin.conf ~/.kube/config\")\n ssh.exec!(\"sudo chown $(id -u):$(id -g) ~/.kube/config\")\n ssh.exec!(\"kubectl config use-context kubernetes-admin@kubernetes\")\n ssh.exec!(\"sudo kubectl config use-context kubernetes-admin@kubernetes\")\n ssh.exec!(\"kubectl cluster-info\"){|c,s,o|puts(o)}\n\n # Disable RBAC\n # Bottom of https://kubernetes.io/docs/admin/authorization/rbac\n puts(\"Disabling RBAC...\".colorize(:cyan))\n ssh.exec!(\"kubectl create clusterrolebinding permissive-binding --clusterrole=cluster-admin --user=admin --user=kubelet --group=system:serviceaccounts\"){|c,s,o|puts(o)}\n\n # Taint master node to allow pods to be scheduled on it\n # Check current taints in Taints section: kubectl describe node\n puts(\"Tainting the master node to allow pods to be scheduled on it\".colorize(:cyan))\n ssh.exec!(\"kubectl taint nodes --all node-role.kubernetes.io/master-\"){|c,s,o|puts(o)}\n\n # Configure kube-proxy\n # --------------------------------------------------------------------\n # https://kubernetes.io/docs/reference/command-line-tools-reference/kube-proxy/\n # --------------------------------------------------------------------\n # Note: as kube-proxy runs as a pod created by the kubeadm process it is impossible to\n # configure it as all documentation suggests with --<param> values nor with config files\n # for kube-proxy e.g. /var/lib/kub-proxy/config.conf. The only way to configure it is to\n # launch kubeadm with the --config param and pass in a static kubeadm config with the\n # .kubeProxy.config.mode and .kubeProxy.config.clusterCIDR variables changed as deired.\n # Alternatively one can modify the kube-proxy manifest post deploy and restart the pod.\n # --------------------------------------------------------------------\n # See configs kube-proxy is currently using:\n # kubectl -n kube-system get ds kube-proxy -o json | jq '.spec.template.spec.containers[0].command'\n # --------------------------------------------------------------------\n if !config\n puts(\"Configure kube-proxy...\".colorize(:cyan))\n get_kube_proxy = \"kubectl -n kube-system get ds kube-proxy -o json\"\n\n # Which proxy mode to use 'userspace' (older), 'iptables' (faster), 'ipvs' (experimental)\n mod_kube_proxy = \" | jq '.spec.template.spec.containers[0].command |= .+ [\\\"--proxy-mode=iptables\\\"]'\"\n\n # CIDR range of pods in cluster. Essential to set so kube-proxy knows what and where to proxy\n mod_kube_proxy += \" | jq '.spec.template.spec.containers[0].command |= .+ [\\\"--cluster-cidr=#{cluster_cidr}\\\"]'\"\n\n # Update kube-proxy deployment configuration and restart the service\n set_kube_proxy = \"#{get_kube_proxy} #{mod_kube_proxy} | kubectl apply -f -\"\n puts(\"exec: #{set_kube_proxy}\")\n ssh.exec!(set_kube_proxy){|c,s,o|puts(o)}\n ssh.exec!(\"kubectl -n kube-system delete po -l 'k8s-app=kube-proxy'\"){|c,s,o|puts(o)}\n end\n\n # Deploy Pod networking\n # CoreDNS will be in a pending state until pod networking is deployed\n # CoreDNS must be running before joining any worker nodes to the cluster\n # https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/#pod-network\n # kubectl -n kube-system get ds kube-flannel-ds -o json | '.spec.template.spec.containers[0].command'\"\n puts(\"Installing pod networking\".colorize(:cyan))\n if weave\n podnet = \"https://cloud.weave.works/k8s/net?k8s-version=#{@k8sver}\"\n elsif flannel\n FileUtils.cp('template/flannel.tpl', 'manifest/flannel.yaml')\n FileUtils.resolve('manifest/flannel.yaml', {\n iface: \"enp0s8\", # the interface to use for inter-host communication\n backend_type: \"vxlan\", # default: vxlan - backend type\n cluster_cidr: cluster_cidr # default: 10.244.0.0/16 - cidr for pod networking\n })\n Net::SCP.upload!(ips.first, @user, 'manifest/flannel.yaml', 'manifest/flannel.yaml',\n ssh:{verify_host_key: :never, password: @pass})\n podnet = \"~/manifest/flannel.yaml\"\n end\n ssh.exec!(\"#{proxy_export}; kubectl apply -f #{podnet}\"){|c,s,o|puts(o)}\n podready!('coredns', ssh:ssh)\n end\n }\n end\n\n # (Idempotent) Configure slaves to join cluster\n #---------------------------------------------------------------------------\n if all or init\n nodes_to_join = []\n Net::SSH.start(ips.first, @user, password:@pass, verify_host_key: :never){|ssh|\n puts(\":: Determine nodes to join cluster...\".colorize(:cyan))\n output = getpods(ssh:ssh)\n nodes_to_join = ips[1..-1].select{|x| !output.include?(x)}\n puts(nodes_to_join)\n }\n nodes_to_join.each{|ip|\n Net::SSH.start(ip, @user, password:@pass, verify_host_key: :never){|ssh|\n puts(\"#{ip.colorize(:cyan)}: Joining cluster\")\n puts(\"#{ip.colorize(:cyan)}: sudo #{join}\")\n ssh.exec!(\"sudo #{join}\"){|c,s,o|puts(o)}\n }\n }\n end\n\n # (Idempotent) Install dashboard and helm\n #---------------------------------------------------------------------------\n Net::SSH.start(ips.first, @user, password:@pass, verify_host_key: :never){|ssh|\n if (all || init) && (dashboard || helm)\n podready!('etcd', ssh:ssh)\n podready!('apiserver', ssh:ssh)\n podready!('controller', ssh:ssh)\n podready!('scheduler', ssh:ssh)\n end\n\n # Initialize/update helm\n if all or helm\n if not getpods(pod:'tiller', ssh:ssh)\n puts(\"#{ips.first}: Initializing helm\".colorize(:cyan))\n ssh.exec!(\"#{proxy_export}; helm init\"){|c,s,o|puts(o)}\n ssh.exec!(\"#{proxy_export}; helm repo update\"){|c,s,o|puts(o)}\n else\n puts(\"#{ips.first}: Initializing/updating helm...skipped\".colorize(:cyan))\n end\n end\n\n # Install dashboard\n # debug dns: kubectl run -ti --image=busybox -- sh\n # nslookup kubernetes.default\n if all or dashboard\n if not getpods(pod:'dashboard', ssh:ssh)\n puts(\"#{ips.first}: Installing dashboard\".colorize(:cyan))\n url = \"https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml\"\n puts(ssh.exec!(\"kubectl create -f #{url}\"))\n puts(\"Access Dashboard:\".colorize(:cyan))\n puts(\"run: kubectl proxy\".colorize(:cyan))\n puts(\"#{'Navigate to:'.colorize(:cyan)} http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/\")\n else\n puts(\"#{ips.first}: Installing dashboard...skipped\".colorize(:cyan))\n end\n end\n podready!('tiller', ssh:ssh) if all or helm\n podready!('dashboard', ssh:ssh) if all or dashboard\n }\n\n puts(\"Cluster creation took: #{Time.now - elapse} sec\".colorize(:light_yellow))\n\n # Configure local kubectl\n kube_conf_dir = File.expand_path(\"~/.kube\")\n FileUtils.mkdir_p(kube_conf_dir) if Dir.exists?(kube_conf_dir)\n kube_conf = File.join(kube_conf_dir, \"config.kubinator\")\n FileUtils.rm_rf(kube_conf)\n Net::SCP.download!(ips.first, @user, '.kube/config', kube_conf, ssh:{verify_host_key: :never, password: @pass})\n Sys.exec(\"ln -sf ~/.kube/config.kubinator ~/.kube/config\")\n puts(\"#{'-' * 80}\".colorize(:cyan))\n Sys.exec(\"kubectl get po --all-namespaces -o wide\")\n end", "title": "" }, { "docid": "6d1800a65553157bedbed14b59549c5a", "score": "0.6112498", "text": "def api_v11_clusters_cluster_name_services_service_name_commands_deploy_client_config_post_with_http_info(service_name, cluster_name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DefaultApi#api_v11_clusters_cluster_name_services_service_name_commands_deploy_client_config_post ...\"\n end\n \n # verify the required parameter 'service_name' is set\n fail \"Missing the required parameter 'service_name' when calling api_v11_clusters_cluster_name_services_service_name_commands_deploy_client_config_post\" if service_name.nil?\n \n # verify the required parameter 'cluster_name' is set\n fail \"Missing the required parameter 'cluster_name' when calling api_v11_clusters_cluster_name_services_service_name_commands_deploy_client_config_post\" if cluster_name.nil?\n \n # resource path\n path = \"/api/v11/clusters/{clusterName}/services/{serviceName}/commands/deployClientConfig\".sub('{format}','json').sub('{' + 'serviceName' + '}', service_name.to_s).sub('{' + 'clusterName' + '}', cluster_name.to_s)\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_clusters_cluster_name_services_service_name_commands_deploy_client_config_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "5cc3b2a0e49131f8baab37ce7ecc19dd", "score": "0.6054546", "text": "def provision_cluster(name, config)\n resource_group_name = name\n\n # @step retrieve the kubeconfig - I HATE everything about Azure!!\n packed = @containers.managed_clusters.list_cluster_admin_credentials(resource_group_name, name)\n kc = YAML.safe_load(packed.kubeconfigs.first.value.pack('c*'))\n\n ca = kc['clusters'].first['cluster']['certificate-authority-data']\n endpoint = URI(kc['clusters'].first['cluster']['server']).hostname\n\n # @step: provision a kubernetes client for this cluster\n kube = HubClustersCreator::Kube.new(endpoint,\n client_certificate: kc['users'].first['user']['client-certificate-data'],\n client_key: kc['users'].first['user']['client-key-data'])\n\n info \"waiting for the kubeapi to become available at: #{endpoint}\"\n kube.wait_for_kubeapi\n\n # @step: provision the bootstrap\n info \"attempting to bootstrap the cluster: #{name}\"\n result = HubClustersCreator::Providers::Bootstrap.new(name, 'aks', kube, config).bootstrap\n\n {\n cluster: {\n ca: ca,\n endpoint: \"https://#{endpoint}\",\n service_account: 'sysadmin',\n service_account_name: 'sysadmin',\n service_account_namespace: 'kube-system',\n service_account_token: Base64.decode64(kube.account('sysadmin'))\n },\n config: config,\n services: result\n }\n end", "title": "" }, { "docid": "915f825651711630c1e51026c1680e77", "score": "0.6050224", "text": "def configure_cloud\n message \"Configuring master\"\n build_and_send_config_files_in_temp_directory\n remote_configure_instances\n \n nodes.each do |node|\n node.configure\n end \n end", "title": "" }, { "docid": "6aef4e3ebaf5ee7849d05e0f2bd10abf", "score": "0.6032556", "text": "def deploy_client\n until(@current_client.done?)\n @current_client.next!\n end\n end", "title": "" }, { "docid": "c0d3e76e4d45f717f87a46603dd9168d", "score": "0.59806186", "text": "def api_v11_clusters_cluster_name_commands_deploy_client_config_post_with_http_info(cluster_name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DefaultApi#api_v11_clusters_cluster_name_commands_deploy_client_config_post ...\"\n end\n \n # verify the required parameter 'cluster_name' is set\n fail \"Missing the required parameter 'cluster_name' when calling api_v11_clusters_cluster_name_commands_deploy_client_config_post\" if cluster_name.nil?\n \n # resource path\n path = \"/api/v11/clusters/{clusterName}/commands/deployClientConfig\".sub('{format}','json').sub('{' + 'clusterName' + '}', cluster_name.to_s)\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_clusters_cluster_name_commands_deploy_client_config_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "7e4358a1e778f086810f1e8b5e9015bd", "score": "0.5978855", "text": "def deploy()\n connection.node_clusters.deploy(uuid).tap{ self.forget }\n end", "title": "" }, { "docid": "11676e29e96419a6de710c14aca990a9", "score": "0.59402555", "text": "def deploy\n update_repositories\n sync_service_environment_files\n # deploy_services\n response\n end", "title": "" }, { "docid": "7429408ef0d0edcf653c38a725f43bb9", "score": "0.59027183", "text": "def api_v11_clusters_cluster_name_commands_deploy_cluster_client_config_post_with_http_info(cluster_name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DefaultApi#api_v11_clusters_cluster_name_commands_deploy_cluster_client_config_post ...\"\n end\n \n # verify the required parameter 'cluster_name' is set\n fail \"Missing the required parameter 'cluster_name' when calling api_v11_clusters_cluster_name_commands_deploy_cluster_client_config_post\" if cluster_name.nil?\n \n # resource path\n path = \"/api/v11/clusters/{clusterName}/commands/deployClusterClientConfig\".sub('{format}','json').sub('{' + 'clusterName' + '}', cluster_name.to_s)\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_clusters_cluster_name_commands_deploy_cluster_client_config_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "57a9171d969d2962f84b47cf1be65877", "score": "0.58850306", "text": "def perform\n validate_system_config\n\n deployment_name = \"#{system_config.system_name}-core\"\n\n manifest = base_manifest(\n deployment_name,\n bosh_config.target_uuid,\n system_config.bosh_provider,\n system_config.system_name,\n system_config.release_name,\n system_config.release_version,\n system_config.stemcell_name,\n system_config.stemcell_version,\n cloud_properties_for_server_flavor(system_config.core_server_flavor),\n system_config.core_ip,\n system_config.root_dns,\n system_config.admin_emails,\n system_config.common_password,\n system_config.common_persistent_disk,\n system_config.security_group\n )\n\n dea_config.build_into_manifest(manifest)\n system_config.services.each do |service_config|\n service_config.build_into_manifest(manifest)\n end\n\n chdir system_config.system_dir do\n mkdir_p(\"deployments\")\n File.open(\"deployments/#{system_config.system_name}-core.yml\", \"w\") do |file|\n file << manifest.to_yaml\n end\n end\n end", "title": "" }, { "docid": "d13005b603fafe2a31229eecbb8b2fd3", "score": "0.58524877", "text": "def getClusterInfo\n require 'rest_client'\n require 'uri'\n\n if @role.nil? and !current_actor.superadmin\n json_response({ message: \"You don't have permission to view the clusters in this project\" }, :unauthorized)\n return\n end\n\n # Env variables for Manager host and port\n serviceManagerHost = Settings.service_manager_host\n serviceManagerPort = Settings.service_manager_port.to_s\n serviceManagerURI = 'http://' + serviceManagerHost + ':' + serviceManagerPort + '/v1/swarm'\n\n # Create request for Service Manager\n stack = {\n 'engine-url' => @cluster.endpoint,\n 'ca-cert' => @cluster.ca,\n 'cert' => @cluster.cert,\n 'cert-key' => @cluster.key\n }.to_json\n\n begin\n response = RestClient.post(\n serviceManagerURI,\n stack,\n 'Accept' => 'application/json',\n 'Content-Type' => 'application/json'\n )\n puts \"Deploy Response: \" + response\n json_response(response, 200)\n rescue Exception => e\n # If error, respond with it\n puts e\n json_response({message: e}, :unprocessable_entity)\n end\n end", "title": "" }, { "docid": "32ca19211ccf77c9e22cac9069680387", "score": "0.5846413", "text": "def configure_ai_client_services(client_arch,publisher_host,publisher_port,service_name)\n puts\n puts \"You will be presented with a set of questions followed by the default output\"\n puts \"If you are happy with the default output simply hit enter\"\n puts\n service_list = []\n # Populate questions for AI manifest\n populate_ai_manifest_questions(publisher_host,publisher_port)\n # Process questions\n process_questions(service_name)\n # Set name of AI manifest file to create and import\n if service_name.match(/i386|sparc/)\n service_list[0] = service_name\n else\n service_list[0] = service_name+\"_i386\"\n service_list[1] = service_name+\"_sparc\"\n end\n service_list.each do |temp_name|\n output_file = $work_dir+\"/\"+temp_name+\"_ai_manifest.xml\"\n # Create manifest\n create_ai_manifest(output_file)\n # Import AI manifest\n import_ai_manifest(output_file,temp_name)\n end\n return\nend", "title": "" }, { "docid": "6062b936321ee4f3bfd5cacb77328236", "score": "0.5835413", "text": "def cloud_platform_cluster_body(**options)\n {\n \"name\": options[:name] || 'string',\n \"description\": options[:description] || 'string',\n \"initialNodeCount\": options[:initialNodeCount] || 'number',\n \"masterAuth\": {\n \"username\": options[:username] || 'string',\n \"password\": options[:password] || 'string',\n \"clusterCaCertificate\": options[:clusterCaCertificate] || load_sample_cert,\n \"clientCertificate\": options[:clientCertificate] || 'string',\n \"clientKey\": options[:clientKey] || 'string'\n },\n \"loggingService\": options[:loggingService] || 'string',\n \"monitoringService\": options[:monitoringService] || 'string',\n \"network\": options[:network] || 'string',\n \"clusterIpv4Cidr\": options[:clusterIpv4Cidr] || 'string',\n \"subnetwork\": options[:subnetwork] || 'string',\n \"enableKubernetesAlpha\": options[:enableKubernetesAlpha] || 'boolean',\n \"labelFingerprint\": options[:labelFingerprint] || 'string',\n \"selfLink\": options[:selfLink] || 'string',\n \"zone\": options[:zone] || 'string',\n \"endpoint\": options[:endpoint] || 'string',\n \"initialClusterVersion\": options[:initialClusterVersion] || 'string',\n \"currentMasterVersion\": options[:currentMasterVersion] || 'string',\n \"currentNodeVersion\": options[:currentNodeVersion] || 'string',\n \"createTime\": options[:createTime] || 'string',\n \"status\": options[:status] || 'RUNNING',\n \"statusMessage\": options[:statusMessage] || 'string',\n \"nodeIpv4CidrSize\": options[:nodeIpv4CidrSize] || 'number',\n \"servicesIpv4Cidr\": options[:servicesIpv4Cidr] || 'string',\n \"currentNodeCount\": options[:currentNodeCount] || 'number',\n \"expireTime\": options[:expireTime] || 'string'\n }\n end", "title": "" }, { "docid": "770e89f28297b938f60aa88f060fe006", "score": "0.5789393", "text": "def deploy\n require 'rest_client'\n require 'uri'\n\n if (@role.nil? or !(@role.services_permissions)) and !current_actor.superadmin\n json_response({ message: \"You don't have permission to deploy services in this project\" }, :unauthorized)\n return\n end\n\n # Env variables for Manager host and port\n serviceManagerHost = Settings.service_manager_host\n serviceManagerPort = Settings.service_manager_port.to_s\n serviceManagerURI = 'http://' + serviceManagerHost + ':' + serviceManagerPort + '/v1/stack'\n\n # Service name in query\n serviceName = params[\"service_name\"]\n service = Service.find(params[\"service_id\"])\n if service.nil? then\n return\n end\n\n # Find Service type to retrieve deploy template\n serviceType = ServiceType.find(service.service_type_id)\n serviceTypeName = serviceType.name\n serviceTypeVersion = serviceType.version\n composeData = serviceType.deploy_template\n\n # Getting external files needed by the compose\n externalFiles = []\n if !serviceType.local_path.nil? && serviceType.local_path != ''\n for path in Dir['./' + serviceType.local_path + '/*']\n externalFileName = File.basename(path)\n if (externalFileName != \"docker-compose.yml\" && externalFileName != \"mastermind.yml\" && !externalFileName.end_with?('.md'))\n externalFileContents = File.read(path)\n externalFiles.append({\"#{externalFileName}\" => externalFileContents})\n end\n end\n end\n\n # Making env variable string for Service Manager (YAML format)\n envVariables = \"\"\n begin\n serviceConf = JSON.parse(service.configuration)\n serviceConf.each do |k, v|\n envVariables = envVariables + k + \": \" + v.to_s + \"\\n\"\n end\n rescue JSON::ParserError\n json_response({message: \"Invalid configuration\"}, :unprocessable_entity)\n return\n end\n envVariables = envVariables.chomp(\"\\n\")\n\n # Preparing message for Service Manager\n stack = {\n 'name' => serviceName,\n 'engine-url' => @cluster.endpoint,\n 'compose-file' => composeData,\n 'compose-vars' => envVariables,\n 'external_files' => externalFiles,\n 'ca-cert' => @cluster.ca,\n 'cert' => @cluster.cert,\n 'cert-key' => @cluster.key\n }.to_json\n\n begin\n response = RestClient.post(\n serviceManagerURI,\n stack,\n 'Accept' => 'application/json',\n 'Content-Type' => 'application/json'\n )\n puts \"Deploy Response: \" + response\n json_response(response, :created)\n # Update service as Active if successfully deployed\n # TODO: Perhaps make a better check\n service.update({endpoint: URI.parse(@cluster.endpoint).host, status: \"Active\", docker_service_id: serviceName})\n rescue Exception => e\n # If error, return it to the client\n puts e\n json_response({message: e}, :unprocessable_entity)\n end\n end", "title": "" }, { "docid": "be597ed031faec3ae74866a7258575f0", "score": "0.57614076", "text": "def run\n apply_cli_options!\n # this is where cloudy stuff would go...\n prepare_config\n prepare_installers\n\n transport.connect do |session|\n ui.msg( \"Installing config files\" )\n config_generator.install_config(session)\n ui.msg( \"Executing installer...\" )\n installer.install(session)\n config_generator.run_chef(session, installer)\n end\n end", "title": "" }, { "docid": "6634166e1a369b94bf43e1665fdbf322", "score": "0.5718965", "text": "def create(state)\n debug format(\"Starting kitchen-vcenter %s\", ::KitchenVcenter::VERSION)\n\n save_and_validate_parameters\n connect\n\n # Use the root resource pool of a specified cluster, if any\n if config[:cluster].nil?\n # Find the first resource pool on any cluster\n config[:resource_pool] = get_resource_pool(config[:resource_pool])\n else\n cluster = get_cluster(config[:cluster])\n root_pool = cluster.resource_pool\n\n if config[:resource_pool].nil?\n config[:resource_pool] = root_pool\n else\n rp_api = VSphereAutomation::VCenter::ResourcePoolApi.new(api_client)\n raise_if_unauthenticated rp_api, \"checking for resource pools\"\n\n found_pool = nil\n pools = rp_api.get(root_pool).value.resource_pools\n pools.each do |pool|\n name = rp_api.get(pool).value.name\n found_pool = pool if name == config[:resource_pool]\n end\n\n raise_if_missing found_pool, format(\"Resource pool `%s` not found on cluster `%s`\", config[:resource_pool], config[:cluster])\n\n config[:resource_pool] = found_pool\n end\n end\n\n # Check that the datacenter exists\n dc_folder = File.dirname(config[:datacenter])\n dc_folder = nil if dc_folder == \".\"\n dc_name = File.basename(config[:datacenter])\n datacenter_exists?(dc_folder, dc_name)\n\n # Get datacenter and cluster information\n datacenter = get_datacenter(dc_folder, dc_name)\n cluster_id = get_cluster_id(config[:cluster])\n\n # Find the identifier for the targethost to pass to rbvmomi\n config[:targethost] = get_host(config[:targethost], datacenter, cluster_id)\n\n # Check if network exists, if to be changed\n config[:networks].each { |network| network_exists?(network[:name]) }\n\n # Same thing needs to happen with the folder name if it has been set\n unless config[:folder].nil?\n config[:folder] = {\n name: config[:folder],\n id: get_folder(config[:folder], \"VIRTUAL_MACHINE\", datacenter),\n }\n end\n\n # Check for valid tags before cloning\n vm_tags = map_tags(config[:tags])\n\n # Allow different clone types\n config[:clone_type] = :linked if config[:clone_type] == \"linked\"\n config[:clone_type] = :instant if config[:clone_type] == \"instant\"\n\n # Create a hash of options that the clone requires\n options = {\n vm_name: config[:vm_name],\n targethost: config[:targethost],\n poweron: config[:poweron],\n template: config[:template],\n datacenter: config[:datacenter],\n folder: config[:folder],\n resource_pool: config[:resource_pool],\n clone_type: config[:clone_type].to_sym,\n networks: config[:networks],\n interface: config[:interface],\n wait_timeout: config[:vm_wait_timeout],\n wait_interval: config[:vm_wait_interval],\n vm_customization: config[:vm_customization],\n guest_customization: config[:guest_customization],\n active_discovery: config[:active_discovery],\n active_discovery_command: config[:active_discovery_command],\n vm_os: config[:vm_os],\n vm_username: config[:vm_username],\n vm_password: config[:vm_password],\n vm_win_network: config[:vm_win_network],\n transform_ip: config[:transform_ip],\n benchmark: config[:benchmark],\n benchmark_file: config[:benchmark_file],\n }\n\n begin\n # Create an object from which the clone operation can be called\n new_vm = Support::CloneVm.new(connection_options, options)\n new_vm.clone\n\n state[:hostname] = new_vm.ip\n state[:vm_name] = new_vm.vm_name\n\n rescue # Kitchen::ActionFailed => e\n if config[:vm_rollback] == true\n error format(\"Rolling back VM `%s` after critical error\", config[:vm_name])\n\n # Inject name of failed VM for destroy to work\n state[:vm_name] = config[:vm_name]\n\n destroy(state)\n end\n\n raise\n end\n\n if vm_tags\n debug format(\"Setting tags on machine: `%s`\", vm_tags.keys.join(\"`, `\"))\n\n tag_service = VSphereAutomation::CIS::TaggingTagAssociationApi.new(api_client)\n raise_if_unauthenticated tag_service, \"connecting to tagging service\"\n\n request_body = {\n object_id: {\n id: get_vm(config[:vm_name]).vm,\n type: \"VirtualMachine\",\n },\n tag_ids: vm_tags.values,\n }\n tag_service.attach_multiple_tags_to_object(request_body)\n end\n end", "title": "" }, { "docid": "52124571ee7dd99751ed9576b4444b6f", "score": "0.5696356", "text": "def create(name, config)\n # @step: build the paramaters\n parameters = [\n { parameter_key: 'AvailabilityZones', parameter_value: config[:availability_zones] },\n { parameter_key: 'BucketName', parameter_value: @templates_bucket },\n { parameter_key: 'BucketVersion', parameter_value: @templates_version },\n { parameter_key: 'ClusterAutoScaler', parameter_value: 'Enabled' },\n { parameter_key: 'ClusterName', parameter_value: name },\n { parameter_key: 'KeyPairName', parameter_value: config[:ssh_keypair] },\n { parameter_key: 'KubernetesVersion', parameter_value: config[:version] },\n { parameter_key: 'NodeGroupName', parameter_value: 'compute' },\n { parameter_key: 'NodeInstanceType', parameter_value: config[:machine_type] },\n { parameter_key: 'NodeVolumeSize', parameter_value: config[:disk_size_gb].to_s },\n { parameter_key: 'NumberOfAZs', parameter_value: config[:availability_zones].split(',').size.to_s },\n { parameter_key: 'NumberOfNodes', parameter_value: config[:size].to_s },\n { parameter_key: 'PrivateSubnet1CIDR', parameter_value: config[:private_subnet1_cidr] },\n { parameter_key: 'PrivateSubnet2CIDR', parameter_value: config[:private_subnet2_cidr] },\n { parameter_key: 'PrivateSubnet3CIDR', parameter_value: config[:private_subnet3_cidr] },\n { parameter_key: 'PublicSubnet1CIDR', parameter_value: config[:public_subnet1_cidr] },\n { parameter_key: 'PublicSubnet2CIDR', parameter_value: config[:public_subnet2_cidr] },\n { parameter_key: 'PublicSubnet3CIDR', parameter_value: config[:public_subnet3_cidr] },\n { parameter_key: 'RemoteAccessCIDR', parameter_value: '0.0.0.0/0' },\n { parameter_key: 'VPCCIDR', parameter_value: config[:network] }\n ]\n\n # @step: provision the cloudformation stacks\n stack_name = 'aws-cluster'\n info \"provisioning the cloudFormation: #{stack_name}\"\n info \"using the template from: #{template_path(stack_name)}\"\n\n outputs = cloudformation(name, template_url: template_path(stack_name), parameters: parameters)\n\n info 'waiting for the kube apiserver to become available'\n client = HubClustersCreator::Kube.new(outputs['EKSEndpoint'], token: build_token(name))\n client.wait_for_kubeapi\n\n # @step: check if the awa-auth configmap exists already, we never overwrite\n unless client.exists?('aws-auth', 'kube-system', 'configmaps')\n info 'provition the aws-auth configureation configmap'\n client.kubectl(default_aws_auth(name))\n\n # @step: ensure we have some nodes\n info 'waiting for some nodes to become available'\n client.wait('aws-node', 'kube-system', 'daemonsets', version: 'extensions/v1beta1') do |x|\n x.status.numberReady.positive?\n end\n end\n\n # @step: provision the cluster\n info 'bootstraping the eks cluster'\n config[:credentials] = {\n access_id: @access_id,\n access_key: @access_key,\n account_id: @account_id,\n region: @region\n }\n\n result = HubClustersCreator::Providers::Bootstrap.new(name, 'eks', client, config).bootstrap\n {\n cluster: {\n ca: outputs['EKSCA'],\n endpoint: outputs['EKSEndpoint'],\n service_account_name: 'sysadmin',\n service_account_namespace: 'kube-system',\n service_account_token: Base64.decode64(client.account('sysadmin'))\n },\n config: config,\n services: result\n }\n end", "title": "" }, { "docid": "2065c024c9e5379666c8a35695e9b36d", "score": "0.56508857", "text": "def configure_interfaces\n node_servers.each do |svinfo|\n gretap_interfaces(svinfo).each do |ifname, ifcfg|\n host_name = svinfo['hostname']\n virtual_addr = virtual_address(ifcfg)\n\n cloudconductor_server_interface \"#{host_name}_#{ifname}\" do\n action :create\n hostname host_name\n if_name ifname\n network ifcfg['network']\n security_groups ifcfg['security_groups']\n virtual_address virtual_addr\n end\n end\n end\nend", "title": "" }, { "docid": "f14a2b3b261e3915a2caebb7121ff9fd", "score": "0.56349784", "text": "def cluster_servers\n endpoint.config.nodes.map { |h| \"#{h[:host]}:#{h[:port]}\" }\n end", "title": "" }, { "docid": "147713e5b5c83a49bf9c9b28cfe22e01", "score": "0.5608102", "text": "def create\n # this routine creates the cluster - if this runs, exists? has exited false\n # first we check all the nodes to ensure mysql is listening, and if the\n # wsrep_cluster_status is primary. If one is, we'll join it.\n \n # array cluster_servers is the list of hosts to check\n first_node = true\n gcomm_address = \"gcomm://\"\n @resource[:cluster_servers].each { | node | \n if @resource[:hostname] != node # not this host, so do the check\n puts \"checking host #{node} for Primary\"\n #TODO - refactor this to simplify, it's ugly like this\n begin\n cluster_check_result = mysql([defaults_file, \"-h\", node, '-NBe', \"show status like 'wsrep_cluster_status'\"].compact)\n puts \"Result of check on #{node} was #{cluster_check_result}\"\n rescue => e\n debug(e.message)\n cluster_check_result = \"someerror\"\n end\n if cluster_check_result.match(/Primary/)\n first_node = false\n gcomm_address = \"gcomm://#{node}\"\n puts \"Node #{node} matched Primary, first_node is #{first_node}, address is now #{gcomm_address}\"\n # TODO what happens when mysql isn't listening on node?\n # that node is a primary, we can connect to it\n # we should end the loop here, but it probably doesn't hurt if we don't\n #break\n else\n puts \"host #{node} is not a primary\"\n end\n end\n }\n # after that loop, we'll have a boolean first_node that tells if this is the first node.\n if first_node == true\n puts \"This is the first node of the cluster, so we will create the cluster now, address: #{gcomm_address}\"\n # this is the first node, and it's not yet a cluster\n else\n puts \"first node is #{first_node}, address: #{gcomm_address}\"\n end\n\n # stop the service\n mysqladmin([defaults_file, \"shutdown\"].compact)\n service([@resource[:servicename], \"stop\"].compact)\n # start it special with the address as set above\n # TODO if this is the first node, do another check after some random sleep time, just in case...\n mysql_startup = fork do\n exec \"/usr/bin/mysqld_safe --wsrep_cluster_address=#{gcomm_address}\"\n end\n Process.detach(mysql_startup)\n end", "title": "" }, { "docid": "7e4bbec68091cfdb061b71af195cea28", "score": "0.55922407", "text": "def deploy(nodeList)\n group = Searcher.groupOS(nodeList)\n threads = []\n group.keys.each do |k|\n puts \"Deploying #{k}\" if $verbose\n threads << Thread.new {\n out = %x(kadeploy3 -e #{k} -k -m #{group[k].join(\" -m \")})\n puts out if $verbose\n }\n end\n threads.each { |t| t.join}\n end", "title": "" }, { "docid": "fe9b2e16f2a9496bf6e5057e910f687c", "score": "0.55821246", "text": "def add_hosts(_)\n deploy(nil)\n end", "title": "" }, { "docid": "78502df81daa5caace34b3d0565be5b2", "score": "0.5570189", "text": "def deploy\n unless serverside_version\n # only set serverside version if it's not set, to imitate the api\n # behavior of choosing its own serverside version if one is not\n # sent\n update :serverside_version => AWSM_SERVERSIDE_VERSION\n end\n finished!(\n :successful => true,\n :output => 'Deployment triggered by the API'\n )\n end", "title": "" }, { "docid": "01eaabe9748771b26caf4e4fda87b89f", "score": "0.55661017", "text": "def batchLayerBootStrapping(cluster)\n node_managers, node_workers, nn1, nn2, rm = getClusterHosts cluster\n\n puts \"Batch Layer (Hadoop) Bootstrap ...\"\n\n #\n # 1. Zookeeper bootstrap\n #\n puts \"Zookeeper Esemble starting up ...\"\n node_managers.each do |h|\n mcServiceAction h, 'zookeeper-server', 'start'\n end\n\n #\n # 2. Zookeeper znode formating for Automatic Failover.\n #\n # FIXME: Warning FORMAT\n puts \"Zookeeper Znode formating for Automatic Failover ...\"\n cmd = @cmdenv + 'sudo -E -u hdfs hdfs zkfc -formatZK -force'\n dpExecuteAction nn1, cmd\n\n #\n # 3. QJM - Quorum Journal Manager startup.\n #\n puts \"starting QJM ....\"\n node_managers.each do |h|\n mcServiceAction h, 'hadoop-hdfs-journalnode', 'start'\n end\n\n #\n # 4. HDFS format initialization\n #\n # FIXME: Warning FORMAT\n puts \"Formating HDFS ....\"\n cmd = @cmdenv + 'sudo -E -u hdfs hdfs namenode -format -force'\n dpExecuteAction nn1, cmd\n\n # \n # 5. Namenodes startup\n #\n puts \"NameNodes start up ....\"\n mcServiceAction nn1, 'hadoop-hdfs-namenode', 'start'\n # FIXME: Warning FORMAT:\n cmd = @cmdenv + 'sudo -E -u hdfs hdfs namenode -bootstrapStandby'\n dpExecuteAction nn2, cmd\n mcServiceAction nn2, 'hadoop-hdfs-namenode', 'start'\n\n # \n # 6. Check HA\n #\n puts \"HA checking ...\"\n cmd = @cmdenv + 'sudo -E -u hdfs hdfs haadmin -getServiceState nn1'\n dpExecuteAction nn1, cmd\n cmd = @cmdenv + 'sudo -E -u hdfs hdfs haadmin -getServiceState nn2'\n dpExecuteAction nn1, cmd\n\n #\n # 7. Automatic Failover startup\n #\n puts \"Automatic Failover startup\"\n mcServiceAction nn1, 'hadoop-hdfs-zkfc', 'start'\n mcServiceAction nn2, 'hadoop-hdfs-zkfc', 'start'\n\n #\n # 8. Workers node startup \n #\n puts \"starting DataNode workers....\"\n node_workers.each do |h|\n mcServiceAction h, 'hadoop-hdfs-datanode', 'start'\n end\n\n #\n # 9. Minimal HDFS folders layout creation.\n #\n puts \"HDFS folder initialization ...\"\n # tmp folder\n cmd = @cmdenv + 'sudo -E -u hdfs hadoop fs -mkdir /tmp'\n dpExecuteAction nn1, cmd\n cmd = @cmdenv + 'sudo -E -u hdfs hadoop fs -chmod -R 1777 /tmp'\n dpExecuteAction nn1, cmd\n # MapReduce history server: MapReduce V2 History Server runs as user \"mapred:hadoop\"\n cmd = @cmdenv + 'sudo -E -u hdfs hadoop fs -mkdir -p /user/history'\n dpExecuteAction nn1, cmd\n cmd = @cmdenv + 'sudo -E -u hdfs hadoop fs -mkdir /user/history/done'\n dpExecuteAction nn1, cmd\n cmd = @cmdenv + 'sudo -E -u hdfs hadoop fs -mkdir /user/history/done_intermediate'\n dpExecuteAction nn1, cmd\n cmd = @cmdenv + 'sudo -E -u hdfs hadoop fs -chown -R mapred:hadoop /user/history'\n dpExecuteAction nn1, cmd\n cmd = @cmdenv + 'sudo -E -u hdfs hadoop fs -chmod -R 1777 /user/history'\n dpExecuteAction nn1, cmd\n\n #\n # 10. History Server.\n #\n puts \"Hisotry server starting up ...\"\n mcServiceAction rm, 'hadoop-mapreduce-historyserver', 'start'\n cmd = @cmdenv + 'sudo -E -u hdfs hadoop fs -mkdir -p /var/log/hadoop-yarn'\n dpExecuteAction nn1, cmd\n cmd = @cmdenv + 'sudo -E -u hdfs hadoop fs -chown yarn:mapred /var/log/hadoop-yarn'\n dpExecuteAction nn1, cmd\n\n #\n # 11. Example user creation.\n #\n puts \"example user creation\"\n cmd = @cmdenv + 'sudo -E -u hdfs hadoop fs -mkdir -p /user/jroman'\n dpExecuteAction nn1, cmd\n cmd = @cmdenv + 'sudo -E -u hdfs hadoop fs -chown jroman /user/jroman'\n dpExecuteAction nn1, cmd\n\n #\n # 11. YARN system start up\n #\n puts \"YARN Framework starting up\"\n mcServiceAction rm, 'hadoop-yarn-resourcemanager', 'start'\n node_workers.each do |h|\n mcServiceAction h, 'hadoop-yarn-nodemanager', 'start'\n end\n\n end", "title": "" }, { "docid": "51b747078b3645c0cf5238fa9b6ae1db", "score": "0.55659753", "text": "def create_servers\n # use \"rsc\" tool to get detailed deployment + server view from api 1.6, not supported by right_api_client\n old_deployment = JSON.parse(`rsc -a #{@options[:src]} cm16 show /api/deployments/#{@options[:deployment]} view=full`)\n\n old_deployment['servers'].each do |server|\n @api.account_id = @options[:src]\n name = server['next_instance']['name']\n\n puts \"Creating server: #{name} ...\\n\"\n\n cloud = find_cloud(server['next_instance']['links']['cloud']['href'], name)\n @api.account_id = @options[:src]\n\n ssh_key = choose_ssh_key(cloud)\n @api.account_id = @options[:src]\n\n instance_type = choose_instance_type(cloud)\n old_st_url = server['next_instance']['server_template']['href']\n new_st_url = @server_templates[old_st_url]['new_st_url']\n \n mci = choose_mci(new_st_url)\n @api.account_id = @options[:src]\n\n subnets = choose_subnets(cloud)\n @api.account_id = @options[:src]\n\n security_groups = choose_security_groups(cloud)\n @api.account_id = @options[:src]\n\n inputs_hash = format_inputs(@api.resource(server['next_instance']['href']).show.inputs)\n\n # Create server\n params = {}\n params[:server] = {}\n params[:server][:name] = name\n params[:server][:deployment_href] = @new_deployment\n params[:server][:instance] = {}\n params[:server][:instance][:cloud_href] = cloud\n params[:server][:instance][:server_template_href] = new_st_url\n params[:server][:instance][:ssh_key_href] = ssh_key if ssh_key\n params[:server][:instance][:instance_type_href] = instance_type\n params[:server][:instance][:multi_cloud_image_href] = mci\n params[:server][:instance][:subnet_hrefs] = subnets if subnets\n params[:server][:instance][:security_group_hrefs] = security_groups\n params[:server][:instance][:inputs] = inputs_hash\n @api.account_id = @options[:dst]\n @api.servers.create(params)\n end\nend", "title": "" }, { "docid": "15912d05be51eba984fe9a0a115d2a09", "score": "0.55317396", "text": "def notify\n ### TO DO: Flatten the replication group deployment metadata structure. It is probably waaaaaaay too nested.\n if @config[\"create_replication_group\"]\n repl_group = MU::Cloud::AWS::CacheCluster.getCacheReplicationGroupById(@config['identifier'], region: @region, credentials: @credentials)\n # DNS records for the \"real\" zone should always be registered as late as possible so override_existing only overwrites the records after the resource is ready to use.\n if @config['dns_records']\n @config['dns_records'].each { |dnsrec|\n dnsrec['name'] = repl_group.node_groups.first.primary_endpoint.address.downcase if !dnsrec.has_key?('name')\n dnsrec['name'] = \"#{dnsrec['name']}.#{MU.environment.downcase}\" if dnsrec[\"append_environment_name\"] && !dnsrec['name'].match(/\\.#{MU.environment.downcase}$/)\n }\n end\n # XXX this should be a call to @deploy.nameKitten\n MU::Cloud.resourceClass(\"AWS\", \"DNSZone\").createRecordsFromConfig(@config['dns_records'], target: repl_group.node_groups.first.primary_endpoint.address)\n\n deploy_struct = {\n \"identifier\" => repl_group.replication_group_id,\n \"create_style\" => @config[\"create_style\"],\n \"region\" => @region,\n \"members\" => repl_group.member_clusters,\n \"automatic_failover\" => repl_group.automatic_failover,\n \"snapshotting_cluster_id\" => repl_group.snapshotting_cluster_id,\n \"primary_endpoint\" => repl_group.node_groups.first.primary_endpoint.address,\n \"primary_port\" => repl_group.node_groups.first.primary_endpoint.port\n }\n\n repl_group.member_clusters.each { |id|\n cluster = MU::Cloud::AWS::CacheCluster.getCacheClusterById(id, region: @region)\n\n vpc_sg_ids = []\n cluster.security_groups.each { |vpc_sg|\n vpc_sg_ids << vpc_sg.security_group_id\n }\n\n cache_sg_ids = []\n unless cluster.cache_security_groups.empty?\n cluster.cache_security_groups.each { |cache_sg|\n cache_sg_ids << cache_sg.security_group_id\n }\n end\n\n deploy_struct[id] = {\n \"configuration_endpoint\" => cluster.configuration_endpoint,\n \"cache_node_type\" => cluster.cache_node_type,\n \"engine\" => cluster.engine,\n \"engine_version\" => cluster.engine_version,\n \"num_cache_nodes\" => cluster.num_cache_nodes,\n \"preferred_maintenance_window\" => cluster.preferred_maintenance_window,\n \"notification_configuration\" => cluster.notification_configuration,\n \"cache_security_groups\" => cache_sg_ids,\n \"cache_parameter_group\" => cluster.cache_parameter_group.cache_parameter_group_name,\n \"cache_subnet_group_name\" => cluster.cache_subnet_group_name,\n \"cache_nodes\" => cluster.cache_nodes,\n \"auto_minor_version_upgrade\" => cluster.auto_minor_version_upgrade,\n \"vpc_security_groups\" => vpc_sg_ids,\n \"replication_group_id\" => cluster.replication_group_id,\n \"snapshot_retention_limit\" => cluster.snapshot_retention_limit,\n \"snapshot_window\" => cluster.snapshot_window \n }\n }\n\n repl_group.node_groups.first.node_group_members.each{ |member| \n deploy_struct[member.cache_cluster_id][\"cache_node_id\"] = member.cache_node_id\n deploy_struct[member.cache_cluster_id][\"read_endpoint_address\"] = member.read_endpoint.address\n deploy_struct[member.cache_cluster_id][\"read_endpoint_port\"] = member.read_endpoint.port\n deploy_struct[member.cache_cluster_id][\"current_role\"] = member.current_role\n }\n else\n cluster = MU::Cloud::AWS::CacheCluster.getCacheClusterById(@config['identifier'], region: @region, credentials: @credentials)\n\n vpc_sg_ids = []\n cluster.security_groups.each { |vpc_sg|\n vpc_sg_ids << vpc_sg.security_group_id\n }\n\n cache_sg_ids = []\n unless cluster.cache_security_groups.empty?\n cluster.cache_security_groups.each { |cache_sg|\n cache_sg_ids << cache_sg.security_group_id\n }\n end\n\n deploy_struct = {\n \"cache_node_type\" => cluster.cache_node_type,\n \"engine\" => cluster.engine,\n \"engine_version\" => cluster.engine_version,\n \"num_cache_nodes\" => cluster.num_cache_nodes,\n \"preferred_maintenance_window\" => cluster.preferred_maintenance_window,\n \"notification_configuration\" => cluster.notification_configuration,\n \"cache_security_groups\" => cache_sg_ids,\n \"cache_parameter_group\" => cluster.cache_parameter_group.cache_parameter_group_name,\n \"cache_subnet_group_name\" => cluster.cache_subnet_group_name,\n \"cache_nodes\" => cluster.cache_nodes,\n \"auto_minor_version_upgrade\" => cluster.auto_minor_version_upgrade,\n \"vpc_security_groups\" => vpc_sg_ids,\n \"replication_group_id\" => cluster.replication_group_id,\n \"snapshot_retention_limit\" => cluster.snapshot_retention_limit,\n \"snapshot_window\" => cluster.snapshot_window \n }\n if !cluster.configuration_endpoint.nil?\n deploy_struct[\"configuration_endpoint_address\"] = cluster.configuration_endpoint.address\n deploy_struct[\"configuration_endpoint_port\"] = cluster.configuration_endpoint.port\n end\n end\n\n return deploy_struct\n end", "title": "" }, { "docid": "354407556f23fd5a3e40e5fdc1a721ac", "score": "0.55315304", "text": "def install\n kit_klass = ServiceKit.const_get self.service_type.capitalize\n kit = kit_klass.new comms, container, host\n kit.configure_service!\n end", "title": "" }, { "docid": "1e841d7697db3df03feff1f04d81ab9d", "score": "0.55284697", "text": "def configure(cluster_config, force = false)\n logger.debug { \"#{self.class}##{__method__}\" }\n # cluster specific attributes\n cluster_attributes = cluster_config.instance_values.symbolize_keys.except(:active, :cluster_type,\n :max_threads_per_agent, :cluster_code)\n cluster_attributes[:project_id] = self.project.id\n # find the cluster or create it\n cluster_instance = find_or_initialize(cluster_attributes, cluster_config)\n cluster_instance.save!\n cluster_instance.setup(force)\n end", "title": "" }, { "docid": "7ad6f2eb8e049e279056636005fba100", "score": "0.5528168", "text": "def batchLayerStart(cluster)\n node_managers, node_workers, nn1, nn2, rm = getClusterHosts cluster\n\n # 1. Start Zookeeper Esemble\n puts \"starting up Zookeeper Esemble....\"\n node_managers.each do |h|\n mcServiceAction h, 'zookeeper-server', 'start'\n end\n\n # 2. Stop QJM\n puts \"starting up QJM ....\"\n node_managers.each do |h|\n mcServiceAction h, 'hadoop-hdfs-journalnode', 'start'\n end\n\n # 3. Start namenodes and resourcemanager\n puts \"starting up NameNodes and ResourceManager ....\"\n mcServiceAction nn1, 'hadoop-hdfs-namenode', 'start'\n mcServiceAction nn2, 'hadoop-hdfs-namenode', 'start'\n mcServiceAction rm, 'hadoop-yarn-resourcemanager', 'start'\n\n # 4. Start Automatic Failover\n puts \"starting up Zkfc ....\"\n mcServiceAction nn1, 'hadoop-hdfs-zkfc', 'start'\n mcServiceAction nn2, 'hadoop-hdfs-zkfc', 'start'\n\n #\n # 5. History Server.\n #\n puts \"Hisotry server starting up ...\"\n mcServiceAction rm, 'hadoop-mapreduce-historyserver', 'start'\n\n # 6. start the workers.\n puts \"starting up DataNode workers....\"\n node_workers.each do |h|\n mcServiceAction h, 'hadoop-hdfs-datanode', 'start'\n mcServiceAction h, 'hadoop-yarn-nodemanager', 'start'\n end\n end", "title": "" }, { "docid": "7fa0aa6614a37eb104e733a3f6f5c008", "score": "0.5477906", "text": "def run\n assert_destination_writable!\n retries = Config[:client_registration_retries] || 5\n client = nil\n begin\n client = api_client(create_or_update)\n rescue Net::HTTPFatalError => e\n # HTTPFatalError implies 5xx.\n raise if retries <= 0\n\n retries -= 1\n Chef::Log.warn(\"Failed to register new client, #{retries} tries remaining\")\n Chef::Log.warn(\"Response: HTTP #{e.response.code} - #{e}\")\n retry\n end\n write_key\n client\n end", "title": "" }, { "docid": "f0c22668aeaf899aba929393aa6e484d", "score": "0.545244", "text": "def create_clients\n @haproxy = rpcclient('haproxy')\n @site = rpcclient('site')\n @service = rpcclient('service')\n @rpcutil = rpcclient('rpcutil')\n # Disable to progress bar to clean up output a little\n [@haproxy, @site, @service, @rpcutil].each do |client|\n client.progress = false\n end\nend", "title": "" }, { "docid": "8b40d91c476745efa176b69cc1faccfe", "score": "0.54361564", "text": "def create(name, config)\n # @step: validate the user defined options\n validate(config)\n\n # @step: create the infrastructure deployment\n begin\n provision_aks(name, config)\n rescue StandardError => e\n raise InfrastructureError, \"failed to provision cluster, error: #{e}\"\n end\n\n # @step: bootstrap the cluster\n begin\n provision_cluster(name, config)\n rescue StandardError => e\n raise InfrastructureError, \"failed to bootstrap cluster, error: #{e}\"\n end\n end", "title": "" }, { "docid": "878f561a8a62f6f6ad63f8e917e23098", "score": "0.54342854", "text": "def create_cluster(num_servers)\n cluster = []\n (1..num_servers).to_a.each do |num|\n cluster << \"127.0.0.1:#{54320+num}\"\n end\n return cluster\n end", "title": "" }, { "docid": "35e020dc12c0eb47aa1cfcd236748e00", "score": "0.54316217", "text": "def bootstrap\n hpool = OpenNebula::HostPool.new(@client)\n rc = hpool.info\n\n if OpenNebula.is_error?(rc)\n # Wait 5 seconds and retry\n sleep 5\n rc = hpool.info\n if OpenNebula.is_error?(rc)\n raise \"Could not get hosts information - #{rc.message}\"\n end\n end\n\n $logger.info('Bootstraping list of clusters')\n\n hpool.each do |h|\n next if h['IM_MAD'] != 'vcenter' || h['STATE'] == '8' # offline\n\n $logger.info(\"Adding host #{h.name} (#{h.id})\")\n\n add(h.id, nil)\n end\n end", "title": "" }, { "docid": "c50381140fba2c09546ce6b17d2b3699", "score": "0.5422314", "text": "def cluster_template(config)\n template = <<~YAML\n '$schema': https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#\n contentVersion: 1.0.0.0\n parameters: {}\n variables: {}\n resources:\n - type: Microsoft.ContainerService/managedClusters\n name: <%= context[:name] %>\n apiVersion: '2019-06-01'\n location: #{@region}\n tags:\n cluster: <%= context[:name] %>\n properties:\n kubernetesVersion: <%= context[:version] %>\n dnsPrefix: <%= context[:name] %>\n addonProfiles:\n httpapplicationrouting:\n enabled: true\n config:\n HTTPApplicationRoutingZoneName: <%= context[:domain] %>\n agentPoolProfiles:\n - name: compute\n count: <%= context[:size] %>\n maxPods: 110\n osDiskSizeGB: <%= context[:disk_size_gb] %>\n osType: Linux\n storageProfile: ManagedDisks\n type: VirtualMachineScaleSets\n vmSize: <%= context[:machine_type] %>\n servicePrincipalProfile:\n clientId: #{@client_id}\n secret: #{@client_secret}\n linuxProfile:\n adminUsername: azureuser\n <%- unless (context[:ssh_key] || '').empty? -%>\n ssh:\n publicKeys:\n - keyData: <%= context[:ssh_key] %>\n <%- end -%>\n enableRBAC: true\n enablePodSecurityPolicy: true\n networkProfile:\n dnsServiceIP: 10.0.0.10\n dockerBridgeCidr: 172.17.0.1/16\n loadBalancerSku: basic\n networkPlugin: azure\n networkPolicy: azure\n serviceCidr: <%= context[:services_ipv4_cidr].empty? ? '10.0.0.0/16' : context[:services_ipv4_cidr] %>\n YAML\n HubClustersCreator::Utils::Template::Render.new(config).render(template)\n end", "title": "" }, { "docid": "dc3e0c167132fc250c5ce530a09ddb67", "score": "0.541683", "text": "def sync_with_cluster\n fetch_cluster_data\n reconcile_old_releases\n reconcile_db_with_cluster\n end", "title": "" }, { "docid": "36187d511944215c12765d673e42dad0", "score": "0.53914005", "text": "def create_client!\n Chef::ApiClient::Registration.new(node_name, client_path, http_api: rest).run\n end", "title": "" }, { "docid": "ccd35c0c650c12baa3327e55720c291f", "score": "0.53776056", "text": "def register_self_with_zk\n @zk.create('/clients', ignore: :node_exists)\n @zk.create('/clients/client-', mode: :ephemeral_sequential)\n end", "title": "" }, { "docid": "2f8d2d9edb0754a7f40916a40ef25c16", "score": "0.5350158", "text": "def deploy(_)\n OneProvisionLogger.info('(Deploy skipped)')\n\n [@hosts.map do |h|\n h.to_hash['HOST']['TEMPLATE']['PROVISION']['HOSTNAME']\n end,\n nil,\n nil]\n end", "title": "" }, { "docid": "83bb1c25bc6560027c9fdd2a1f6c1792", "score": "0.5346211", "text": "def create\n name = @resource[:name]\n client = Savon.client(wsdl: @resource[:connection]['url'] + WSDL_PATH)\n\n environment = @resource[:environment]\n custom_props = @resource[:properties]\n dynamic_props = @resource[:dynamic_properties]\n\n raise Puppet::Error, \"Target name, folder, owner and type must not be empty!\" if empty_str?(name) or empty_str?(@resource[:folder]) or empty_str?(@resource[:owner]) or empty_str?(@resource[:type])\n\n self.info(\"Importing deployment target..\")\n \n doc = REXML::Document.new '<?xml version=\"1.0\" encoding=\"UTF-8\"?>'\n root = doc.add_element 'Sync', { \"xmlns:xsi\" => \"http://www.w3.org/2001/XMLSchema-instance\" }\n entity = root.add_element \"Entity\", { \"mainType\" => \"DeploymentTarget\", \"customType\" => @resource[:type] }\n \n prop_hash = { \"system_name\" => name, \"system_owner.system_name\" => @resource[:owner], \"system_folder.system_name\" => @resource[:folder], \"system_deployment_agent_name\" => @resource[:agent],\n \"system_description\" => \"created via Automic Puppet resource type\", \"system_is_active\" => \"true\" }\n\n prop_hash.keys.each do |prk|\n prop_ele = entity.add_element \"Property\", { \"name\" => prk }\n if prk == 'system_name'\n prop_ele.add_attribute \"isIdentity\", \"true\"\n end\n value_ele = prop_ele.add_element \"Value\"\n value_ele.add_text prop_hash[prk]\n end\n\n if not custom_props.nil? and not custom_props.empty?\n # add custom properties\n custom_props.keys.each do |prk|\n prop_ele = entity.add_element \"Property\", { \"name\" => prk }\n value_ele = prop_ele.add_element \"Value\"\n value_ele.add_text custom_props[prk]\n end\n end\n \n message = { \"username\" => @resource[:connection]['username'], \"password\" => @resource[:connection]['password'], \"mainType\" => \"DeploymentTarget\", \"failOnError\" => true, \"fomat\" => \"XML\", \"data\" => doc.to_s }\n \n response = client.call(:import, message: message)\n\n # check error and status\n status = response.body[:import_response][:import_result][:status].to_i \n token = response.body[:import_response][:import_result][:token]\n\n self.debug(\"Got token: #{token}\")\n \n # wait for target id return in status\n while status == 0\n sleep 1\n response = client.call(:get_status, message: { \"token\" => token } )\n status = response.body[:get_status_response][:get_status_result][:status].to_i \n end\n\n if status < 0\n self.info(\"Unsuccessfully create or update deployment target\")\n error = response.body[:get_status_response][:get_status_result][:error] \n if not error.nil? and not error.empty?\n self.info(\"Error detail: \" + error.to_s)\n end\n return status\n end\n\n self.info(\"Deployment target import successfully\")\n \n # add environment\n if not environment.nil? and not environment.empty?\n begin\n env_id = get_environment_id(client, environment)\n if (env_id > 0)\n add_environment_relation(client, env_id, name)\n end\n rescue Exception => e\n self.info(\"Error occurred while updating environment for deployment target\") \n self.debug(e.message)\n self.debug(e.backtrace.inspect)\n end\n end \n\n # update dynamic properties\n if not dynamic_props.nil? and not dynamic_props.empty?\n begin\n update_dynamic_properties(client, status, dynamic_props)\n rescue Exception => e\n self.info(\"Error occurred while updating dynamic properties for deployment target\") \n self.debug(e.message)\n self.debug(e.backtrace.inspect)\n end\n end\n\n return status\n end", "title": "" }, { "docid": "47c7dd4e4ae5ab6297afc4c37e770e13", "score": "0.5337652", "text": "def build_cluster\n ::Couchbase::Cluster.connect(\n @couchbase_options[:connection_string],\n ::Couchbase::Options::Cluster(authenticator: ::Couchbase::PasswordAuthenticator.new(\n @couchbase_options[:username], @couchbase_options[:password]\n ))\n )\n end", "title": "" }, { "docid": "56c5a1a0418bb6228fe2e1f734932c0a", "score": "0.53361887", "text": "def run\n ngen_auth\n @validate = Validator.new\n stack = EcoSystem.new\n @instanceparameters = stack.yaml_reader(config[:yaml])\n stack.validate = @validate\n config[:action] = 'create'\n stack.options = config\n stack.supress_output ='1'\n stack.instanceparameters = @instanceparameters\n inst_result = stack.opt_parse\n ho_hum\n \n inst_result.each do |server|\n config[:inst] = server['server']['display_name']\n instance = {}\n # puts chef_attrs = server['server']['userdata'].at(0)['chef']\n chef_attrs = server['server']['userdata'].at(0)['chef'] if !server['server']['userdata'].at(0)['chef'].nil?\n chef_attrs.each do |attr, value|\n instance[attr] = value\n end\n chef_node_configuration(instance)\n config[:chef_node_name] = config[:inst]\n inst_details = AttrFinder.new(server)\n inst_details.options = config\n inst_details.validate = @validate\n inst_details.function = 'server' \n inst = InstanceClient.new\n inst.validate = @validate\n inst.options = config\n inst.supress_output ='1'\n inst.instanceparameters = @instanceparameters\n ssh_host = inst.list_instance_ip(inst_details.compartment, inst_details.instance).at(1)\n bootstrap_for_linux_node(ssh_host).run\n node_attributes(ssh_host, 'IaaS')\n end\n end", "title": "" }, { "docid": "bf6b6e0e4611571838721c41aad497fe", "score": "0.5334338", "text": "def initialize(client, cluster_config, root_resource_pool, datacenter_name)\n @cluster_config = cluster_config\n @root_resource_pool = root_resource_pool\n @client = client\n @datacenter_name = datacenter_name\n end", "title": "" }, { "docid": "7c77b0c0379f29842c0bda19d558e113", "score": "0.5333441", "text": "def chef_vhost_update(dbcheck, tenant_config, tenant_status)\n tenant_status['vhost_updated'] = false\n tenant_env = tenant_config['env']\n front_end = dbcheck.lookup_frontend_servers(tenant_env)\n command = \"chef-client -o prom-classfront::classflow-conf\"\n front_end.each do |instance|\n logger.info \"Updating vhost through chef-client run on #{instance}.\"\n begin\n run_ssh_command(instance, command)\n #response = run_ssh_command(instance, command)\n #chefresp = response[0]\n #exitcode = response[2]\n # Generates a runtime error if chef-client run fails\n #if exitcode = '1'\n # raise RuntimeError.new(chefresp)\n #end\n # Provides error details on connection failure\n rescue SocketError => e\n logger.error \"Unable to update vhost on instance #{instance}\"\n logger.error \"#{e}\"\n # Returns chef-client output to log on failure\n #rescue RuntimeError => e\n # logger.error \"Chef runtime error on instance #{instance}\"\n # logger.error \"######## CHEF-CLIENT RUN OUTPUT ###########\"\n # logger.error \"#{e}\"\n # logger.error \"####### END CHEF-CLIENT RUN OUTPUT ########\"\n end\n end\n tenant_status['vhost_updated'] = true\n end", "title": "" }, { "docid": "6fe4a47407587e8e16f3ab0b104a827f", "score": "0.5298043", "text": "def run\n info 'Starting the deployment process'\n loop do\n if all_nodes_are_successful?\n info 'All nodes are deployed successfully. Stopping the deployment process'\n break true\n end\n if has_failed_critical_nodes?\n failed_names = failed_critical_nodes.map { |n| n.name }.join ', '\n info \"Critical nodes failed: #{failed_names}. Stopping the deployment process.\"\n break false\n end\n if all_nodes_are_finished?\n if has_failed_nodes?\n failed_names = failed_nodes.map { |n| n.name }.join ', '\n info \"All nodes are finished and some have failed: #{failed_names}. Stopping the deployment process.\"\n else\n info 'All nodes are finished. Stopping the deployment process.'\n end\n break false\n end\n process_all_nodes\n end\n end", "title": "" }, { "docid": "b53000bc083554b7d7ef69c396ec43d5", "score": "0.5288573", "text": "def deploy(environment_options, client, region = 'AWS_REGION')\r\n super\r\n puts \"Deploying API: #{@api_name} to Environment: #{environment_options.name}\"\r\n @stage_variables = environment_options.variables || {}\r\n @stage_variables.store('environment', environment_options.name)\r\n\r\n api_id = get_id_for_api(@api_name)\r\n service_response =\r\n if api_id\r\n options = {\r\n fail_on_warnings: false, mode: @import_mode, rest_api_id:\r\n api_id, body: File.binread(@path_to_swagger_file)\r\n }\r\n @client.put_rest_api(options)\r\n else\r\n options = {\r\n fail_on_warnings: false,\r\n body: File.binread(@path_to_swagger_file)\r\n }\r\n @client.import_rest_api(options)\r\n end\r\n\r\n raise \"Failed to create API gateway with name #{@api_name}\" if service_response.nil? || service_response.id.nil?\r\n\r\n if api_id\r\n \"Created API Gateway Object: #{@api_name} having id #{service_response.id}\"\r\n else\r\n \"Updated API Gateway Object: #{@api_name} having id #{service_response.id}\"\r\n end\r\n\r\n create_stage(service_response.id, environment_options)\r\n\r\n service_uri = \"https://#{service_response.id}.execute-api.#{@region}.amazonaws.com/#{environment_options.name}/\"\r\n\r\n puts \"API: #{@api_name} deployed at #{service_uri}\"\r\n\r\n service_uri\r\n end", "title": "" }, { "docid": "0e58d2bf273695ecbed03800b74510dd", "score": "0.5263722", "text": "def deploy_to_cloud(project_config: {}, cloud_config: {}, local_image_name: '')\n puts \"#{__method__.to_s} enter\"\n\n cloud_info = push_container_image_to_cloud(\n cloud_config: cloud_config,\n local_image_name: local_image_name,\n )\n\n\n kubernetes(\n uber_name: project_config.name,\n keys: project_config.keys,\n remote_image_uri: cloud_info.remote_registry_image_uri\n )\n\n puts \"#{__method__.to_s} exit\"\nend", "title": "" }, { "docid": "ac6c661cbaafcf1a61e8d8b0c9fec94c", "score": "0.5259004", "text": "def initialize\n # These require statements are intentionally placed here to initialize\n # the gRPC module only when it's required.\n # See https://github.com/googleapis/toolkit/issues/446\n require \"gapic/grpc\"\n require \"google/cloud/deploy/v1/cloud_deploy_services_pb\"\n\n # Create the configuration object\n @config = Configuration.new Client.configure\n\n # Yield the configuration if needed\n yield @config if block_given?\n\n # Create credentials\n credentials = @config.credentials\n # Use self-signed JWT if the endpoint is unchanged from default,\n # but only if the default endpoint does not have a region prefix.\n enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&\n !@config.endpoint.split(\".\").first.include?(\"-\")\n credentials ||= Credentials.default scope: @config.scope,\n enable_self_signed_jwt: enable_self_signed_jwt\n if credentials.is_a?(::String) || credentials.is_a?(::Hash)\n credentials = Credentials.new credentials, scope: @config.scope\n end\n @quota_project_id = @config.quota_project\n @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id\n\n @operations_client = Operations.new do |config|\n config.credentials = credentials\n config.quota_project = @quota_project_id\n config.endpoint = @config.endpoint\n end\n\n @location_client = Google::Cloud::Location::Locations::Client.new do |config|\n config.credentials = credentials\n config.quota_project = @quota_project_id\n config.endpoint = @config.endpoint\n end\n\n @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|\n config.credentials = credentials\n config.quota_project = @quota_project_id\n config.endpoint = @config.endpoint\n end\n\n @cloud_deploy_stub = ::Gapic::ServiceStub.new(\n ::Google::Cloud::Deploy::V1::CloudDeploy::Stub,\n credentials: credentials,\n endpoint: @config.endpoint,\n channel_args: @config.channel_args,\n interceptors: @config.interceptors\n )\n end", "title": "" }, { "docid": "01ac46d8db174ba4f60009f3d0332791", "score": "0.5230035", "text": "def deploy\n params = {\n :migrate => migrate,\n :ref => ref,\n }\n params[:serverside_version] = serverside_version if serverside_version\n params[:migrate_command] = migrate_command if migrate\n update_with_response api.post(collection_uri + \"/deploy\", 'deployment' => params)\n end", "title": "" }, { "docid": "d1eea7e8034ea1bacd7f885c72208954", "score": "0.5214767", "text": "def cluster_list\n super\n end", "title": "" }, { "docid": "27c06adf638b6a321ef33a44704d8695", "score": "0.5213428", "text": "def run\n Shef::Extensions.extend_context_object(self)\n ssh_config = []\n\n ssh_config << \"\\n\\n### BEGIN KNIFE BLOCK ###\"\n ssh_config << \"## This was generated by `knife setup ssh`:\"\n\n STDOUT.sync = true\n\n nodes.all do |n|\n next if /vagrant/.match(n.name)\n name = n.name\n name << '.lisausa.net' unless /\\.lisausa.net\\Z/.match(n.name)\n\n begin\n hostname = n.ipaddress\n rescue => ex\n ui.warn(\"Error (#{ex.inspect}) while getting #ipaddress for #{n.name}\")\n next\n end\n\n ssh_config << [\n \"Host #{name}\",\n \" HostName #{hostname}\",\n \" HostKeyAlias #{[name,hostname,n.macaddress].join('-')}\"\n ]\n end\n\n if (c = Chef::Config.knife).keys.grep(/identity_file|ssh_user/).any?\n ssh_config.push [\n \"Host *.lisausa.net\",\n \" IdentitiesOnly yes\",\n \" PasswordAuthentication no\",\n \" ForwardAgent yes\"\n ]\n ssh_config.push \" IdentityFile #{c[:identity_file]}\" if c[:identity_file]\n ssh_config.push \" User #{c[:ssh_user]}\" if c[:ssh_user]\n end\n\n ssh_config << \"### END KNIFE BLOCK ###\"\n ssh_config = ssh_config.flatten.join(\"\\n\")\n\n file_path = File.join(ENV['HOME'], '.ssh', 'config')\n if config[:write] or ui.ask_question(\"Write config to #{file_path} (Y/N)?\", default: 'N').downcase == 'y'\n FileUtils.copy_file(file_path, \"#{file_path}~\")\n File.open(file_path, File::RDWR|File::CREAT) do |f|\n f.flock(File::LOCK_EX)\n\n contents = f.read.gsub(/\\n*### BEGIN KNIFE BLOCK ###.+?(### END KNIFE BLOCK ###|\\Z)/m, ssh_config)\n unless contents.include?('### BEGIN KNIFE BLOCK ###')\n contents << ssh_config\n end\n f.rewind\n f.truncate(0)\n f.write contents\n end\n ui.msg \"Wrote to #{file_path}. Previous contents were backed up to #{file_path}~\"\n else\n ui.msg \"Copy and paste the following into your #{file_path} file:\"\n ui.msg ssh_config\n end\n end", "title": "" }, { "docid": "754b68a3c44145b24ee1c4e41dc17c77", "score": "0.5203665", "text": "def create_etc_hosts(cluster)\n if ENV['VAGRANT_CWD'] then\n folder = ENV['VAGRANT_CWD'] + \"/export/.etc_hosts\"\n etc_file = open(folder, \"w\")\n else\n etc_file = open(\"./export/.etc_hosts\", \"w\")\n end\n etc_file.write(\"127.0.0.1 localhost\\n\")\n\n cluster.each do |role, member_list|\n member_list.each do |member_info|\n etc_file.write(\"#{member_info['contiv_control_ip']} #{member_info['name']}\\n\")\n if role == \"master\" then\n\tetc_file.write(\"#{member_info['contiv_control_ip']} netmaster \\n\")\n end\n end\n end\n\n etc_file.close\nend", "title": "" }, { "docid": "7c53e6324c79153a1fe6a92604ffb3d0", "score": "0.5181531", "text": "def listCluster()\n @crosssiteadmin.listClusters()\n end", "title": "" }, { "docid": "34a92ecd007cb6cb33e304c658f4de77", "score": "0.5179566", "text": "def create_etc_hosts(cluster)\n etc_file = open(\"./export/.etc_hosts\", \"w\")\n etc_file.write(\"127.0.0.1 localhost\\n\")\n \n cluster.each do |role, member_list|\n member_list.each do |member_info|\n etc_file.write(\"#{member_info['contiv_control_ip']} #{member_info['name']}\\n\")\n end\n end\n\n etc_file.close\nend", "title": "" }, { "docid": "5b2662d7043f4af1ac9d7732ef3d372f", "score": "0.51760304", "text": "def add_jobs_to_manifest(manifest)\n if any_service_nodes?\n config.each do |cluster|\n server_count = cluster[\"count\"]\n server_flavor = cluster[\"flavor\"]\n job = {\n \"name\" => cluster_name(cluster),\n \"template\" => [job_node_name],\n \"instances\" => server_count,\n \"resource_pool\" => cluster_name(cluster),\n # TODO are these AWS-specific networks?\n \"networks\" => [{\n \"name\" => \"default\",\n \"default\" => [\"dns\", \"gateway\"]\n }],\n \"persistent_disk\" => system_config.common_persistent_disk\n }\n manifest[\"jobs\"] << job\n end\n end\n end", "title": "" }, { "docid": "cc93f05d051879a7c2c01fcc2f580250", "score": "0.51660013", "text": "def generate_lvs_cluster(c)\n svc = c.services.map { |s|\n [s.name, \"#{s.ha_protocol}://\", s.ha_hostname, s.localport ].join(', ') \n }\n [dec2ip(c.fw_mark), c.description, svc.map { |s| \"(#{ s })\" }.join('; ') ]\nend", "title": "" }, { "docid": "d0a058ecda8b54588eb6efe67e8d3a2a", "score": "0.51603013", "text": "def export\n\t\tapp = self.app || File.basename( self.engine.directory )\n\t\tuser = self.user || app\n\n\t\tunless @servicedir.exist?\n\t\t\tsay \"Creating #{@servicedir}...\"\n\t\t\t@servicedir.mkpath\n\t\tend\n\n\t engine.each_process do |name, process|\n\t\t\tsay \"Setting up %s-%s service directories...\" % [ app, name ]\n\t\t\tcount = engine.formation[ name ]\n\t\t\tsay \" concurrency = #{count}\"\n\t\t\tnext unless count >= 1\n\n\t\t\t# Create a numbered service dir for each instance if there are\n\t\t\t# more than one\n\t\t\tif count != 1\n\t\t\t\t1.upto( count ) do |i|\n\t\t\t\t\tself.write_servicedir( app, name, i, process, true )\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tself.write_servicedir( app, name, 1, process )\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "896c99514460e12d57791e06dab00904", "score": "0.51521975", "text": "def healthy_cluster_config\n {\n 'http://127.0.0.1:4001' => 'http://127.0.0.1:4001',\n 'http://127.0.0.1:4002' => 'http://127.0.0.1:4001',\n 'http://127.0.0.1:4003' => 'http://127.0.0.1:4001'\n }\n end", "title": "" }, { "docid": "72ce39b81c67aa8460432f7f94fe59f6", "score": "0.51465243", "text": "def configure(service_name, configurations); end", "title": "" }, { "docid": "e4e70fc10a6a4d89077426ceb0e354f7", "score": "0.51427233", "text": "def up(services)\n @platform_services = []\n @infra_services = []\n\n services.each do |service|\n if enabled_services.include?(service.to_sym)\n @platform_services.push(service)\n elsif enabled_application_services.include?(service.to_sym)\n @infra_services.push(service)\n else\n STDERR.puts \"Services specified not found or enabled: #{service}, exit\"\n return\n end\n end\n\n # No services specified - launch whole app stack\n if @platform_services.empty? && @infra_services.empty? && !options.only_infra\n STDOUT.puts \"No specific service specified, deploy all enabled services\"\n @platform_services = enabled_services\n @infra_services = enabled_application_services\n # Launch all infra services and jobs. Useful for new environments to make sure infra is up and running before deploy any services\n elsif @platform_services.empty? && @infra_services.empty? && options.only_infra\n STDOUT.puts \"Deploying infra services only\"\n @infra_services = enabled_application_services\n # app service(s) specified - launch app and ensure required infra services are up and running\n elsif !@platform_services.empty? && @infra_services.empty?\n @infra_services = enabled_application_services\n # infra service(s) specified - force update\n elsif @platform_services.empty? && !@infra_services.empty?\n @force_infra_deploy = true\n end\n generate_config if stale_config\n if options.force or not system_cmd(\"kubectl get ns #{namespace}\", kube_env)\n STDOUT.puts 'Forcing namespace create' if options.force\n deploy_namespace\n else\n STDOUT.puts 'Namespace exists. skipping create. Use -f to force'\n end\n return if options.skip\n update_helm_repo\n deploy_services unless options.skip_infra\n deploy_infra_migration_jobs unless options.skip_infra\n deploy_platform_environment\n deploy_platform\n show_endpoint\n end", "title": "" }, { "docid": "42bd6f8fd6a00251dcab703151bb8cee", "score": "0.51406395", "text": "def deploy\n # ensure the resource group is created\n params = @client.model_classes.resource_group.new.tap do |rg|\n rg.location = 'westus'\n end\n @client.resource_groups.create_or_update(@resource_group, params)\n\n # build the deployment from a json file template from parameters\n template = File.read(File.expand_path(File.join(__dir__, '../templates/template.json')))\n deployment = @client.model_classes.deployment.new\n deployment.properties = @client.model_classes.deployment_properties.new\n deployment.properties.template = JSON.parse(template)\n deployment.properties.mode = Azure::Resources::Profiles::Latest::Mgmt::Models::DeploymentMode::Incremental\n\n # build the deployment template parameters from Hash to {key: {value: value}} format\n deploy_params = DEPLOYMENT_PARAMETERS.merge(sshKeyData: @pub_ssh_key)\n deployment.properties.parameters = Hash[*deploy_params.map{ |k, v| [k, {value: v}] }.flatten]\n\n # log the request and response contents of Template Deployment.\n # By default, ARM does not log any content. By logging information about the request or response, you could\n # potentially expose sensitive data that is retrieved through the deployment operations.\n debug_settings = @client.model_classes.debug_setting.new\n debug_settings.detail_level = 'requestContent, responseContent'\n deployment.properties.debug_setting = debug_settings\n\n # put the deployment to the resource group\n @client.deployments.create_or_update(@resource_group, 'azure-sample', deployment)\n\n # See logged information related to the deployment operations\n operation_results = @client.deployment_operations.list(@resource_group, 'azure-sample')\n unless operation_results.nil?\n operation_results.each do |operation_result|\n puts \">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\"\n puts \"operation_id = #{operation_result.operation_id}\"\n unless operation_result.properties.nil?\n puts \"provisioning_state = #{operation_result.properties.provisioning_state}\"\n puts \"status_code = #{operation_result.properties.status_code}\"\n puts \"status_message = #{operation_result.properties.status_message}\"\n puts \"target_resource = #{operation_result.properties.target_resource.id}\" unless operation_result.properties.target_resource.nil?\n puts \"request = #{operation_result.properties.request.content}\" unless operation_result.properties.request.nil?\n puts \"response = #{operation_result.properties.response.content}\" unless operation_result.properties.response.nil?\n end\n end\n end\n end", "title": "" }, { "docid": "0b8d1aacf968adaf8c617919f252d2c8", "score": "0.51393616", "text": "def create_cluster_boot_manager_service_action_start_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: NsxComponentAdministrationApi.create_cluster_boot_manager_service_action_start ...\"\n end\n # resource path\n local_var_path = \"/node/services/cluster_manager?action=start\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'NodeServiceStatusProperties')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: NsxComponentAdministrationApi#create_cluster_boot_manager_service_action_start\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "543836b8cbcdfb3c7db892d02c2ef315", "score": "0.513881", "text": "def fetch_cluster_data\n env = release_env(last_release(@project))\n env.cluster_deploy_groups.each do |cdg|\n cdg.cluster.client.get_pods(namespace: cdg.namespace, label_selector: \"project_id=#{@project.id}\").each do |pod|\n update_rc_pods(Kubernetes::Api::Pod.new(pod))\n end\n end\n end", "title": "" }, { "docid": "75702b3d725ddc5911106db9399c38e5", "score": "0.51374006", "text": "def install(log_location)\r\n log_location = log_location || bootstrap_directory # example default logs go to C:\\chef\\\r\n exit_code = 0\r\n message = \"success\"\r\n error_message = \"Error installing chef-client service\"\r\n begin\r\n if windows?\r\n puts \"#{Time.now} Getting chef-client service status\"\r\n status = shell_out(\"sc.exe query chef-client\")\r\n if status.exitstatus == 1060 && status.stdout.include?(\"The specified service does not exist as an installed service.\")\r\n puts \"#{Time.now} Installing chef-client service...\"\r\n params = \" -a install -c #{bootstrap_directory}\\\\client.rb -L #{log_location}\\\\chef-client.log \"\r\n result = shell_out(\"chef-service-manager #{params}\")\r\n result.error!\r\n puts \"#{Time.now} Installed chef-client service.\"\r\n else\r\n status.error!\r\n puts \"#{Time.now} chef-client service is already installed.\"\r\n end\r\n end\r\n # Unix - only start chef-client in daemonize mode using self.enable\r\n rescue Mixlib::ShellOut::ShellCommandFailed => e\r\n Chef::Log.error \"#{error_message} (#{e})\"\r\n message = \"#{error_message} - #{e} - Check log file for details\"\r\n exit_code = 1\r\n rescue => e\r\n Chef::Log.error \"#{error_message} (#{e})\"\r\n message = \"#{error_message}- #{e} - Check log file for details\"\r\n exit_code = 1\r\n end\r\n [exit_code, message]\r\n end", "title": "" }, { "docid": "9b97527d2d1326092e265ca7aa42638b", "score": "0.51333505", "text": "def save_cluster_configuration\n conf = cluster_attributes(CLUSTER_CONF_KEY)\n conf ||= {}\n merge_to_cluster_role({ CLUSTER_CONF_KEY => conf })\n end", "title": "" }, { "docid": "f253eb5a223e690dc521ad4ee6e5a7b0", "score": "0.5119728", "text": "def uploadCustomConfig(solrversion,zkHost,configname,dirname)\n Chef::Log.info(\"uploadCustomConfig : #{solrversion} : #{zkHost} : #{configname} : #{dirname}\")\n solrmajorversion = \"#{solrversion}\"[0,1]\n begin\n\n command = \"#{node['installation_dir_path']}/solr#{solrmajorversion}/server/scripts/cloud-scripts/zkcli.sh -zkhost #{zkHost} -cmd upconfig -confdir #{dirname} -confname #{configname}\"\n\n Chef::Log.info(\"uploadCustomConfig command : #{command}\")\n\n bash 'upload_custom_config' do\n code <<-EOH\n #{command}\n EOH\n end\n \n Chef::Log.info(\"Successfully uploaded custom config '#{configname}'\")\n rescue Exception => msg\n raise \"Error while uploading zookeeper config : #{msg}\"\n end\n end", "title": "" }, { "docid": "9c27a117c92c305caf47a4fc07ec7887", "score": "0.51156926", "text": "def apply\n self.install\n\n self.say(\"Applying configuration...\", true)\n command = \"chef-solo -j #{NODE_JSON.shellescape}\"\n command << \" -o #{self.pocketknife.runlist}\" if self.pocketknife.runlist\n command << \" -l debug\" if self.pocketknife.verbosity == true\n self.execute(command, true)\n self.say(\"Finished applying!\")\n end", "title": "" }, { "docid": "105ed604f8b2ee30500ad452310e762a", "score": "0.5104816", "text": "def add_resource_pools_to_manifest(manifest)\n if any_service_nodes?\n config.each do |cluster|\n server_count = cluster[\"count\"]\n server_flavor = cluster[\"flavor\"]\n resource_pool = {\n \"name\" => cluster_name(cluster),\n \"network\" => \"default\",\n \"size\" => server_count,\n \"stemcell\" => {\n \"name\" => system_config.stemcell_name,\n \"version\" => system_config.stemcell_version\n },\n # TODO how to create \"cloud_properties\" per-provider?\n \"cloud_properties\" => {\n \"instance_type\" => server_flavor\n },\n \"persistent_disk\" => system_config.common_persistent_disk\n }\n manifest[\"resource_pools\"] << resource_pool\n end\n end\n end", "title": "" }, { "docid": "367eeb8427b2cea1a5ddba35346c74b3", "score": "0.51030064", "text": "def connect\n @cluster.connect\n end", "title": "" }, { "docid": "84eeaed0b75809fb8cb9127eb294949a", "score": "0.5098381", "text": "def start\n puts \"Starting clusters...\"\n for app in @apps\n if @env == :deployment\n #need to check if application has a pid file so we don't start\n pid_file = \"#{APP_PATH}/log/doozer.#{app[:port]}.pid\"\n raise \"pid file already exists for #{pid_file}\" if File.exist?(pid_file)\n cmd = \"rackup #{@config} -p #{app[:port]} -E #{@env.to_s} -s #{@server} -o #{app[:ip]} #{@daemonize} -P #{pid_file}\" \n puts \"=> #{cmd}\"\n system(cmd)\n else\n cmd = \"rackup #{@config} -p #{app[:port]} -E #{@env.to_s} -s #{@server} -o #{app[:ip]}\" \n puts \"=> #{cmd}\"\n system(cmd)\n break\n end\n end\n puts \"Did they start?\"\n system(\"ps -aux | grep rackup\")\nend", "title": "" }, { "docid": "f0bae3e0c40814d43be611bcf7f5d893", "score": "0.5079924", "text": "def provision_chef_client(box, key, chef_config, vm_config)\n box.vm.provision \"chef_client\" do |chef|\n set_instance_variable(chef_config, chef, 'chef_server_url')\n set_instance_variable(chef_config, chef, 'validation_key_path')\n set_instance_variable(chef_config, chef, 'delete_node', true)\n set_instance_variable(chef_config, chef, 'delete_client', true)\n provision_chef_common(chef, key, chef_config, vm_config)\n end\nend", "title": "" }, { "docid": "693d813b35e64f7016658c839d3c3ec0", "score": "0.5078398", "text": "def addCluster(args={})\n raise(ArgumentError, \"Arguments cannot be empty\") if args.empty?\n name = args[NAME] if args[NAME]\n raise(ArgumentError, \"Name of the cluster should be specified\") if name.empty?\n address = args[ADDRESS] if args[ADDRESS]\n raise(ArgumentError, \"Address of the cluster should be specified\") if address.empty?\n @crosssiteadmin.addCluster(name.to_java.to_s, address.to_java.to_s)\n end", "title": "" }, { "docid": "e2dc8a493beb3224ac67b317b4122a1b", "score": "0.5075493", "text": "def sync_cluster_role\n save_cluster_general_data\n end", "title": "" }, { "docid": "34f8519602d7a8cd1891fb19463647f6", "score": "0.5074728", "text": "def deploy(options={})\n buffer = \"Starting application #{application_name}\\n\"\n\n if options[:out]\n options[:out].puts(buffer)\n end\n\n buffer << start_gear(secondary_only: true,\n user_initiated: true,\n hot_deploy: options[:hot_deploy],\n out: options[:out],\n err: options[:err])\n\n @state.value = ::OpenShift::Runtime::State::DEPLOYING\n\n web_proxy_cart = @cartridge_model.web_proxy\n if web_proxy_cart\n buffer << @cartridge_model.do_control('deploy',\n web_proxy_cart,\n pre_action_hooks_enabled: false,\n prefix_action_hooks: false,\n out: options[:out],\n err: options[:err])\n end\n\n buffer << @cartridge_model.do_control('deploy',\n @cartridge_model.primary_cartridge,\n pre_action_hooks_enabled: false,\n prefix_action_hooks: false,\n out: options[:out],\n err: options[:err])\n\n buffer << start_gear(primary_only: true,\n user_initiated: true,\n hot_deploy: options[:hot_deploy],\n out: options[:out],\n err: options[:err])\n\n buffer << @cartridge_model.do_control('post-deploy',\n @cartridge_model.primary_cartridge,\n pre_action_hooks_enabled: false,\n prefix_action_hooks: false,\n out: options[:out],\n err: options[:err])\n\n buffer\n end", "title": "" }, { "docid": "c502095d8f8be7429ab1533abb8585f8", "score": "0.50743634", "text": "def _register_client(credentials)\n DoubleDutch::SpaceCadet::Config.register(\n \"#{credentials[:region]}-#{credentials[:env]}\".downcase,\n credentials[:username].downcase,\n credentials[:key],\n credentials[:region].upcase\n )\n end", "title": "" }, { "docid": "456725daa331edeb5bfd0872d2875978", "score": "0.50702894", "text": "def notify\n node, config, deploydata = describe(cloud_id: @cloud_id, update_cache: true)\n deploydata = {} if deploydata.nil?\n\n if cloud_desc.nil?\n raise MuError, \"Failed to load instance metadata for #{@mu_name}/#{@cloud_id}\"\n end\n\n interfaces = []\n private_ips = []\n\n cloud_desc.network_interfaces.each { |iface|\n iface.private_ip_addresses.each { |priv_ip|\n private_ips << priv_ip.private_ip_address\n }\n interfaces << {\n \"network_interface_id\" => iface.network_interface_id,\n \"subnet_id\" => iface.subnet_id,\n \"vpc_id\" => iface.vpc_id\n }\n }\n\n deploydata = {\n \"nodename\" => @mu_name,\n \"run_list\" => @config['run_list'],\n \"image_created\" => @config['image_created'],\n \"iam_role\" => @config['iam_role'],\n \"cloud_desc_id\" => @cloud_id,\n \"private_dns_name\" => cloud_desc.private_dns_name,\n \"public_dns_name\" => cloud_desc.public_dns_name,\n \"private_ip_address\" => cloud_desc.private_ip_address,\n \"public_ip_address\" => cloud_desc.public_ip_address,\n \"private_ip_list\" => private_ips,\n \"key_name\" => cloud_desc.key_name,\n \"subnet_id\" => cloud_desc.subnet_id,\n \"cloud_desc_type\" => cloud_desc.instance_type #,\n #\t\t\t\t\"network_interfaces\" => interfaces,\n #\t\t\t\t\"config\" => server\n }\n\n if !@mu_windows_name.nil?\n deploydata[\"mu_windows_name\"] = @mu_windows_name\n end\n if !@config['chef_data'].nil?\n deploydata.merge!(@config['chef_data'])\n end\n deploydata[\"region\"] = @config['region'] if !@config['region'].nil?\n if !@named\n MU::MommaCat.nameKitten(self)\n @named = true\n end\n\n return deploydata\n end", "title": "" }, { "docid": "0fe557f7a0995a84cf25c7ca343e755c", "score": "0.50578815", "text": "def create\n create_checkpoints\n create_config_base\n generate_deploy_files\n generate_hiera_template\n end", "title": "" }, { "docid": "4f41dc39d3c7d1829738fee050a8a3e2", "score": "0.5053066", "text": "def run\n sanity_check\n\n ui.info(\"Creating new client for #{node_name}\")\n\n @client = create_client!\n\n ui.info(\"Creating new node for #{node_name}\")\n\n create_node!\n end", "title": "" }, { "docid": "cce98b8b0f4f6cab809d809d1b105d70", "score": "0.5047489", "text": "def deploy\n Kb8Run.update_context(@kb8context)\n @deploy_units.each do | deploy_unit |\n deploy_unit.deploy\n end\n end", "title": "" }, { "docid": "e0655425484dfb50c47c55e6b8defb5b", "score": "0.5045446", "text": "def start_client_services(machine)\n services = %w[HLKsvc]\n services.each { |service_name| start_client_service(machine, service_name) }\n logger('debug', \"Machine #{machine}: HLK Services started successfully\")\n end", "title": "" }, { "docid": "80b28632b6b3beb7bce971c5d8a2f681", "score": "0.5038226", "text": "def run\n ready_nodes = each_ready_task.to_a.join ', '\n info \"Starting the deployment process. Starting tasks: #{ready_nodes}\"\n hook 'internal_pre_run'\n hook 'pre_run'\n topology_sort\n result = loop do\n if all_nodes_are_successful?\n status = 'All nodes are deployed successfully. '\\\n 'Stopping the deployment process!'\n result = {\n :success => true,\n :status => status,\n }\n break result\n end\n gracefully_stop! \"failed_critical_nodes: #{failed_critical_nodes.inspect}\" if has_failed_critical_nodes?\n\n if all_nodes_are_finished?\n status = \"All nodes are finished. Failed tasks: \"\\\n \"#{failed_tasks.join ', '} Stopping the \"\\\n \"deployment process!\"\n result = if has_failed_critical_nodes?\n {\n :success => false,\n :status => status,\n :failed_nodes => failed_nodes,\n :skipped_nodes => skipped_nodes,\n :failed_tasks => failed_tasks\n }\n else\n {\n :success => true,\n :status => status,\n :failed_nodes => failed_nodes,\n :skipped_nodes => skipped_nodes,\n :failed_tasks => failed_tasks\n }\n end\n break result\n end\n # run loop over all nodes\n process_all_nodes\n end\n info result[:status]\n hook 'post_run', result\n result\n end", "title": "" }, { "docid": "7c44e25ce1ef738f895352f164ce033d", "score": "0.5037906", "text": "def write_host_files\n\n master.ssh(\"sudo bash -c \\\"echo '\n#auto-inserted by amatsung to allow resolving each clients hostname\n' >> /etc/hosts\\\"\")\n nodes.each do |node|\n if node.region != master.region\n node.ssh(\"sudo bash -c \\\"echo '\n#auto-inserted by amatsung to allow resolving the masters hostname\n#{master.public_ip_address} #{master.private_hostname}\n' >> /etc/hosts\\\"\")\n master.ssh(\"sudo bash -c \\\"echo '\n#{node.public_ip_address} #{node.public_hostname}\n' >> /etc/hosts\\\"\")\n end\n end\n end", "title": "" }, { "docid": "a97eb5dacd78d18471fd130280f76ada", "score": "0.5034939", "text": "def deploy(deploy_params, servers)\n params = deploy_params.join(\" \")\n cmd = nil\n if ENV['TPKG_HOME']\n # Preserve TPKG_HOME when deploying to remote systems so that users can\n # perform operations against different tpkg base directories.\n cmd = \"tpkg #{params} --base #{ENV['TPKG_HOME']} -n\"\n else\n cmd = \"tpkg #{params} -n\"\n end\n user = @user\n\n if @user.nil? && !@use_ssh_key\n @user = prompt_username\n end\n\n if @password.nil? && !@use_ssh_key\n @password = prompt_password\n end\n\n tp = ThreadPool.new(@max_worker)\n statuses = {}\n deploy_to = []\n if servers.kind_of?(Proc)\n deploy_to = servers.call\n elsif servers.size == 1 && File.exists?(servers[0])\n puts \"Reading server list from file #{servers[0]}\"\n File.open(servers[0], 'r') do |f|\n while line = f.gets\n deploy_to << line.chomp.split(\",\")\n end\n end\n deploy_to.flatten!\n else\n deploy_to = servers\n end\n\n deploy_to.each do | server |\n tp.process do\n status = ssh_execute(server, @user, @password, @ssh_key, cmd).call\n statuses[server] = status\n end\n end\n tp.shutdown\n puts \"Exit statuses: \"\n puts statuses.inspect\n\n return statuses\n end", "title": "" }, { "docid": "14833467a2de95def13b7c54e4976989", "score": "0.5034052", "text": "def modify_cloud_config(parsed_hash, nodes)\n parsed_hash_internal_ips = Marshal.load(Marshal.dump(parsed_hash))\n\n parsed_hash[:ssh_key] = if @provider == 'aws'\n File.expand_path('~/.ssh') + '/' + @credentials[:aws_key]\n elsif @provider == 'openstack'\n File.expand_path('~/.ssh') + '/' + @credentials[:os_ssh_key]\n elsif @provider == 'rackspace'\n File.split(File.expand_path(@credentials[:rackspace_ssh_key])).first + '/' +\n File.basename(File.expand_path(@credentials[:rackspace_ssh_key]), '.pub')\n end\n parsed_hash[:ssh_user] = if @provider == 'openstack'\n @credentials[:os_ssh_user]\n else\n if parsed_hash[:cloud_os_type].downcase == 'centos'\n 'root'\n elsif parsed_hash[:cloud_os_type].downcase == 'ubuntu' && parsed_hash[:cloud_os_type].downcase == 'aws'\n 'ubuntu'\n else\n 'root'\n end\n end\n parsed_hash[:controller] = find_fqdn_for_tag(nodes, 'controller').first\n if parsed_hash[:hadoop_deploy] != 'disabled'\n parsed_hash[:hadoop_deploy][:namenode] = find_fqdn_for_tag(nodes, 'namenode')\n if parsed_hash[:hadoop_deploy][:mapreduce] != 'disabled'\n parsed_hash[:hadoop_deploy][:mapreduce][:master] = find_fqdn_for_tag(nodes, 'jobtracker').first\n end\n if parsed_hash[:hadoop_deploy][:ha] == 'disabled'\n parsed_hash[:hadoop_deploy][:secondarynamenode] = find_fqdn_for_tag(nodes, 'secondarynamenode').first\n end\n parsed_hash[:worker_nodes] = find_fqdn_for_tag(nodes, 'slaves')\n if parsed_hash[:hadoop_deploy][:ha] == 'enabled'\n parsed_hash[:hadoop_deploy][:journal_quorum] = find_fqdn_for_tag(nodes, 'zookeeper')\n end\n if parsed_hash[:hbase_deploy] != 'disabled'\n parsed_hash[:hbase_deploy][:master] = find_fqdn_for_tag(nodes, 'hbasemaster')\n end\n # volumes to mount points\n worker_volumes = parsed_hash[:hadoop_deploy][:worker_volumes]\n parsed_hash[:hadoop_deploy][:data_dirs] = if worker_volumes\n Array.new(worker_volumes[:count]){ |i| \"/data/hadoop/#{i+1}\" }\n else\n ['/data/hadoop']\n end\n master_volumes = parsed_hash[:hadoop_deploy][:master_volumes]\n parsed_hash[:hadoop_deploy][:master_dirs] = if master_volumes\n Array.new(master_volumes[:count]){ |i| \"/data/hadoop/#{i+1}\" }\n else\n ['/data/hadoop']\n end\n end\n\n if parsed_hash[:cassandra_deploy] != 'disabled'\n parsed_hash[:cassandra_deploy][:nodes] = find_fqdn_for_tag(nodes, 'cassandra')\n parsed_hash[:cassandra_deploy][:seeds] = find_fqdn_for_tag(nodes, 'cassandraseed')\n cassandra_volumes = parsed_hash[:cassandra_deploy][:volumes]\n cassandra_mounts = if cassandra_volumes\n Array.new(cassandra_volumes[:count]){|i| \"/data/cassandra/#{i+1}\" }\n end\n parsed_hash[:cassandra_deploy][:data_dirs] = if cassandra_mounts\n if cassandra_mounts.size > 1\n cassandra_mounts[0..cassandra_mounts.size-2].map { |dir| dir = dir + '/data' }\n else\n cassandra_mounts.first + '/data'\n end\n else\n ['/var/lib/cassandra/data']\n end\n parsed_hash[:cassandra_deploy][:commitlog_dirs] = if cassandra_mounts\n if cassandra_mounts.size > 1\n cassandra_mounts.last + '/commitlog'\n else\n cassandra_mounts.first + '/commitlog'\n end\n else\n '/var/lib/cassandra/commitlog'\n end\n parsed_hash[:cassandra_deploy][:saved_caches_dirs] = if cassandra_mounts\n if cassandra_mounts.size > 1\n cassandra_mounts.last + '/saved_caches'\n else\n cassandra_mounts.first + '/saved_caches'\n end\n else\n '/var/lib/cassandra/saved_caches'\n end\n end\n\n if parsed_hash[:solr_deploy] != 'disabled'\n if parsed_hash[:solr_deploy][:hdfs_integration] == 'disabled'\n parsed_hash[:solr_deploy][:nodes] = find_fqdn_for_tag(nodes, 'solr')\n else\n parsed_hash[:solr_deploy][:nodes] = find_fqdn_for_tag(nodes, 'slaves')\n end\n end\n\n if parsed_hash[:kafka_deploy] != 'disabled'\n parsed_hash[:kafka_deploy][:brokers] = find_fqdn_for_tag(nodes, 'kafka')\n end\n\n if parsed_hash[:storm_deploy] != 'disabled'\n parsed_hash[:storm_deploy][:supervisors] = find_fqdn_for_tag(nodes, 'stormworker')\n parsed_hash[:storm_deploy][:master] = find_fqdn_for_tag(nodes, 'stormnimbus').first\n end\n #zookeepers\n if parsed_hash[:hadoop_deploy] != 'disabled' and parsed_hash[:hadoop_deploy][:ha] == 'enabled'\n parsed_hash[:zookeeper_deploy][:quorum] = find_fqdn_for_tag(nodes, 'zookeeper')\n end\n if parsed_hash[:hbase_deploy] != 'disabled' or\n parsed_hash[:kafka_deploy] != 'disabled' or\n parsed_hash[:storm_deploy] != 'disabled'\n unless parsed_hash[:zookeeper_deploy].has_key? :quorum\n parsed_hash[:zookeeper_deploy][:quorum] = find_fqdn_for_tag(nodes, 'zookeeper')\n end\n end\n\n # If AWS, hash with internal ips should contain private_ip\n # If RackSpace, hash with internal ips should contain fqdn\n\n parsed_hash_internal_ips[:ssh_key] = parsed_hash[:ssh_key]\n parsed_hash_internal_ips[:ssh_user] = parsed_hash[:ssh_user]\n parsed_hash_internal_ips[:controller] = find_internal_ip(nodes, 'controller').first\n if parsed_hash[:hadoop_deploy] != 'disabled'\n parsed_hash_internal_ips[:hadoop_deploy][:namenode] = find_internal_ip(nodes, 'namenode')\n if parsed_hash[:hadoop_deploy][:mapreduce] != 'disabled'\n parsed_hash_internal_ips[:hadoop_deploy][:mapreduce][:master] = find_internal_ip(nodes, 'jobtracker').first\n end\n if parsed_hash[:hadoop_deploy][:ha] == 'disabled'\n parsed_hash_internal_ips[:hadoop_deploy][:secondarynamenode] = find_internal_ip(nodes, 'secondarynamenode').first\n end\n parsed_hash_internal_ips[:worker_nodes] = find_internal_ip(nodes, 'slaves')\n if parsed_hash[:hadoop_deploy][:ha] == 'enabled'\n parsed_hash_internal_ips[:hadoop_deploy][:journal_quorum] = find_internal_ip(nodes, 'zookeeper')\n end\n if parsed_hash[:hbase_deploy] != 'disabled'\n parsed_hash_internal_ips[:hbase_deploy][:master] = find_internal_ip(nodes, 'hbasemaster')\n end\n parsed_hash_internal_ips[:hadoop_deploy][:data_dirs] = parsed_hash[:hadoop_deploy][:data_dirs]\n parsed_hash_internal_ips[:hadoop_deploy][:master_dirs] = parsed_hash[:hadoop_deploy][:master_dirs]\n end\n if parsed_hash[:cassandra_deploy] != 'disabled'\n parsed_hash_internal_ips[:cassandra_deploy][:nodes] = find_internal_ip(nodes, 'cassandra')\n parsed_hash_internal_ips[:cassandra_deploy][:seeds] = find_internal_ip(nodes, 'cassandraseed')\n # cassandra storage directories\n parsed_hash_internal_ips[:cassandra_deploy][:data_dirs] = parsed_hash[:cassandra_deploy][:data_dirs]\n parsed_hash_internal_ips[:cassandra_deploy][:commitlog_dirs] = parsed_hash[:cassandra_deploy][:commitlog_dirs]\n parsed_hash_internal_ips[:cassandra_deploy][:saved_caches_dirs] = parsed_hash[:cassandra_deploy][:saved_caches_dirs]\n end\n if parsed_hash[:solr_deploy] != 'disabled'\n if parsed_hash[:solr_deploy][:hdfs_integration] == 'disabled'\n parsed_hash_internal_ips[:solr_deploy][:nodes] = find_internal_ip(nodes, 'solr')\n else\n parsed_hash_internal_ips[:solr_deploy][:nodes] = find_internal_ip(nodes, 'slaves')\n end\n end\n if parsed_hash[:kafka_deploy] != 'disabled'\n parsed_hash_internal_ips[:kafka_deploy][:brokers] = find_internal_ip(nodes, 'kafka')\n end\n if parsed_hash[:storm_deploy] != 'disabled'\n parsed_hash_internal_ips[:storm_deploy][:supervisors] = find_internal_ip(nodes, 'stormworker')\n parsed_hash_internal_ips[:storm_deploy][:master] = find_internal_ip(nodes, 'stormnimbus').first\n end\n if parsed_hash[:hadoop_deploy] != 'disabled' and parsed_hash[:hadoop_deploy][:hadoop_ha] == 'enabled'\n parsed_hash_internal_ips[:zookeeper_deploy][:quorum] = find_internal_ip(nodes, 'zookeeper')\n end\n if parsed_hash[:hbase_deploy] != 'disabled' or\n parsed_hash[:kafka_deploy] != 'disabled' or\n parsed_hash[:storm_deploy] != 'disabled'\n unless parsed_hash_internal_ips[:zookeeper_deploy].has_key? :quorum\n parsed_hash_internal_ips[:zookeeper_deploy][:quorum] = find_internal_ip(nodes, 'zookeeper')\n end\n end\n\n return parsed_hash, parsed_hash_internal_ips\n end", "title": "" }, { "docid": "5bb64a429d22e1caa235e95c2560c229", "score": "0.5031663", "text": "def net_services\n svc = []\n# svc = cluster_configurations.map{ |cc| cc.net_service(self.node_type.node_type) }\n clusters.each do |cc| \n cc.services.each {|s|\n svc << [s.ha_ip_address , s.ha_port ,\n s.ha_proto, s.localport,\n \"#{net_type}#{cc.vlan}\" # local interface\n ]\n }\n svc << [nil, nil,'icmp', nil, \n \"#{net_type}#{cc.vlan}\" # local interface\n ]\n end\n #puts \"DEBUG:#{hostname}: #{svc.inspect}\" if is_load_balancer? \n if is_server? then \n svc2 = []\n svc.each { |s| \n svc2 << [\"\",\"\",s[2],s[3], mangle(s[4])]\n svc2 << [\"\",\"\",s[2],s[3], s[4]]\n }\n #puts \"DEBUG:#{hostname}: #{svc2.inspect}\" if is_load_balancer? \n svc.concat(svc2)\n end\n # will be wrong for virutal with SANs\n san = san_nics.map { |nic| [nil, nil, 'tcp', 22, nic.port_name] }\n svc.concat(san)\n if node_type.is_loadbalancer?\n ha_svc = ClusterConfiguration.find_all_ha_net_services\n svc.concat(ha_svc)\n # For Testing only - Delete after Feb 28, 2009 or come up with\n # something better\n test_vlans = Cluster.find(:all, :conditions => [\"vlan <= 102 and vlan > 8\"]).map{|c| c.vlan }\n testing_svc = test_vlans.map{|vlan|\n [nil,nil,'tcp',22, \"vlan#{vlan}\"]\n }.uniq\n svc.concat(testing_svc)\n testing_svc = test_vlans.map{|vlan|\n [nil,nil,'icmp',nil, \"vlan#{vlan}\"]\n }.uniq\n svc.concat(testing_svc)\n end\n # Icmp for application vlans\n if node_type.is_virtual?\n icmp = nics.map { |nic| \n [nil,nil,'icmp',nil, nic.port_name] if nic.port_name =~ /eth\\d+/ \n }.compact\n svc.concat(icmp)\n nginx = nics.map { |nic| \n [nil,nil,'tcp', 80, nic.port_name] if nic.lan? and nic.port_name =~ /eth\\d+/ \n }.compact\n svc.concat(nginx)\n end\n if hostname == 'uk01' then\n svc << [nil,nil,'tcp',11301,'eth4000']\n end\n rules = svc.map{|a| a.join(':') }\n if mgmt_ip_address then\n rules.concat( mgmt_ip_address.network.net_service(net_type) )\n end\n rules.map{|a| %Q(\\t\"#{a}\") }.sort.uniq.join(\"\\n\")\n end", "title": "" }, { "docid": "76b165d902452d302747bfd0eaa8d0ac", "score": "0.5024226", "text": "def configure\n @environment = facts.fetch(\"chef_environment\"){\"development\"}.downcase\n @fqdn = facts.fetch(\"fqdn\"){\"\"}\n @app_names = facts.fetch(\"trebuchet\"){[]}\n end", "title": "" }, { "docid": "48f8cd8be4a759ac1ece3210031470f6", "score": "0.50232446", "text": "def generate()\n say \"Generating Cloud #{ options[:cloud] } IaC\", :green\n @values = parse_cloud_config\n\n case options[:cloud]\n when 'aws'\n copy_file('aws/terraform/main.tf', 'terraform/main.tf')\n copy_file('aws/terraform/network.tf', 'terraform/network.tf')\n copy_file('aws/terraform/outputs.tf', 'terraform/outputs.tf')\n copy_file('aws/terraform/variables.tf', 'terraform/variables.tf')\n template('aws/terraform/terraform.tfvars.erb', 'terraform/terraform.tfvars')\n copy_file('aws/README.md', 'README.md')\n\n template('aws/bosh-install.sh.erb', 'bin/bosh-install.sh')\n template('aws/setup-tunnel.sh.erb', 'bin/setup-tunnel.sh')\n template('aws/concourse-deploy.sh.erb', 'bin/concourse-deploy.sh')\n template('aws/set-env.sh.erb', 'bin/set-env.sh')\n chmod('bin/bosh-install.sh', 0755)\n chmod('bin/concourse-deploy.sh', 0755)\n chmod('bin/setup-tunnel.sh', 0755)\n\n when 'gcp'\n copy_file('gcp/terraform/main.tf', 'terraform/main.tf')\n copy_file('gcp/terraform/network.tf', 'terraform/network.tf')\n copy_file('gcp/terraform/outputs.tf', 'terraform/outputs.tf')\n copy_file('gcp/terraform/variables.tf', 'terraform/variables.tf')\n template('gcp/terraform/terraform.tfvars.erb', 'terraform/terraform.tfvars')\n copy_file('gcp/README.md', 'README.md', force: true)\n\n template('gcp/bosh-install.sh.erb', 'bin/bosh-install.sh')\n template('gcp/bosh-vars.yml.erb', 'bosh-vars.yml')\n template('gcp/setup-tunnel.sh.erb', 'bin/setup-tunnel.sh')\n template('gcp/set-env.sh.erb', 'bin/set-env.sh')\n chmod('bin/bosh-install.sh', 0755)\n chmod('bin/setup-tunnel.sh', 0755)\n\n else\n say 'Cloud provider not specified'\n\n end\n end", "title": "" }, { "docid": "f0015d09e608f6a9764a52f2437d2f0b", "score": "0.5017324", "text": "def cluster() node[:cluster_name] ; end", "title": "" }, { "docid": "a32347d1851af2e30e6f12bd32c60410", "score": "0.50155884", "text": "def update\n # NOTE: API V1 dropped support for updating client keys via update (aka PUT),\n # but this code never supported key updating in the first place. Since\n # it was never implemented, we will simply ignore that functionality\n # as it is being deprecated.\n # Delete this comment after V0 support is dropped.\n payload = { name: name }\n payload[:validator] = validator unless validator.nil?\n\n # DEPRECATION\n # This field is ignored in API V1, but left for backwards-compat,\n # can remove after API V0 is no longer supported.\n payload[:admin] = admin unless admin.nil?\n\n begin\n new_client = chef_rest_v1.put(\"clients/#{name}\", payload)\n rescue Net::HTTPClientException => e\n # rescue API V0 if 406 and the server supports V0\n supported_versions = server_client_api_version_intersection(e, SUPPORTED_API_VERSIONS)\n raise e unless supported_versions && supported_versions.include?(0)\n\n new_client = chef_rest_v0.put(\"clients/#{name}\", payload)\n end\n\n Chef::ApiClientV1.from_hash(new_client)\n end", "title": "" }, { "docid": "e2600eeeb67dd6650674a4ea2bc8f13f", "score": "0.50152797", "text": "def action_deploy\n notifying_block do\n write_config\n end\n end", "title": "" }, { "docid": "71e75d91b9223729d0413e69d6ab048c", "score": "0.5003415", "text": "def setup_helper\n\n # Define ZOO_LOG_DIR\n node.default['apache_zookeeper'][\"env_vars\"][\"ZOO_LOG_DIR\"] = node['apache_zookeeper']['log_dir']\n\n # Make sure server ids are set or set them\n if !node['apache_zookeeper'][\"zoo.cfg\"].select{ |key, value| key.to_s.match(/\\Aserver.\\d+\\z/)}.empty?\n log \"Using given zoo.cfg config for server ids\"\n\n node['apache_zookeeper'][\"zoo.cfg\"].select{ |key, value| key.to_s.match(/\\Aserver.\\d+\\z/)}.each do |key, value|\n if does_server_match_node? value\n @zookeeper_myid = key[\"server.\".size, key.size]\n break\n end\n end\n\n raise \"Unable to find server [#{node[\"fqdn\"]} in zoo.cfg attributes #{node['apache_zookeeper'][\"zoo.cfg\"].select{ |key, value| key.to_s.match(/\\Aserver.\\d+\\z/)}}\" if @zookeeper_myid.nil?\n\n elsif node['apache_zookeeper'][\"servers\"].empty?\n log \"Configuring standalone zookeeper cluster\"\n else\n log \"Configuring mult-server zookeeper cluster\"\n\n id = 1\n node['apache_zookeeper'][\"servers\"].each do |server|\n if server.include? \":\"\n # If they include port information in their list of servers just use the raw value\n node.default['apache_zookeeper'][\"zoo.cfg\"][\"server.#{id}\"] = server\n else\n node.default['apache_zookeeper'][\"zoo.cfg\"][\"server.#{id}\"] = \"#{server}:#{node['apache_zookeeper'][\"follower_port\"]}:#{node['apache_zookeeper'][\"election_port\"]}\"\n end\n\n if does_server_match_node? server\n @zookeeper_myid = id.to_s\n end\n\n id = id + 1\n end\n\n raise \"Unable to find server [#{node[\"fqdn\"]} in servers attribute #{node['apache_zookeeper'][\"servers\"]}\" if @zookeeper_myid.nil?\n end\n\n end", "title": "" }, { "docid": "a7f39ea5f9246b1371bc782303787a79", "score": "0.50029325", "text": "def cluster_config\n Settings.clusters[name]\n end", "title": "" }, { "docid": "ceda48037696382d7332f57266cf7168", "score": "0.49981385", "text": "def api_v11_clusters_cluster_name_services_service_name_config_put_with_http_info(service_name, cluster_name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DefaultApi#api_v11_clusters_cluster_name_services_service_name_config_put ...\"\n end\n \n # verify the required parameter 'service_name' is set\n fail \"Missing the required parameter 'service_name' when calling api_v11_clusters_cluster_name_services_service_name_config_put\" if service_name.nil?\n \n # verify the required parameter 'cluster_name' is set\n fail \"Missing the required parameter 'cluster_name' when calling api_v11_clusters_cluster_name_services_service_name_config_put\" if cluster_name.nil?\n \n # resource path\n path = \"/api/v11/clusters/{clusterName}/services/{serviceName}/config\".sub('{format}','json').sub('{' + 'serviceName' + '}', service_name.to_s).sub('{' + 'clusterName' + '}', cluster_name.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'message'] = opts[:'message'] if opts[:'message']\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(:PUT, 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_clusters_cluster_name_services_service_name_config_put\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "68167f241bcbfdbca7bd7f84eb803562", "score": "0.49978775", "text": "def install_server(project_path=nil)\n environments = Engineyard::Jenkins::AppcloudEnv.new.find_environments(options)\n if environments.size == 0\n no_environments_discovered and return\n elsif environments.size > 1\n too_many_environments_discovered(environments) and return\n end\n \n env_name, account_name, environment = environments.first\n if environment.instances.first\n public_hostname = environment.instances.first.public_hostname\n status = environment.instances.first.status\n end\n \n temp_project_path = File.expand_path(project_path || File.join(Dir.tmpdir, \"temp_jenkins_server\"))\n shell.say \"Temp installation dir: #{temp_project_path}\" if options[:verbose]\n \n FileUtils.mkdir_p(temp_project_path)\n FileUtils.chdir(temp_project_path) do\n # 'install_server' generator\n require 'engineyard-jenkins/cli/install_server_generator'\n Engineyard::Jenkins::InstallServerGenerator.start(ARGV.unshift(temp_project_path))\n\n say \"\"\n say \"Uploading to \"; say \"'#{env_name}' \", :yellow; say \"environment on \"; say \"'#{account_name}' \", :yellow; say \"account...\"\n require 'engineyard/cli/recipes'\n environment.tar_and_upload_recipes_in_cookbooks_dir\n\n if status == \"running\" || status == \"error\"\n say \"Environment is rebuilding...\"\n environment.run_custom_recipes\n watch_page_while public_hostname, 80, \"/\" do |req|\n req.body !~ /Please wait while Jenkins is getting ready to work/\n end\n\n say \"\"\n say \"Jenkins is starting...\"\n watch_page_while public_hostname, 80, \"/\" do |req|\n req.body =~ /Please wait while Jenkins is getting ready to work/\n end\n \n require 'jenkins'\n require 'jenkins/config'\n ::Jenkins::Config.config[\"base_uri\"] = public_hostname\n ::Jenkins::Config.store!\n \n say \"\"\n say \"Done! Jenkins CI hosted at \"; say \"http://#{public_hostname}\", :green\n else\n say \"\"\n say \"Almost there...\"\n say \"* Boot your environment via https://cloud.engineyard.com\", :yellow\n end\n end\n end", "title": "" }, { "docid": "9a0fdb43be7b2ec71587405f4438e8c3", "score": "0.499388", "text": "def api_v11_clusters_post_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DefaultApi#api_v11_clusters_post ...\"\n end\n \n # resource path\n path = \"/api/v11/clusters\".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_clusters_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "8b25831c8792b7ea50d1f2717182638b", "score": "0.4991566", "text": "def deploy_on_virtual_cluster(params, add_key_options, run_instances_options)\n if lock\n begin\n timestamp = Time.now.to_i\n pid = fork do\n begin\n redirect_standard_io(timestamp) do\n key_file = File.expand_path(\"~/.appscale/#{params[:virtual_keyname]}\")\n if File.exists?(key_file)\n puts \"AppScale key '#{params[:virtual_keyname]}' found on the disk. Reusing...\"\n else\n puts \"AppScale key '#{params[:virtual_keyname]}' not found on the disk. Generating...\"\n AppScaleTools.add_keypair(add_key_options)\n end\n AppScaleTools.run_instances(run_instances_options)\n end\n ensure\n # If the fork was successful, the sub-process should release the lock\n unlock\n end\n end\n Process.detach(pid)\n return [true, timestamp, pid]\n rescue Exception => e\n # If something went wrong with the fork, release the lock immediately and return\n unlock\n return [false, \"Unexpected Runtime Error\", \"Runtime error while executing\" +\n \" appscale tools: #{e.message}\"]\n end\n else\n return [false, \"Server Busy\", \"AppsCake is currently busy deploying a cloud.\" +\n \" Please try again later.\"]\n end\nend", "title": "" }, { "docid": "9357f4691dc66b42b8fe98db562f7d85", "score": "0.49900714", "text": "def configure_chef_only_once\r\n bootstrap_options = value_from_json_file(handler_settings_file,'runtimeSettings','0','handlerSettings', 'publicSettings', 'bootstrap_options')\r\n bootstrap_options = eval(bootstrap_options) ? eval(bootstrap_options) : {}\r\n\r\n if File.directory?(\"#{bootstrap_directory}\")\r\n puts \"#{Time.now} Bootstrap directory [#{bootstrap_directory}] already exists, skipping creation...\"\r\n else\r\n puts \"#{Time.now} Bootstrap directory [#{bootstrap_directory}] does not exist, creating...\"\r\n FileUtils.mkdir_p(\"#{bootstrap_directory}\")\r\n end\r\n\r\n puts \"#{Time.now} Creating chef configuration files\"\r\n\r\n copy_settings_file\r\n\r\n load_settings\r\n\r\n begin\r\n require 'chef/azure/core/bootstrap_context'\r\n\r\n config = configure_settings(bootstrap_options)\r\n\r\n Chef::Config[:validation_key_content] = @validation_key\r\n Chef::Config[:client_key_content] = @client_key\r\n Chef::Config[:chef_server_ssl_cert_content] = @chef_server_ssl_cert\r\n template_file = File.expand_path(File.dirname(File.dirname(__FILE__)))\r\n runlist = @run_list.empty? ? [] : escape_runlist(@run_list)\r\n load_cloud_attributes_in_hints if ! @ohai_hints.empty?\r\n\r\n if windows?\r\n context = Chef::Knife::Core::WindowsBootstrapContext.new(config, runlist, Chef::Config, config[:secret])\r\n template_file += \"\\\\bootstrap\\\\windows-chef-client-msi.erb\"\r\n bootstrap_bat_file ||= \"#{ENV['TMP']}/bootstrap.bat\"\r\n template = IO.read(template_file).chomp\r\n bash_template = Erubis::Eruby.new(template).evaluate(context)\r\n File.open(bootstrap_bat_file, 'w') {|f| f.write(bash_template)}\r\n bootstrap_command = \"cmd.exe /C #{bootstrap_bat_file}\"\r\n else\r\n context = Chef::Knife::Core::BootstrapContext.new(config, runlist, Chef::Config, config[:secret])\r\n template_file += '/bootstrap/chef-full.erb'\r\n template = IO.read(template_file).chomp\r\n bootstrap_command = Erubis::Eruby.new(template).evaluate(context)\r\n end\r\n\r\n result = shell_out(bootstrap_command)\r\n result.error!\r\n puts \"#{Time.now} Created chef configuration files\"\r\n\r\n # remove the temp bootstrap file\r\n FileUtils.rm(bootstrap_bat_file) if windows?\r\n rescue Mixlib::ShellOut::ShellCommandFailed => e\r\n Chef::Log.warn \"chef-client configuration files creation failed (#{e})\"\r\n @chef_client_error = \"chef-client configuration files creation failed (#{e})\"\r\n return\r\n rescue => e\r\n Chef::Log.error e\r\n @chef_client_error = \"chef-client configuration files creation failed (#{e})\"\r\n return\r\n end\r\n\r\n if @extended_logs == 'true'\r\n @chef_client_success_file = windows? ? \"c:\\\\chef_client_success\" : \"/tmp/chef_client_success\"\r\n end\r\n\r\n # Runs chef-client with custom recipe to set the run_list and environment\r\n begin\r\n current_dir = File.expand_path(File.dirname(File.dirname(__FILE__)))\r\n first_client_run_recipe_path = windows? ? \"#{current_dir}\\\\first_client_run_recipe.rb\" : \"#{current_dir}/first_client_run_recipe.rb\"\r\n if !config[:first_boot_attributes][\"policy_name\"].nil? and !config[:first_boot_attributes][\"policy_group\"].nil?\r\n command = \"chef-client -j #{bootstrap_directory}/first-boot.json -c #{bootstrap_directory}/client.rb -L #{@azure_plugin_log_location}/chef-client.log --once\"\r\n else\r\n command = \"chef-client #{first_client_run_recipe_path} -j #{bootstrap_directory}/first-boot.json -c #{bootstrap_directory}/client.rb -L #{@azure_plugin_log_location}/chef-client.log --once\"\r\n end\r\n command += \" -E #{config[:environment]}\" if config[:environment]\r\n result = shell_out(command)\r\n result.error!\r\n rescue Mixlib::ShellOut::ShellCommandFailed => e\r\n Chef::Log.error \"First chef-client run failed. (#{e})\"\r\n @chef_client_error = \"First chef-client run failed (#{e})\"\r\n return\r\n rescue => e\r\n Chef::Log.error e\r\n @chef_client_error = \"First chef-client run failed (#{e})\"\r\n end\r\n\r\n params = \"-c #{bootstrap_directory}/client.rb -L #{@azure_plugin_log_location}/chef-client.log --once \"\r\n\r\n # Runs chef-client in background using scheduled task if windows else using process\r\n if windows?\r\n puts \"#{Time.now} Creating scheduled task with runlist #{runlist}..\"\r\n schtask = \"SCHTASKS.EXE /Create /TN \\\"Chef Client First Run\\\" /RU \\\"NT Authority\\\\System\\\" /RP /RL \\\"HIGHEST\\\" /SC ONCE /TR \\\"cmd /c 'C:\\\\opscode\\\\chef\\\\bin\\\\chef-client #{params}'\\\" /ST \\\"#{Time.now.strftime('%H:%M')}\\\" /F\"\r\n\r\n begin\r\n result = @extended_logs == 'true' ? shell_out(\"#{schtask} && touch #{@chef_client_success_file}\") : shell_out(schtask)\r\n result.error!\r\n @chef_client_run_start_time = Time.now\r\n\r\n # call to run scheduled task immediately after creation\r\n result = shell_out(\"SCHTASKS.EXE /Run /TN \\\"Chef Client First Run\\\"\")\r\n result.error!\r\n rescue Mixlib::ShellOut::ShellCommandFailed => e\r\n Chef::Log.error \"Creation or running of scheduled task for first chef-client run failed (#{e})\"\r\n @chef_client_error = \"Creation or running of scheduled task for first chef-client run failed (#{e})\"\r\n rescue => e\r\n Chef::Log.error e\r\n @chef_client_error = \"Creation or running of scheduled task for first chef-client run failed (#{e})\"\r\n end\r\n puts \"#{Time.now} Created and ran scheduled task for first chef-client run with runlist #{runlist}\"\r\n else\r\n command = @extended_logs == 'true' ? \"chef-client #{params} && touch #{@chef_client_success_file}\" : \"chef-client #{params}\"\r\n @child_pid = Process.spawn command\r\n @chef_client_run_start_time = Time.now\r\n Process.detach @child_pid\r\n puts \"#{Time.now} Successfully launched chef-client process with PID [#{@child_pid}]\"\r\n end\r\n end", "title": "" }, { "docid": "d0784249639d24b6aa21a752c3f3e573", "score": "0.49828675", "text": "def update!(**args)\n @admin_cluster_membership = args[:admin_cluster_membership] if args.key?(:admin_cluster_membership)\n @admin_cluster_name = args[:admin_cluster_name] if args.key?(:admin_cluster_name)\n @annotations = args[:annotations] if args.key?(:annotations)\n @bare_metal_version = args[:bare_metal_version] if args.key?(:bare_metal_version)\n @binary_authorization = args[:binary_authorization] if args.key?(:binary_authorization)\n @cluster_operations = args[:cluster_operations] if args.key?(:cluster_operations)\n @control_plane = args[:control_plane] if args.key?(:control_plane)\n @create_time = args[:create_time] if args.key?(:create_time)\n @delete_time = args[:delete_time] if args.key?(:delete_time)\n @description = args[:description] if args.key?(:description)\n @endpoint = args[:endpoint] if args.key?(:endpoint)\n @etag = args[:etag] if args.key?(:etag)\n @fleet = args[:fleet] if args.key?(:fleet)\n @load_balancer = args[:load_balancer] if args.key?(:load_balancer)\n @local_name = args[:local_name] if args.key?(:local_name)\n @maintenance_config = args[:maintenance_config] if args.key?(:maintenance_config)\n @maintenance_status = args[:maintenance_status] if args.key?(:maintenance_status)\n @name = args[:name] if args.key?(:name)\n @network_config = args[:network_config] if args.key?(:network_config)\n @node_access_config = args[:node_access_config] if args.key?(:node_access_config)\n @node_config = args[:node_config] if args.key?(:node_config)\n @os_environment_config = args[:os_environment_config] if args.key?(:os_environment_config)\n @proxy = args[:proxy] if args.key?(:proxy)\n @reconciling = args[:reconciling] if args.key?(:reconciling)\n @security_config = args[:security_config] if args.key?(:security_config)\n @state = args[:state] if args.key?(:state)\n @status = args[:status] if args.key?(:status)\n @storage = args[:storage] if args.key?(:storage)\n @uid = args[:uid] if args.key?(:uid)\n @update_time = args[:update_time] if args.key?(:update_time)\n @upgrade_policy = args[:upgrade_policy] if args.key?(:upgrade_policy)\n @validation_check = args[:validation_check] if args.key?(:validation_check)\n end", "title": "" }, { "docid": "faac07d128650651fcff12098d151999", "score": "0.4982436", "text": "def discover_chef_clients!\n servers.each(&:chef_client)\n end", "title": "" }, { "docid": "5a6d85ba5008bb256fea1403678dacaf", "score": "0.49808758", "text": "def filesync_deploy\n @logger.debug('Pem::filesync_deploy') { 'starting filesync deploy' }\n\n ssl_options = {\n 'client_cert' => OpenSSL::X509::Certificate.new(File.read(@conf['filesync_cert'])),\n 'client_key' => OpenSSL::PKey::RSA.new(File.read(@conf['filesync_cert_key'])),\n 'ca_file' => @conf['filesync_ca_cert'],\n }\n\n conn = Faraday.new(url: \"https://#{@conf['master']}:8140\", ssl: ssl_options) do |faraday|\n faraday.request :json\n faraday.options[:timeout] = 300\n faraday.adapter Faraday.default_adapter\n end\n\n @logger.debug('Pem::filesync_deploy') { 'Hitting filesync commit endpoint...' }\n conn.post '/file-sync/v1/commit', 'commit-all' => true\n @logger.debug('Pem::filesync_deploy') { 'Done.' }\n\n @logger.debug('Pem::filesync_deploy') { 'Hitting filesync force-sync endpoint...' }\n conn.post '/file-sync/v1/force-sync'\n @logger.debug('Pem::filesync_deploy') { 'Done.' }\n\n @logger.debug('Pem::filesync_deploy') { 'Hitting puppet-admin-api env endpoint...' }\n conn.delete '/puppet-admin-api/v1/environment-cache'\n @logger.debug('Pem::filesync_deploy') { 'Done.' }\n\n @logger.debug('Pem::filesync_deploy') { 'completed filesync deploy' }\n end", "title": "" } ]
650c9e309697ba08f2748d68b41d7ada
Create a payment URL. Use this to generate an embedding payment link.
[ { "docid": "901de167526de219fe40c111c862c29d", "score": "0.6741646", "text": "def create_payment_url(content_type, client_request_id, api_key, timestamp, payment_url_request, opts = {})\n data, _status_code, _headers = create_payment_url_with_http_info(content_type, client_request_id, api_key, timestamp, payment_url_request, opts)\n data\n end", "title": "" } ]
[ { "docid": "ed7f78aa994514c2bc020c7728f5f37c", "score": "0.6612736", "text": "def create\n order = current_user.orders.find(params[:order_id])\n @payment = Payment.new\n @payment.price = order.price\n @payment.order_id = order.id\n @payment.variable_symbol = order.id.to_s + rand(1..100).to_s.rjust(3, '0')\n url = get_link_url\n @payment.save!\n\n respond_to do |format|\n if @payment.save\n format.html { redirect_to url }\n format.json { render :show, status: :created, location: url }\n else\n format.html { render :new }\n format.json { render json: @payment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "60b94f71b8af61f2fa51ae910cc3ef24", "score": "0.6569168", "text": "def payment_url\n DmEvent::Engine.routes.url_helpers.register_choose_payment_url(uuid, host: Account.current.url_host, locale: I18n.locale)\n end", "title": "" }, { "docid": "b1352ff8f70d7bab76deb72ae511ec93", "score": "0.6515421", "text": "def payment_redirection_url(token = nil)\n self.endpoint_url_with_token(:pay, token)\n end", "title": "" }, { "docid": "6828d9519a2e70e76916ba1183b73bef", "score": "0.6491648", "text": "def pay_url(params = {})\n sanity_check!\n md5sum = Digest::MD5.hexdigest([\n id,\n params[:kwota],\n params[:crc],\n security_code\n ].join)\n params.merge!({id: id, md5sum: md5sum})\n URI::HTTPS.build(host: \"secure.tpay.com\", query: params.to_query).to_s\n end", "title": "" }, { "docid": "ce8b3428feaab22ee78a2f767f79f7fe", "score": "0.6385724", "text": "def purchase_offsite_url(money, options = {})\n requires!(options, :order_id, :return_url)\n requires!(@options, :secure_hash)\n\n post = {}\n\n add_amount(post, money, options)\n add_invoice(post, options)\n add_creditcard_type(post, options[:card_type]) if options[:card_type]\n\n post[:Locale] = options[:locale] || 'en'\n post[:ReturnURL] = options[:return_url]\n\n add_standard_parameters('pay', post, options[:unique_id])\n\n add_secure_hash(post)\n\n self.server_hosted_url + '?' + post_data(post)\n end", "title": "" }, { "docid": "e767e3f71a6add20d540a0440e2081aa", "score": "0.63792133", "text": "def url( params )\n raise \"amount has to be a positive number\" if params[:amount].to_i <= 0\n raise \"order id can not be blank\" if params[:order_id].to_s.empty?\n\n data = [\n @website_id,\n Currency::VND, # 1=VND, 2=USD\n params[:order_id],\n params[:amount].to_i.to_s, # VND only\n @account,\n screen_method(),\n @secret_key,\n @callback_url,\n ].join(\"-\")\n sign = Digest::SHA256.hexdigest( data ).upcase\n url = base_url()\n\n query = {\n \"website_id\": @website_id,\n \"payment_method\": Currency::VND,\n \"order_code\": params[:order_id],\n \"amount\": params[:amount].to_i.to_s,\n \"receiver_acc\": @account,\n \"urlreturn\": CGI.escape(@callback_url.to_s),\n \"customer_first_name\": CGI.escape(params[:first_name].to_s),\n \"customer_last_name\": CGI.escape(params[:last_name].to_s),\n \"customer_mobile\": CGI.escape(params[:mobile].to_s),\n \"bill_to_address_line1\": CGI.escape(params[:address1].to_s),\n \"bill_to_address_line2\": CGI.escape(params[:address2].to_s),\n \"city_name\": CGI.escape(params[:city_name].to_s),\n \"address_country\": CGI.escape(params[:country].to_s),\n \"customer_email\": CGI.escape(params[:email].to_s),\n \"order_des\": CGI.escape(params[:order_description].to_s),\n \"param_extend\": CGI.escape(screen_method()),\n \"sign\": sign,\n }\n url += \"?\"\n url += query.map{|k,v| [k,v].join(\"=\") }.join(\"&\")\n url\n end", "title": "" }, { "docid": "94e7d75e476214602a2577daf440d63f", "score": "0.6376867", "text": "def embedded_url\n\t\t\t\"#{self.base_url}/webapps/adaptivepayment/flow/pay?payKey=#{self[:pay_key]}#{\"&preapprovalkey=#{self[:preapproval_key]}\" if command == :preapproval}\" if webscr?\n\t\tend", "title": "" }, { "docid": "480f202e25fc97b40233e38c1f2bc01e", "score": "0.62931424", "text": "def create_payment_link(body:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::POST,\n '/v2/online-checkout/payment-links',\n 'default')\n .header_param(new_parameter('application/json', key: 'Content-Type'))\n .body_param(new_parameter(body))\n .header_param(new_parameter('application/json', key: 'accept'))\n .body_serializer(proc do |param| param.to_json unless param.nil? end)\n .auth(Single.new('global')))\n .response(new_response_handler\n .deserializer(APIHelper.method(:json_deserialize))\n .is_api_response(true)\n .convertor(ApiResponse.method(:create)))\n .execute\n end", "title": "" }, { "docid": "9877e87d8b6da51b00218ecde106d7a0", "score": "0.6203234", "text": "def link(wallet_id, otp)\n\t\t\t\tJuspayCheckout::ExpressCheckout.request(\"/wallets/#{wallet_id}\", 'post', {command: 'link', otp: otp})\n\t\t\tend", "title": "" }, { "docid": "e4dd81f3ba6bc3d3733c8525e3eb147c", "score": "0.61380714", "text": "def return_url\n order = Order.find_by_pretty_id(alipay_params[:out_trade_no])\n @payment = save_third_party_params(order, {return_url: alipay_params, return_at: Time.now})\n topup_transaction!(order, @payment)\n end", "title": "" }, { "docid": "7815e6fac2b1d73e81f1d5a5480f5810", "score": "0.61309147", "text": "def payment_url_for_payment(payment)\n if @payment_method.blank? || CARD_METHODS.include?(@payment_method)\n nil\n else\n existing_transaction = MakeCommerceRequest.where(payment_id: payment.id).last\n\n if existing_transaction.present?\n # Transaction has already been prepared in MakeCommerce environment\n # Load payment service url from shop enabled methods hash\n url = (payment_method_hash(shop_payment_methods, @payment_method, @country_code) || {})[:url]\n url_with_transaction(url, existing_transaction.external_transaction_key) if url.present?\n else\n # Prepare transaction in MakeCommerce environment\n transaction = client.create_transaction(payload_for_transaction(payment))\n\n if transaction.present? && transaction[:status] == 'CREATED'\n MakeCommerceRequest.where(payment_id: payment.id, external_transaction_key: transaction[:id], payment_method: @payment_method)\n # Load payment service url from transaction enabled methods hash\n (payment_method_hash(transaction[:payment_methods][:banklinks], @payment_method, @country_code) || {})[:url]\n end\n end\n end\n end", "title": "" }, { "docid": "914ce39c07df45dd86df1b753abb1535", "score": "0.6112068", "text": "def create_paypal_checkout_url\n gross = calculate_gross\n\n options = {\n amount: gross.to_s,\n item_name: \"Bountysource Order ##{id}\",\n item_number: id,\n\n cmd: '_xclick',\n # cmd: '_cart', # uncomment to enable items on paypal checkout page\n # upload: '1', # uncomment if cmd: _cart\n\n notify_url: Api::Application.config.paypal[:notify_url],\n return: Api::Application.config.paypal[:return_url],\n\n business: Api::Application.config.paypal[:email],\n no_shipping: '1',\n no_note: '1'\n }\n\n ## Append item info if using cmd: _cart\n #load_items.each_with_index do |item, i|\n # item_amounts = Transaction::Order.amounts_for_item(item, Account::Paypal.instance)\n #\n # options.merge!(\n # \"item_name_#{i+1}\" => self.class.item_display_name(item),\n # \"amount_#{i+1}\" => Money.new(item_amounts.item * 100).to_s,\n # \"handling_#{i+1}\" => Money.new(item_amounts.fee * 100).to_s\n # )\n #end\n\n \"#{Api::Application.config.paypal[:checkout_url]}cgi-bin/webscr?#{options.to_param}\"\n end", "title": "" }, { "docid": "4cb08a1c0b0a92706a480dc6e02229f8", "score": "0.6105935", "text": "def payment_url(option, type = nil)\n uri = URI.parse 'https://merchant.roboxchange.com/Index.aspx'\n\n sig = Digest::MD5.hexdigest [self.class.login, self.amount, self.txn_id, self.password1].join(':')\n uri.query = {\n :MrchLogin => self.class.login,\n :OutSum => self.amount,\n :InvId => self.txn_id,\n :Desc => \"Тейсти-премиум для тлога @#{self.user.url} за #{option.days_text}\",\n :SignatureValue => sig,\n :IncCurrLabel => type.try(:code),\n :Email => self.user.is_confirmed? ? self.user.email : nil,\n :Culture => 'ru'\n }.to_query\n\n uri.to_s\n end", "title": "" }, { "docid": "a0bd00d028e42c9d8a66a2958be33fea", "score": "0.60874844", "text": "def payment\n mp_payment = @order.current_payment\n\n if mp_payment.source.nil? or mp_payment.source.redirect_url.nil?\n response = create_preferences mp_payment\n if response\n point_key = provider.sandbox ? 'sandbox_init_point' : 'init_point'\n redirect_url = response[point_key]\n\n mp_payment.source = MercadoPagoSource.create!\n mp_payment.source.redirect_url = redirect_url\n mp_payment.save!\n else\n render json: {ok: false}\n return\n end\n end\n\n render json: {redirect_url: mp_payment.source.redirect_url, ok: true}\n end", "title": "" }, { "docid": "4bcc6c75ea802d420c3747d0b41db490", "score": "0.60855484", "text": "def create\n @payment = Payment.new(payment_params)\n @payment.order_id = params[:order_id]\n respond_to do |format|\n if @payment.save\n response_json = {cardNo: @payment.cardNo, expires: @payment.expires, name: @payment.name, amount: @payment.amount, _links: { next: {profile: \"http://#{my_address}:3000/order\", href: \"http://#{my_address}:3000/orders/#{@payment.order_id}\", enctype: 'application/json'}}}\n format.html { redirect_to @payment, notice: 'Payment was successfully created.' }\n format.json { render json: response_json, status: :created, location: @payment }\n else\n format.html { render action: 'new' }\n format.json { render json: @payment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8fb13348e717a4b2cfe8330d85d097be", "score": "0.60710335", "text": "def build_url(product, options = nil)\n \"#{BASE_URL}#{product}#{build_query_string(options)}\"\n end", "title": "" }, { "docid": "79a0381e8f62ebb851a98b744cd40b9d", "score": "0.60569715", "text": "def generate_tracking_url\n self.tracking_url ||=\n courier.generate_tracking_url(\n consignment: consignment_number,\n postcode: postcode,\n order_number: order_number\n )\n end", "title": "" }, { "docid": "6d14cf35388db602a67c832025d342ba", "score": "0.6008132", "text": "def generate_url(path, params = {})\n params['client'] ||= client_id\n signature_base_string = \"#{path}?#{URI.encode_www_form(params)}\"\n \"#{base_url}#{signature_base_string}&signature=#{generate_signature(signature_base_string)}\"\n end", "title": "" }, { "docid": "c2d4904cc6a38b8f0a4ecf0980d87b71", "score": "0.5900914", "text": "def return_url\n validate_payment_url(self, nonce: init_nonce, protocol: return_url_protocol)\n end", "title": "" }, { "docid": "3e9068d58c27ecc300be0f4f117e977f", "score": "0.5755185", "text": "def generateUrl(additionalParams={})\n finalParams = self._setFinalParams(additionalParams)\n options = {}\n options['product'] = self\n options['renderParameters'] = finalParams\n params = @serverManager.buildRenderCommand(options)\n if params then\n url = @serverManager.buildRenderServerUrlRequest(params)\n url\n end\n end", "title": "" }, { "docid": "9a89cfb19fa11ece25d7ca4e36ec03ea", "score": "0.57303566", "text": "def use_webtopay \n wp_extras = {\n callbackurl: confirm_order_url,\n cancelurl: confirm_order_url,\n accepturl: confirm_order_url,\n orderid: 20\n }\n\n @payment = WebToPay::Payment(payment_params.merge(wp_extras))\n redirect_to @payment.url\n end", "title": "" }, { "docid": "a3c29af6c7438636aeedaeecacdc1f7b", "score": "0.56978834", "text": "def payment_factory\n\t\t\tpayment = Payment.new\n\t\t\tpayment.return_url_ok = self.success_url\n\t\t\tpayment.return_url_cancel = self.failed_url\n\t\t\treturn payment\n\t\tend", "title": "" }, { "docid": "11f7d1e72dbd3d47fd0cbd17b1235325", "score": "0.5693814", "text": "def gen_payment\n cc = @data_object\n pay = Payment.new\n pay.pay_type = Payment::CC\n pay.pay_our_ref = \"CC:\" + sprintf(\"%06d\", cc.cc_id)\n pay.pay_doc_ref = cc.cc_trans_id\n pay.pay_payor = cc.cc_payor[0, 40]\n pay.pay_amount = cc.cc_amount\n pay\n end", "title": "" }, { "docid": "eaef681a85dbd6662839d9abbcbf3baf", "score": "0.56317365", "text": "def generate_url(template); end", "title": "" }, { "docid": "d44d1686da0c48f8d2001a9bbf800911", "score": "0.5617654", "text": "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", "title": "" }, { "docid": "e69802612029d95f0f4106e8be6fec21", "score": "0.5600973", "text": "def payment\n @amount = 10.00\n @sim_transaction = AuthorizeNet::SIM::Transaction.new(AUTHORIZE_NET_CONFIG['api_login_id'], AUTHORIZE_NET_CONFIG['api_transaction_key'], @amount, :hosted_payment_form => true)\n @sim_transaction.set_hosted_payment_receipt(AuthorizeNet::SIM::HostedReceiptPage.new(:link_method => AuthorizeNet::SIM::HostedReceiptPage::LinkMethod::GET, :link_text => 'Continue', :link_url => payments_thank_you_url(:only_path => false)))\n\n end", "title": "" }, { "docid": "5385be43ff29d83bb932d97872794533", "score": "0.55866504", "text": "def payment_form_url\n \"#{host}/form/#{session_token}\"\n end", "title": "" }, { "docid": "cd4a18d5a761cddf3a77ef071623afa7", "score": "0.5576746", "text": "def create_payment_url_with_http_info(content_type, client_request_id, api_key, timestamp, payment_url_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PaymentURLApi.create_payment_url ...'\n end\n # verify the required parameter 'content_type' is set\n if @api_client.config.client_side_validation && content_type.nil?\n fail ArgumentError, \"Missing the required parameter 'content_type' when calling PaymentURLApi.create_payment_url\"\n end\n # verify enum value\n allowable_values = [\"application/json\"]\n if @api_client.config.client_side_validation && !allowable_values.include?(content_type)\n fail ArgumentError, \"invalid value for \\\"content_type\\\", must be one of #{allowable_values}\"\n end\n # verify the required parameter 'client_request_id' is set\n if @api_client.config.client_side_validation && client_request_id.nil?\n fail ArgumentError, \"Missing the required parameter 'client_request_id' when calling PaymentURLApi.create_payment_url\"\n end\n # verify the required parameter 'api_key' is set\n if @api_client.config.client_side_validation && api_key.nil?\n fail ArgumentError, \"Missing the required parameter 'api_key' when calling PaymentURLApi.create_payment_url\"\n end\n # verify the required parameter 'timestamp' is set\n if @api_client.config.client_side_validation && timestamp.nil?\n fail ArgumentError, \"Missing the required parameter 'timestamp' when calling PaymentURLApi.create_payment_url\"\n end\n # verify the required parameter 'payment_url_request' is set\n if @api_client.config.client_side_validation && payment_url_request.nil?\n fail ArgumentError, \"Missing the required parameter 'payment_url_request' when calling PaymentURLApi.create_payment_url\"\n end\n # resource path\n local_var_path = '/payment-url'\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 # header_params[:'Content-Type'] = content_type\n header_params[:'Client-Request-Id'] = client_request_id\n header_params[:'Api-Key'] = api_key\n header_params[:'Timestamp'] = timestamp\n header_params[:'Message-Signature'] = opts[:'message_signature'] if !opts[:'message_signature'].nil?\n header_params[:'Region'] = opts[:'region'] if !opts[:'region'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] || @api_client.object_to_http_body(payment_url_request) \n\n # return_type\n return_type = opts[:return_type] || 'PaymentUrlResponse' \n\n # auth_names\n auth_names = opts[:auth_names] || []\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PaymentURLApi#create_payment_url\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "f1917e09d5e504968358fae6d99a6431", "score": "0.55597526", "text": "def construct_url(method, format, dev_id, signature, session_id, formatted_timestamp)\n \"#{API_END_POINT}/#{method}#{format}/#{dev_id}/#{signature}/#{session_id}/#{formatted_timestamp}\"\n end", "title": "" }, { "docid": "78ccfc92f1213a81a79cbe8d3a22dc5e", "score": "0.55592483", "text": "def set_receipt_url\r\n if @PARAM_HASH['RECEIPT_FORM_ID']== 'remote_url'\r\n return @PARAM_HASH['REMOTE_URL']\r\n else\r\n return 'https://secure.bluepay.com/interfaces/shpf?SHPF_FORM_ID=' + @PARAM_HASH['RECEIPT_FORM_ID'] + \r\n '&SHPF_ACCOUNT_ID=' + ACCOUNT_ID + \r\n '&SHPF_TPS_DEF=' + url_encode(@receipt_tps_def) + \r\n '&SHPF_TPS=' + url_encode(@receipt_tamper_proof_seal) + \r\n '&RETURN_URL=' + url_encode(@PARAM_HASH['RETURN_URL']) + \r\n '&DBA=' + url_encode(@PARAM_HASH['DBA']) + \r\n '&AMEX_IMAGE=' + url_encode(@PARAM_HASH['AMEX_IMAGE']) + \r\n '&DISCOVER_IMAGE=' + url_encode(@PARAM_HASH['DISCOVER_IMAGE'])\r\n end\r\n end", "title": "" }, { "docid": "151a9b5e4c214d5c6bc2b5885f49ef76", "score": "0.55591184", "text": "def ws_url\n \"#{self.endpoint}/merchant/xmlpayment\"\n end", "title": "" }, { "docid": "9f35017219540746d60a776507eefa81", "score": "0.55548805", "text": "def create\n @payment = @contract.payments.new(payment_params)\n\n if @payment.save\n render :show, status: :created, location: url_for([@contract, @payment])\n else\n render json: @payment.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "a363149128842a51c903c327aa21d96f", "score": "0.5549725", "text": "def gateway_url\n if developer?\n File.join \"/pagseguro_developer/create\"\n else\n GATEWAY_URL\n end\n end", "title": "" }, { "docid": "9057cdff5eefbf2e0699b2032e8e0562", "score": "0.55416405", "text": "def payout\n\t\t# if !current_user.merchant_id.blank?\n # \t\t\taccount = Stripe::Account.retrieve(current_user.merchant_id)\n # \t\t\t@login_link = account.login_links.create()\n\t\t# end\n end", "title": "" }, { "docid": "f2124a0368bddd7e18dfaba1d8fb87af", "score": "0.5528644", "text": "def create_payment(params)\n # Validation\n params = validate_input(params, @exception_array += %w[currency value])\n # The Request Body Parameters\n k2_request_pay_amount = {\n currency: params['currency'],\n value: params['value']\n }\n k2_request_pay_metadata = {\n customerId: 8_675_309,\n notes: 'Salary payment for May 2018'\n }\n create_payment_body = {\n destination: 'c7f300c0-f1ef-4151-9bbe-005005aa3747',\n amount: k2_request_pay_amount,\n metadata: k2_request_pay_metadata,\n callback_url: 'https://your-call-bak.yourapplication.com/payment_result'\n }\n create_payment_hash = K2Pay.make_hash('payments', 'POST', @access_token, 'PAY', create_payment_body)\n @threads << Thread.new do\n sleep 0.25\n @location_url = K2Connect.to_connect(create_payment_hash)\n end\n @threads.each(&:join)\n end", "title": "" }, { "docid": "088f02ba00b9ca753209bbe136191b6c", "score": "0.552076", "text": "def retrieve_payment_link(id:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::GET,\n '/v2/online-checkout/payment-links/{id}',\n 'default')\n .template_param(new_parameter(id, key: 'id')\n .should_encode(true))\n .header_param(new_parameter('application/json', key: 'accept'))\n .auth(Single.new('global')))\n .response(new_response_handler\n .deserializer(APIHelper.method(:json_deserialize))\n .is_api_response(true)\n .convertor(ApiResponse.method(:create)))\n .execute\n end", "title": "" }, { "docid": "1dfbca3bf6a83c69323617b45129c424", "score": "0.55136603", "text": "def url()\n set_signature\n\n url = service_end_point + \"?\"\n\n param_string = @params.map do |key,value|\n [key,value].map { |string| Amazon::FPS::SignatureUtils.urlencode(string) }.join '='\n end.join '&'\n\n url + param_string\n end", "title": "" }, { "docid": "00ff7da319074b35c1154688e53ec9c1", "score": "0.5513631", "text": "def generate_link(params)\n q = params.reduce([]) do |m,(k,v)|\n if v.is_a?(Hash)\n m + v.reduce([]) do |mm,(kk,vv)|\n mm + [ \"#{k}[#{kk}]=#{URI.escape(vv.to_s)}\" ]\n end\n else\n m + [ \"#{k}=#{URI.escape(v.to_s)}\" ]\n end\n end\n\n q.empty? ?\n @request.uri :\n \"#{@request.uri}?#{q.join('&')}\"\n end", "title": "" }, { "docid": "5ff2cdaad83738077d70b49955b7120c", "score": "0.5512531", "text": "def url\n 'https://secure.ccavenue.com/transaction/transaction.do'\n end", "title": "" }, { "docid": "cb1442fe683fbaa4d8fe955f897a8958", "score": "0.5512125", "text": "def set_receipt_url\r\n if @PARAM_HASH['RECEIPT_FORM_ID']== 'remote_url'\r\n return @PARAM_HASH['REMOTE_URL']\r\n else\r\n return 'https://secure.bluepay.com/interfaces/shpf?SHPF_FORM_ID=' + @PARAM_HASH['RECEIPT_FORM_ID'] + \r\n '&SHPF_ACCOUNT_ID=' + @ACCOUNT_ID + \r\n '&SHPF_TPS_DEF=' + url_encode(@receipt_tps_def) + \r\n '&SHPF_TPS_HASH_TYPE=' + url_encode(@PARAM_HASH['RECEIPT_TPS_HASH_TYPE']) +\r\n '&SHPF_TPS=' + url_encode(@receipt_tamper_proof_seal) + \r\n '&RETURN_URL=' + url_encode(@PARAM_HASH['RETURN_URL']) + \r\n '&DBA=' + url_encode(@PARAM_HASH['DBA']) + \r\n '&AMEX_IMAGE=' + url_encode(@PARAM_HASH['AMEX_IMAGE']) + \r\n '&DISCOVER_IMAGE=' + url_encode(@PARAM_HASH['DISCOVER_IMAGE'])\r\n end\r\n end", "title": "" }, { "docid": "c0b56873a5ec4a321c96b2a235f8e052", "score": "0.54687864", "text": "def make_payment(payment)\n transaction_post('POST', make_payment_url, Beanstream.merchant_id, Beanstream.payments_api_key, payment)\n end", "title": "" }, { "docid": "039d9c6b04f6be39a51f5d244323854b", "score": "0.54607934", "text": "def patreon_url(checkout: false)\n return 'https://www.patreon.com/join/glacials/checkout?rid=493467' if checkout == :bronze\n return 'https://www.patreon.com/join/glacials/checkout?rid=493468' if checkout == :silver\n return 'https://www.patreon.com/join/glacials/checkout?rid=493469' if checkout == :gold\n\n return 'https://www.patreon.com/join/glacials' if checkout\n\n 'https://www.patreon.com/glacials'\n end", "title": "" }, { "docid": "0fe6c5c193a353cdb85259f0ccfa5755", "score": "0.5458815", "text": "def url(source)\n h.purchase_url purchase.user.handle,purchase.handle,:src => source\n end", "title": "" }, { "docid": "a96d16944abfe4f5b5ae006e70db33ea", "score": "0.54504746", "text": "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", "title": "" }, { "docid": "706c4189ee4c6d544c9becd61d593736", "score": "0.5447759", "text": "def generate_url(url, params = {})\n uri = URI(url)\n uri.query = params.to_query\n uri.to_s\n end", "title": "" }, { "docid": "b7b59ef4d54b2a2e3db2b4dea61353d8", "score": "0.5432198", "text": "def create_payment(payment)\n b = Builder::XmlMarkup.new\n\n request_xml = b.Payments do\n payment.to_xml(b)\n end\n\n response_xml = http_put(@client, \"#{xero_url}/Payments\", request_xml)\n parse_response(response_xml, {:request_xml => request_xml}, {:request_signature => 'PUT/payments'})\n end", "title": "" }, { "docid": "4a9c3250dfde0e4925213aab468f6565", "score": "0.543062", "text": "def generate_request_url(params)\n \n \n # Set current timestamp if not set\n params[\"Timestamp\"] = Time.now.gmtime.iso8601 if !params.key?(\"Timestamp\")\n\n # Generate the canonical query\n canonical_query_string = params.sort.collect do |key, value|\n [URI.escape(key.to_s, Regexp.new(\"[^#{URI::PATTERN::UNRESERVED}]\")), URI.escape(value.to_s, Regexp.new(\"[^#{URI::PATTERN::UNRESERVED}]\"))].join('=')\n end.join('&')\n\n # Generate the string to be signed\n string_to_sign = \"GET\\n#{ENDPOINT}\\n#{REQUEST_URI}\\n#{canonical_query_string}\"\n\n # Generate the signature required by the Product Advertising API\n signature = Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), ENV['SECRET_KEY'], string_to_sign)).strip()\n\n # Generate the signed URL\n request_url = \"http://#{ENDPOINT}#{REQUEST_URI}?#{canonical_query_string}&Signature=#{URI.escape(signature, Regexp.new(\"[^#{URI::PATTERN::UNRESERVED}]\"))}\"\n\n puts \"Signed URL: \\\"#{request_url}\\\"\"\n end", "title": "" }, { "docid": "04a26165265fbfdd1ba17d9ed3559dbf", "score": "0.54224086", "text": "def create_link(url, campaign_token=nil)\n uri = URI.parse(url)\n uri.query = [uri.query, \"at=#{ItunesAffiliateLink.config.affiliate_token}\"].compact.join('&')\n unless campaign_token.nil?\n uri.query = [uri.query, \"ct=#{campaign_token}\"].compact.join('&')\n end\n return uri.to_s\n end", "title": "" }, { "docid": "2e128cb40f0d1983b9bb07e248c7fc47", "score": "0.54181015", "text": "def paypal_url(return_url, current_wbids) \n values = { \n :business => 'patrick.edward.alcindor@gmail.com',\n :cmd => '_cart',\n :upload => 1,\n :return => return_url,\n :no_shipping => 1,\n :no_note => 1,\n :notify_url => 'http://bidsocial.herokuapp.com/confirm_payment',\n :custom => id\n }\n\n current_wbids.each_with_index do |wbid, index|\n values.merge!({\n \"item_name_#{index + 1}\" => wbid.item.name,\n \"amount_#{index + 1}\" => wbid.bid.amount\n })\n end\n\n # For test transactions use this URL\n \"https://www.sandbox.paypal.com/cgi-bin/webscr?\" + values.to_query\n end", "title": "" }, { "docid": "58cb071bd16cfb84c28c7c462bbc899b", "score": "0.54151505", "text": "def build_url(params_hash)\n param_string = '?' + params_hash.merge(:LicenseKey => @license_key).map { |k, v| \"#{::CGI.escape(k.to_s)}=#{::CGI.escape(v.to_s)}\" }.sort.join('&')\n URI.parse(File.join(endpoint_url, @name + param_string))\n end", "title": "" }, { "docid": "3cf7f46a9269661e22818011ed6d02d4", "score": "0.53806376", "text": "def url(key, **options)\n instrument :url, key: key do |payload|\n generated_url =\n if public?\n public_url(key, **options)\n else\n private_url(key, **options)\n end\n\n payload[:url] = generated_url\n\n generated_url\n end\n end", "title": "" }, { "docid": "84348856bc27515c3fff0d3e09672b49", "score": "0.5375474", "text": "def send\n generate_url\n end", "title": "" }, { "docid": "84348856bc27515c3fff0d3e09672b49", "score": "0.5375474", "text": "def send\n generate_url\n end", "title": "" }, { "docid": "e0461b4d24510de3541f4d5d4173288c", "score": "0.5367396", "text": "def create_payment(recipient_id, reference, amount)\n post_with_auth 'payment_initiation/payment/create',\n PaymentCreateResponse,\n recipient_id: recipient_id,\n reference: reference,\n amount: amount\n end", "title": "" }, { "docid": "4bd7876dfa65dbcb905498b4b63208c4", "score": "0.5363266", "text": "def link_payment_method(policy_id:, payment_method_id:)\n data = {payment_method_id: payment_method_id}\n\n put(\"policies/#{policy_id}/payment-method\", data)\n end", "title": "" }, { "docid": "3ef3d5e5af9aa3e3e14b8e59a57598b1", "score": "0.53511393", "text": "def transfer_url(amount,to,memo,options={})\n uri = URI.parse(transaction_url)\n uri.query = URI.escape(\"amount=#{amount}&to=#{to}&memo=#{memo}\")\n uri.to_s\n end", "title": "" }, { "docid": "807b57ca39d236c4046eb203069dc732", "score": "0.53507316", "text": "def presigned_link_uri(object, version, file)\n url_for controller: :file,\n action: :presign,\n object: object,\n version: version,\n file: file\n end", "title": "" }, { "docid": "08a9ed574934c5a4b26f218fef48ff40", "score": "0.53370196", "text": "def tracking_url_for(order)\n return nil if self.tracking_url.blank?\n tracking_url = self.tracking_url.dup\n tracking_url.gsub!(\"{{consignment_number}}\", CGI.escape(order.consignment_number.to_s))\n tracking_url.gsub!(\"{{delivery_postcode}}\", CGI.escape(order.delivery_postcode.to_s))\n tracking_url.gsub!(\"{{billing_postcode}}\", CGI.escape(order.billing_postcode.to_s))\n tracking_url\n end", "title": "" }, { "docid": "c3a9c9e81873c34396f9ff1f41cc90a0", "score": "0.5330863", "text": "def payment\n @amount = 10.00\n @sim_transaction = AuthorizeNet::SIM::Transaction.new(AUTHORIZE_NET_CONFIG['api_login_id'], AUTHORIZE_NET_CONFIG['api_transaction_key'], @amount, :hosted_payment_form => true)\n @sim_transaction.set_hosted_payment_receipt(AuthorizeNet::SIM::HostedReceiptPage.new(:link_method => AuthorizeNet::SIM::HostedReceiptPage::LinkMethod::GET, :link_text => 'Continue', :link_url => payments_thank_you_url(:only_path => false)))\n\n # @transaction = AuthorizeNet::AIM::Transaction.new(AUTHORIZE_NET_CONFIG['api_login_id'], AUTHORIZE_NET_CONFIG['api_transaction_key'], :gateway=>:sandbox)\n # credit_card = AuthorizeNet::CreditCard.new('4111111111111111', '1120')\n # @response = @transaction.purchase('10.00', credit_card)\n\n # if @response.success?\n # puts \"Successfully made a purchase (authorization code: #{response.authorization_code})\"\n # else\n # raise \"Failed to make purchase.\"\n # end\n end", "title": "" }, { "docid": "579de7d86c1c0166f7b9c3f2735751de", "score": "0.532884", "text": "def valitation\n # Create a payment and send ID\n end", "title": "" }, { "docid": "90105a56b0e3156d326298ba4cb8a283", "score": "0.5317017", "text": "def generate_url(method, domain, bucket, key, expires_in, headers)\n path = \"/#{bucket}/#{key}\"\n expires = expires_in.nil? ? 0 : Time.now.to_i + expires_in.to_i\n canonical_string = canonical_string(method, path, headers, expires)\n encoded_canonical = encode(canonical_string)\n\n arg_sep = key.index('?') ? '&' : '?'\n return \"/#{bucket}/#{key}\" + arg_sep + \"Signature=#{encoded_canonical}&\" + \n \"Expires=#{expires}&AWSAccessKeyId=#{@aws_access_key_id}\"\n end", "title": "" }, { "docid": "1aae00d502a8559378d8022ecb72f978", "score": "0.5311563", "text": "def create\n @profile = current_user.profile\n @payment = Payment.new(payment_params)\n @payment.profile = current_user.profile\n if @payment.save\n uri = URI('http://acm.ut.ac.ir/epayment/payments')\n parameters = {\n 'merchant' => \"4452A141\",\n 'amount' => @payment.amount,\n 'redirect' => \"http://acm.ut.ac.ir/events/payments/approve\"}\n response = transact(uri, parameters)\n puts response.body\n @payment.response = response.body\n parsed_response = JSON.parse(response.body)\n if parsed_response[\"status\"] != 1\n redirect_to payments_path, notice: \"در ارتباط با بانک خطایی رخ داده‌است.\"\n return\n end\n @payment.reference_key = parsed_response[\"reference\"]\n if @payment.save\n redirect_to parsed_response[\"bank\"]\n return\n else\n render :new\n end\n else\n render :new\n end\n\n end", "title": "" }, { "docid": "4d03121abb63305ce7b9fecd17009214", "score": "0.53114235", "text": "def create_checkout\n checkout_method = self.campaign.user.checkout_method\n checkout_params = {\n account_id: self.campaign.user.wepay_account_id,\n short_description: \"Donation to #{self.campaign.name}\",\n type: \"DONATION\",\n amount: self.amount.to_s,\n fee_payer: \"payer\",\n callback_uri: self.callback_uri,\n currency: self.currency,\n }\n if(checkout_method == \"iframe\")\n mode = \"iframe\"\n redir = Rails.application.secrets.host + \"/campaign/donation_success/#{self.campaign_id}/#{self.id}\"\n checkout_params[:mode] = mode\n checkout_params[:redirect_uri] = redir\n else\n checkout_params[:payment_method_type] = self.wepay_payment_type\n checkout_params[:payment_method_id] = self.wepay_payment_id\n end\n response = WEPAY.call(\"/checkout/create\", self.campaign.user.wepay_access_token, checkout_params)\n if response[\"error\"]\n throw response[\"error_description\"]\n end\n self.state = response[\"state\"]\n self.wepay_checkout_id = response[\"checkout_id\"]\n self.wepay_fee = response[\"fee\"]\n return response\n end", "title": "" }, { "docid": "8d356a25267c17e1f5a5db061ed5d1fe", "score": "0.53096235", "text": "def create_payment\n payment = ShopPayment.new({\n :order => @order,\n :gateway => gateway_name,\n :amount => @order.price,\n :card_type => card_type,\n :card_number=> card_number_secure\n })\n \n @order.update_attribute(:status, 'paid')\n \n @result[:payment] = payment.save\n end", "title": "" }, { "docid": "61a11d25ed410a767254609466c36703", "score": "0.5304794", "text": "def create_account_link\n render json: Stripe::AccountLink.create(account_params.to_h), status: :created\n end", "title": "" }, { "docid": "fe84cfcc7545b27e758b2453629a5aee", "score": "0.53044784", "text": "def generated_url; end", "title": "" }, { "docid": "72d9b28ef4773bde632fe7a611487919", "score": "0.5300519", "text": "def to_url\n scheme =\n case phone_number_type\n when 'phone' then 'tel'\n when 'mobile' then 'tel'\n when 'fax' then 'fax'\n when 'email' then 'mailto'\n end\n\n return unless scheme\n\n \"#{scheme}:#{number}\"\n end", "title": "" }, { "docid": "1f3db2e9276f4e3e2b9882cc916cc211", "score": "0.5293895", "text": "def p_url\n Rails.application.routes.url_helpers.rent_url(id, host: PUBLIC_URL)\n end", "title": "" }, { "docid": "0e8718d7e65afa254cdc2ab5248e439e", "score": "0.5293055", "text": "def generate_url\n api_key = WavecellOtpAndSms.configuration.api_key\n sub_account = WavecellOtpAndSms.configuration.sub_account\n puts `curl -X POST https://api.wavecell.com/sms/v1/#{sub_account}/single -H \"Authorization: Bearer #{api_key}\" -H \"Content-Type: application/json\" -d $'{ \"source\": \"#{source}\", \"destination\": \"+63#{destination}\", \"text\": \"#{text}\", \"encoding\": \"#{encoding}\" }'`\n end", "title": "" }, { "docid": "531a05b3ab372942dadd51461fd7080a", "score": "0.5281213", "text": "def build_code_url(params={})\n token.build_code_url(params)\n end", "title": "" }, { "docid": "abb160fcae4e1b89572ae35a63f7c796", "score": "0.5263428", "text": "def tracking_url url, consignment_number\n url.sub('{{consignment_number}}', consignment_number)\n end", "title": "" }, { "docid": "00fc8e225fe9301ef6b4b9ab735ad391", "score": "0.5258674", "text": "def make_url(params) #:nodoc:\n if @key && @client_id\n url = super params.merge(:sensor => false, :client => @client_id)\n make_signed_url(url)\n else\n super params.merge(:sensor => false)\n end\n end", "title": "" }, { "docid": "f1e90a937cd910ef343ca2b9773c3c53", "score": "0.5253417", "text": "def generate_url\n api_key = WavecellOtpAndSms.configuration.api_key\n sub_account = WavecellOtpAndSms.configuration.sub_account\n details = [uid, code]\n parameters = {\n uid: uid,\n code: code\n }\n query_string = parameters.to_a.map { |x| \"#{x[0]}=#{x[1]}\" }.join(\"&\")\n url = \"https://api.wavecell.com/otp/v1/#{sub_account}/#{uid}?code=#{code}\"\n HTTParty.get(url.to_str,\n :body => parameters.to_json,\n :headers => {\n \"Content-Type\" => \"application/json\",\n \"Authorization\" => \"Bearer #{api_key}\"\n })\n end", "title": "" }, { "docid": "60000203fdcf0fc965cbc95656814f94", "score": "0.5251467", "text": "def payment_method_link\n\t\t# unit_test_no_generate: payment_method_link, a.className(create_ats_regex_string(\"ats-paymentmethodsnavlnk\"))\n\t\t$tracer.trace(__method__)\n\t\treturn ToolTag.new(a.className(create_ats_regex_string(\"ats-paymentmethodsnavlnk\")), __method__)\n\tend", "title": "" }, { "docid": "47e6ac4140301c6f7904966c27a19012", "score": "0.5240809", "text": "def create_checkout(redirect_uri)\n # calculate app_fee as 10% of produce price\n app_fee = self.donate_amount * 0.1\n params = {\n :account_id => self.wepay_account_id,\n :short_description => \"Donate from #{self.name}\",\n :type => 'donation',\n :currency => 'USD',\n :amount => self.donate_amount, \n :fee => { \n :app_fee => app_fee,\n :fee_payer => 'payee'\n },\n :hosted_checkout => {\n :mode => 'iframe',\n :redirect_uri => redirect_uri\n } \n \n }\n response = WEPAY.call('/checkout/create', self.wepay_access_token, params)\n puts response\n if !response\n raise \"Error - no response from WePay\"\n elsif response['error']\n raise \"Error - \" + response[\"error_description\"]\n end\n\n return response\nend", "title": "" }, { "docid": "9bd5e61631a4d03d79d44cfb9c775754", "score": "0.52404296", "text": "def simulate_callback_uri\n wallet = ENV[\"SHOPPING_CART_WALLET\"]\n # add in info like destination_address and stuff\n base_uri = CheckoutWallet.make_callback_uri(wallet, self.sale.id, self.secret_authorization_token)\n extras = \"&anonymous=false&value=#{value_needed}&input_address=#{self.input_address}&confirmations=6&transaction_hash=ltxhashl&input_transaction_hash=intxhash&destination_address=#{wallet}&address=#{wallet}\"\n base_uri + extras\n end", "title": "" }, { "docid": "04d204e54f30c5709f1f694e32c113e6", "score": "0.522484", "text": "def approve_paypal_payment_url(opts = {})\n if opts.is_a?(Symbol) || opts.is_a?(String)\n warn \"[DEPRECATION] use approve_paypal_payment_url(:type => #{opts})\"\n opts = {:type => opts}\n end\n return nil if self['payKey'].nil?\n\n if ['mini', 'light'].include?(opts[:type].to_s)\n \"#{@paypal_base_url}/webapps/adaptivepayment/flow/pay?expType=#{opts[:type]}&paykey=#{self['payKey']}\"\n else\n base = @paypal_base_url\n base = base + \"/#{opts[:country]}\" if opts[:country]\n \"#{base}/webscr?cmd=_ap-payment&paykey=#{self['payKey']}\"\n end\n end", "title": "" }, { "docid": "5edac35957b3db1193d85dd6302131f2", "score": "0.5224083", "text": "def generate_short_url(base_url)\n build_shorten_url.update( uniq_id: shorten, expired_at: Time.now.utc + 1.year ) unless shorten_url\n shorten_url.link(base_url)\n end", "title": "" }, { "docid": "8269b5957a9e41b8d56950f9e1b7e34f", "score": "0.52152854", "text": "def make_payment\n payment_id = params[:payment_id]\n user_id = params[:user_id]\n offer_id = params[:offer_id]\n response = Subscription.make_payment(payment_id, user_id, offer_id)\n render json: response\n end", "title": "" }, { "docid": "ed2da2723a68967b746fba7e4305a923", "score": "0.5214882", "text": "def make_url(params) #:nodoc:\n params[:appid] = @appid\n params[:output] = 'xml'\n\n super params\n end", "title": "" }, { "docid": "ed2da2723a68967b746fba7e4305a923", "score": "0.5214882", "text": "def make_url(params) #:nodoc:\n params[:appid] = @appid\n params[:output] = 'xml'\n\n super params\n end", "title": "" }, { "docid": "80337805c46be0868a535675d3dfa419", "score": "0.521273", "text": "def url\n I18n.t('common.ad_url', locale: I18n.default_locale, model_brand_name: brand&.name, model_name: model&.name,\n city_region_name: region&.name, city_name: city&.name, id: id)\n end", "title": "" }, { "docid": "c55a86c1a2ae9978d5373cb7b299638d", "score": "0.52096915", "text": "def create\n\t\t# @payment = Payment.new({\n\t\t# :intent => \"sale\",\n\t\t# :payer => {\n\t\t# :payment_method => \"credit_card\",\n\t\t# :funding_instruments => [{\n\t\t# :credit_card => {\n\t\t# \t:type => params[:payment][:card_type], #\"visa\",\n\t\t# :number => params[:payment][:card_number], #\"4242424242424242\",\n\t\t# :expire_month => params[:payment][\"card_expires_on(2i)\"], #\"1\",\n\t\t# :expire_year => params[:payment][\"card_expires_on(1i)\"], #\"2018\",\n\t\t# :cvv2 => params[:payment][:cvv2], #\"874\",\n\t\t# :first_name => params[:payment][:first_name], #\"Joe\",\n\t\t# :last_name => params[:payment][:last_name], #\"Shopper\",\n\t\t# :billing_address => {\n\t\t# :line1 => params[:payment][:address], #\"52 N Main ST\",\n\t\t# :city => params[:payment][:city], #\"Johnstown\",\n\t\t# :state => params[:payment][:state], #\"OH\",\n\t\t# :postal_code => params[:payment][:postal_code], #\"43210\",\n\t\t# :country_code => params[:payment][:country_code] #\"US\" \n\t\t# }}}]},\n\t\t# :transactions => [{\n\t\t# :amount => {\n\t\t# :total => \"10.00\",\n\t\t# :currency => \"USD\" },\n\t\t# :description => \"This is the payment transaction description.\" }]})\n\n\t\t# @payment.create\n\t\t# if @payment.id.nil?\n\t\t# \terror = @payment.error\n\t\t# \tredirect_to payment_index_url, :alert => error.name+\"\\n\"+error.details.to_s\n\t\t# else\n\t\t# \tparams[:payment][:transaction_id] = @payment.id\n\t\t# \tparams[:payment][:amount] = 10\n\t\t# \t@data = current_user.build_payment(payment_params)\n\t\t# \tif @data.save\n\t\t# \t\tredirect_to payment_index_url, :notice => \"Payment Done with payment id #{@payment.id}\"\n\t\t# \telse\n\t\t# \t\tredirect_to payment_index_url, :alert => \"Something went wrong.\"\n\t\t# \tend\n\t\t# end\n\tend", "title": "" }, { "docid": "f13acc0ebf7a8f4b85c935732cdaea92", "score": "0.5207385", "text": "def create_payment\n unless self.payment_id\n payment = Payment.new\n payment.paymenttype = 'credit note'\n payment.amount = self.price\n payment.currency = User.current.currency.name\n payment.date_added = Time.now\n payment.shipped_at = Time.now\n payment.completed = 1\n payment.user_id = self.user.id\n payment.owner_id = self.user.owner_id\n payment.tax = tax.count_tax_amount(self.price)\n payment.save\n return payment\n end\n end", "title": "" }, { "docid": "7e595b067efa8e37965ffbe21fb68207", "score": "0.5205184", "text": "def url()\n\t\t\turi = URI.parse(@service_end_point)\n\t\t\tsignature = Amazon::FPS::SignatureUtils.sign_parameters({parameters: @params, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\taws_secret_key: @secret_key,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thost: uri.host,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tverb: @http_method,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\turi: uri.path })\n\t\t\t@params[Amazon::FPS::SignatureUtils::SIGNATURE_KEYNAME] = signature\n\n\t\t\treturn get_url(@service_end_point, @params)\n\tend", "title": "" }, { "docid": "7f9a3a362b96bd93d6afc1836f7395e2", "score": "0.52003384", "text": "def create_url\n\t\tif self.url.blank?\n\t\t\tself.dev_stage.blank? ? dev_stage_string = \"\" : dev_stage_string = \"-\" + self.dev_stage + \"-\"\n\t\t\tcomponent_string = self.component.downcase.gsub(/[^a-zA-Z0-9]+/, \"-\").chomp(\"-\")\n\t\t\tversion_string = self.maj_version.to_s + \"-\" + self.min_version.to_s\n\t\t\tself.url = component_string + dev_stage_string + version_string\n\t\tend\n\tend", "title": "" }, { "docid": "136afdd5db39aeb0ccd0b6d4ff485e5d", "score": "0.5199729", "text": "def public_url\n # the public url will go through the normal API unless it's BorderGuru which we have to scrap locally\n # to remove elements.\n if order_tracking.delivery_provider == \"borderguru\"\n redirect_to guest_order_tracking_public_borderguru_path(order_tracking)\n else\n redirect_to tracking_handler.api_gateway.public_url(callback_url: navigation.with_url.back(1))\n end\n end", "title": "" }, { "docid": "073bbed7c8cae83cd03d9228569c4548", "score": "0.5189636", "text": "def make_payment! amount, due_at = Time.now\n rack_payment = Rack::Payment.instance.payment\n rack_payment.amount = amount\n rack_payment.credit_card = credit_card # use the encrypted credit card\n rack_payment.purchase :ip => '127.0.0.1'\n\n # TODO add amount_paid (?)\n completed = completed_payments.create :amount => amount, \n :due_at => due_at,\n :success => rack_payment.success?,\n :response => rack_payment.response\n completed\n end", "title": "" }, { "docid": "c888904acc080467146be4f4636e1e61", "score": "0.518838", "text": "def billing_portal_url(return_url = nil)\n assert_customer_exists\n\n session = Stripe::BillingPortal::Session.create({\n customer: stripe_id,\n return_url: return_url || '/',\n }, stripe_options)\n\n session.url\n end", "title": "" }, { "docid": "761b4a84b6942e032bac6408da02a644", "score": "0.5188148", "text": "def link\n BASE_URL + (private? ? \"/private/#{@key}\" : \"/#{@id}\")\n end", "title": "" }, { "docid": "ee52a2c7e841ee54e3ab054120fcf3f6", "score": "0.51764995", "text": "def url_for_direct_upload(key, expires_in:, content_type:, content_length:, checksum:)\n instrument :url, key: key do |payload|\n verified_token_with_expiration = ActiveStorage.verifier.generate(\n {\n key: key,\n content_type: content_type,\n content_length: content_length,\n checksum: checksum\n },\n { expires_in: expires_in,\n purpose: :blob_token }\n )\n\n generated_url = url_helpers.update_rails_imgur_service_url(verified_token_with_expiration, host: current_host)\n\n payload[:url] = generated_url\n generated_url\n end\n end", "title": "" }, { "docid": "e645fcd9535411fce546c9de37b5d72f", "score": "0.5172123", "text": "def url\n response = ::RestClient.post(Pxpay::Base.pxpay_request_url, post )\n response_text = ::Nokogiri::XML(response)\n puts \"**PXPAY post**\"\n puts post.to_s\n puts \"**PXPAY response**\"\n puts response_text.to_s\n if response_text.at_css(\"Request\").attributes[\"valid\"].value == \"1\"\n url = response_text.at_css(\"URI\").inner_html\n else\n if Pxpay::Base.pxpay_user_id && Pxpay::Base.pxpay_key\n raise Pxpay::Error, response_text.at_css(\"Request\").inner_html\n else\n raise Pxpay::MissingKey, \"Your Pxpay config is not set up properly, run rails generate pxpay:install\"\n end\n end\n return URI::extract(url).first.gsub(\"&amp;\", \"&\")\n end", "title": "" }, { "docid": "80882a455e3011fcb62ec1af5b100a7f", "score": "0.5158376", "text": "def stripe_customer_link(customer_id)\n \"https://dashboard.stripe.com/customers/\" + customer_id\n end", "title": "" }, { "docid": "ebe07b24cb2d069169c6d87b50646f17", "score": "0.51569986", "text": "def make_donation_iframe\n # try to see if the donor is already in the database\n @user = User.find_by_email(params[:payer_email])\n if !@user # if not, then create the user\n @user = User.new({\n name: params[:payer_email],\n email: params[:payer_email]\n })\n unless @user.valid? && @user.save\n error(@user.errors.full_messages)\n return redirect_to(\"/campaign/donate/#{@campaign.id}\")\n end\n end\n amount = params[:amount]\n @payment = Payment.new({\n campaign_id: @campaign.id,\n payer_id: @user.id,\n amount: params[:amount]\n })\n if !@payment.valid?\n error(@payment.errors.full_messages)\n return redirect_to(\"/campaign/donate/#{@campaign.id}\")\n end\n if @payment.valid? && @payment.save\n @response = @payment.create_checkout\n @checkout_uri = @response[\"checkout_uri\"]\n @payment.state = @response[\"state\"]\n @payment.wepay_checkout_id = @response[\"checkout_id\"]\n if(@response[\"fee\"] == nil)\n @payment.wepay_fee_cents = 0\n end\n @payment.save\n end\n @user.add_role(User::ROLE_PAYER)\n @user.save\n render :action => 'iframe', :user_id => @campaign.id\n end", "title": "" }, { "docid": "9168e38391b83bab5f641dfca723e0fa", "score": "0.5154086", "text": "def payment_methods_link\n # unit_test_no_generate: payment_methods_link, a.className(create_ats_regex_string(\"ats-paymentmethodslnk\"))\n $tracer.trace(__method__)\n return ToolTag.new(a.className(create_ats_regex_string(\"ats-paymentmethodslnk\")), __method__)\n end", "title": "" }, { "docid": "17e432e53b2b753e3d9fd2b983060ac5", "score": "0.51525193", "text": "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", "title": "" }, { "docid": "aeab8dbde98399f641aa1ac3dbb1bdbf", "score": "0.51513267", "text": "def build_url_request(params)\n logger.debug(\"build_url_request: params #{params.inspect}\")\n #add constants\n #add key\n params << @public_key_param \n # need to encode rest of the values\n encoded = encode_params(params)\n #encode the URL\n url = @api_path + '?' +encoded.join('&')\n logger.debug(\"build_url_request: url is #{url}\")\n url\n end", "title": "" }, { "docid": "e1c029681e277634a8d3989aa86adccd", "score": "0.5149885", "text": "def build_url(params)\n \"#{@base_url}?#{params.to_query}\"\n end", "title": "" }, { "docid": "ce60e3b904123dcc72f85f567145edca", "score": "0.5145775", "text": "def makeURL(path)\n \"#{self.api_endpt + path}?token=#{self.token}\"\n end", "title": "" }, { "docid": "42ea52e9c3440d64cba9e5001d54cdb8", "score": "0.5138763", "text": "def order_url\n 'http://petersapparel.parseapp.com/order?order_id=123456'\n end", "title": "" } ]
bb967b70e6046d051972b67d9a0165e5
Return start time for this element, relative to the beginning of the production.
[ { "docid": "10ae7e0ecbe120e38d0c260423f5cbb3", "score": "0.0", "text": "def t1\n _absolute(enter)\n end", "title": "" } ]
[ { "docid": "561119d6a9eced699716cde7842a94fd", "score": "0.82547283", "text": "def start_time\n return @start_time\n end", "title": "" }, { "docid": "82d5d969ed7fa0b655ed99339377cf53", "score": "0.8158939", "text": "def start_time\n @start_time\n end", "title": "" }, { "docid": "1847f8a9f561daea6a5eae5fec4d338c", "score": "0.81584513", "text": "def get_start_time()\n return process_stamp(@start_time)\n end", "title": "" }, { "docid": "5c6704ef25377ae07f51ccf4b8de8b2c", "score": "0.80315775", "text": "def start_time\n @internal_data.start_time\n end", "title": "" }, { "docid": "a2d52bcf7be71cc9566d272254a53a65", "score": "0.80276", "text": "def start_time\n @parts.first.start_time\n end", "title": "" }, { "docid": "e03b65c89c5cd91a2ee09ce3598463ca", "score": "0.7977008", "text": "def start_time\n start\n end", "title": "" }, { "docid": "beea9fb5b33670dacb286665d6f2dee7", "score": "0.78999317", "text": "def start_time\n data.start_time\n end", "title": "" }, { "docid": "beea9fb5b33670dacb286665d6f2dee7", "score": "0.78999317", "text": "def start_time\n data.start_time\n end", "title": "" }, { "docid": "58569651701147ab7d37980424a4aa2a", "score": "0.78714585", "text": "def start_time\n eval(start) if start.present?\n end", "title": "" }, { "docid": "c7d6f401d94bd1ddccf1fa1c0dd3c3ec", "score": "0.7850189", "text": "def start_time\n if ev = start_event.last\n ev.time\n end\n end", "title": "" }, { "docid": "c7d6f401d94bd1ddccf1fa1c0dd3c3ec", "score": "0.7850189", "text": "def start_time\n if ev = start_event.last\n ev.time\n end\n end", "title": "" }, { "docid": "9bf363dfc192f56305e4ebe64afd5817", "score": "0.7690866", "text": "def start_date\n\t \tTime.at(self.start_time) rescue nil\n\t end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.764593", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.764593", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.764593", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.764593", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.764593", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.764593", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.764593", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.764593", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.764593", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "924b40e6a771a053d236d5751ae622b7", "score": "0.764593", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "b59ed01648d451127a7801136102ef3a", "score": "0.7599917", "text": "def start_time\n dtstart.to_datetime\n end", "title": "" }, { "docid": "1182805902cca93ca1a6e71c708f16f8", "score": "0.75905764", "text": "def start_time\n dtstart_property ? dtstart.to_datetime : nil\n end", "title": "" }, { "docid": "58cbdd3039708d57aab83d9b5fa36c5f", "score": "0.755568", "text": "def start_date_time\n return @start_date_time\n end", "title": "" }, { "docid": "1d7c66640081798b8f9d03c3fc160a67", "score": "0.75350815", "text": "def start_time\n plan_rebuilder.start_time\n end", "title": "" }, { "docid": "71d622f01e3343349b0785a19f57dd7e", "score": "0.74949646", "text": "def start_formatted\n display_time read_attribute(:start)\n end", "title": "" }, { "docid": "1bb2e52980818ef8b193ce4a6e56405d", "score": "0.7488998", "text": "def start_time\n self.day\n end", "title": "" }, { "docid": "885c95eb490458e8ba8b2528d9f89962", "score": "0.7463355", "text": "def start_time\n\t\t\treturn @start_time.strftime('%H:%M')\n\t\tend", "title": "" }, { "docid": "78d02994fea10febb3d099673b2c4a42", "score": "0.7410586", "text": "def start_t\n self.start_time.strftime(\"%I:%M\") if self.start_time\n end", "title": "" }, { "docid": "b92a0996519bd6ddb0de3d04d476fde9", "score": "0.73551226", "text": "def start_time; end", "title": "" }, { "docid": "0a6b497b3493c4a22028475f7442685a", "score": "0.7344819", "text": "def start_time\n begin_date\n end", "title": "" }, { "docid": "6347e608ff669ec8e92d47fbcca4717f", "score": "0.72873396", "text": "def js_start_time\n time = read_attribute :start_time\n time_format(time)\n end", "title": "" }, { "docid": "3df9df69351f64b31c05c2671f7ffb89", "score": "0.72800535", "text": "def started_date_time\n return @started_date_time\n end", "title": "" }, { "docid": "c9f15f23154eeeccf3d275ed8bdc1faf", "score": "0.7254528", "text": "def started_at\n Convert.millis_to_time @gapi.statistics.start_time\n end", "title": "" }, { "docid": "9ffd6955878b86c457531e695628172a", "score": "0.7140134", "text": "def start_time\n self.date\n end", "title": "" }, { "docid": "f4d0ec087dd013ad57f27f5006fc7705", "score": "0.71309537", "text": "def start_time\n start_at.strftime(\"%F\") if start_at\n end", "title": "" }, { "docid": "07d8646d7145a10f1f6656aba2fc4607", "score": "0.7100934", "text": "def start_time\n by_date\n end", "title": "" }, { "docid": "985ccb78061c1b448923746a6aa12332", "score": "0.70976895", "text": "def start_time=(value)\n @start_time = value\n end", "title": "" }, { "docid": "d649ac54bd2aa08a8c0882a13bb532e1", "score": "0.7021378", "text": "def started_at\n Time.parse @gapi.start_time\n rescue StandardError\n nil\n end", "title": "" }, { "docid": "de6a5bc50c2c1fd2f377826c96e2a4e0", "score": "0.69971514", "text": "def retrieve_start_timestamp(experiment)\n if timestamp = get(experiment.handle.to_s, 'started_at')\n Time.parse(timestamp)\n end\n end", "title": "" }, { "docid": "89cc9f81d3d98d7387208db7dccb1216", "score": "0.69937706", "text": "def start_date\n return start\n end", "title": "" }, { "docid": "e0ec7f491e70ad00fb71a6656948ff61", "score": "0.69800335", "text": "def start_time\n start_time_config.pattern_matches[:time]\n end", "title": "" }, { "docid": "4b2372c14b80d618d4fba713f05789e8", "score": "0.69673175", "text": "def start_at\n @attributes[:start_at]\n end", "title": "" }, { "docid": "4b2372c14b80d618d4fba713f05789e8", "score": "0.69673175", "text": "def start_at\n @attributes[:start_at]\n end", "title": "" }, { "docid": "008f64ebe315963c68ee41fa6aebc6ae", "score": "0.6930598", "text": "def starts\n starts = nil\n @doc.find(\"/dwml/data/time-layout/start-valid-time/text()\").map do |node|\n t = Time.parse(node.to_s)\n starts = t if !starts || t < starts\n end\n @starts = starts\n end", "title": "" }, { "docid": "543ff9ef93470fa3c8015cbae2a4c58e", "score": "0.6907676", "text": "def start_time_in_seconds\n @start_time_in_seconds ||= seconds_from_time(start_time)\n end", "title": "" }, { "docid": "66f19373cb3dead74c2bcbe3076bc49d", "score": "0.6902328", "text": "def start_time\n item_hash.deep_find([:listing_details, :start_time])\n end", "title": "" }, { "docid": "359b50b3409de673e3ca4b83003cf36c", "score": "0.68971306", "text": "def set_start_time\n @start_time = Time.now.to_f\n end", "title": "" }, { "docid": "359b50b3409de673e3ca4b83003cf36c", "score": "0.68971306", "text": "def set_start_time\n @start_time = Time.now.to_f\n end", "title": "" }, { "docid": "2222e92c3b9d2cc7eff0b6f9cc37f1c1", "score": "0.6890505", "text": "def cycle_start_time\n if stats[:start] && stats[:actual_start]\n Time.at(*stats[:start]) + stats[:actual_start]\n end\n end", "title": "" }, { "docid": "d9eaf4e975a6f456ba1513772931d2b5", "score": "0.68694705", "text": "def run_start_time\n @data['controls'].map { |control| control['results'].map { |result| DateTime.parse(result['start_time']) } }.flatten.min\n end", "title": "" }, { "docid": "1aa6587ec9593eb71733bac7622abd8c", "score": "0.68557626", "text": "def cycle_start_time\n if stats[:start] && stats[:real_start]\n Time.at(*stats[:start]) + stats[:real_start]\n end\n end", "title": "" }, { "docid": "81a6949697dcdf49f5731bdafdf5aa8c", "score": "0.6829193", "text": "def start\n attributes.fetch(:start)\n end", "title": "" }, { "docid": "81a6949697dcdf49f5731bdafdf5aa8c", "score": "0.6829193", "text": "def start\n attributes.fetch(:start)\n end", "title": "" }, { "docid": "4b7eec59c0a852714addb56a0c739613", "score": "0.67941207", "text": "def start_time\n return \"1530\";\n end", "title": "" }, { "docid": "50d73be4f0b5c8ebb18d64ce1fd3e4cd", "score": "0.6790508", "text": "def start\n starts_at.strftime(\"%R\")\n end", "title": "" }, { "docid": "612a0cb5790b094091c67c6d5ab52d49", "score": "0.678828", "text": "def start_time\n Date.today\n end", "title": "" }, { "docid": "1b7fae6072409b673f4188966be8ed99", "score": "0.67360336", "text": "def starts_at\n Time.at(start_time_millis / 1000).utc.to_datetime\n end", "title": "" }, { "docid": "955b118df48a25aaac0c29a24b22d581", "score": "0.67265975", "text": "def start_time(person_or_type = nil)\n attribute_for_audience_with_generic(:start_time, person_or_type)\n end", "title": "" }, { "docid": "57c3d18c23e97f56b7025003c2dd2571", "score": "0.6707603", "text": "def start_time\n session[:start_time] ||= (Time.now).to_s\n end", "title": "" }, { "docid": "33cbdd0136c782f27b8fad9beceb592c", "score": "0.67026126", "text": "def start_time_to_s\n\t \tself.start_date.try(:strftime, '%H:%M:%S')\n\t end", "title": "" }, { "docid": "553ca63c0395d8e2288fd139c6a30fe7", "score": "0.6686548", "text": "def start_time(ride)\n return nil unless ride.points.any?\n ride.points.first.time\n end", "title": "" }, { "docid": "780a9364d8c5083fbbd32c6d326ebccb", "score": "0.66841966", "text": "def StartTime()\r\n ret = _getproperty(1610743808, [], [])\r\n @lastargs = WIN32OLE::ARGV\r\n ret\r\n end", "title": "" }, { "docid": "28eb0d0b881f584aca8bfc5a1eb7beda", "score": "0.6660972", "text": "def start_date\n Time.parse(@start_date) if @start_date\n end", "title": "" }, { "docid": "1b0f688f58cdf3bc0b9786cd413c6e62", "score": "0.66566944", "text": "def started_at\n # from TAI to Unix\n @started_at ||= @raw ? Time.at((@raw[0] << 32) + @raw[1] - 4611686018427387914) : nil\n end", "title": "" }, { "docid": "2a13cb202d51a311c3d456d50bde6ed3", "score": "0.6652645", "text": "def start\n @start_time = Time.now.utc\n end", "title": "" }, { "docid": "4756cd01497dddacd7eedc161d44e4ad", "score": "0.6623888", "text": "def start_datetime\n d = date\n t = start_time || Time.new.midnight\n DateTime.new(d.year, d.month, d.day, t.hour, t.min, t.sec)\n end", "title": "" }, { "docid": "3f75bc9cafc62b493c0ba27f8b27ae8c", "score": "0.6618699", "text": "def start(value = nil)\n return @start unless value\n @start = _parse_time(value)\n end", "title": "" }, { "docid": "9a09ae9a109eab014b945dac923f3611", "score": "0.65857154", "text": "def started_at\n Time.parse(self.result_payload[\"started_at\"]) if self.result_payload && self.result_payload[\"started_at\"]\n end", "title": "" }, { "docid": "9b54eda3c89f42792f37b3368eece21b", "score": "0.65666175", "text": "def start_at\n today = Time.now\n Time.new(today.year, today.month, today.day, 9,0,0)\n end", "title": "" }, { "docid": "a0cdc20b2fcf5cac2f0c44343e7a88a8", "score": "0.6534407", "text": "def start(value)\n merge(cmstart: value.iso8601)\n end", "title": "" }, { "docid": "35c7a0adf59c6db4f3e43f81f18a5083", "score": "0.653144", "text": "def run_time\n return nil unless self.start_time\n (self.end_time || Time.now) - self.start_time\n end", "title": "" }, { "docid": "156c504d78c920851a257e08d0bf57c9", "score": "0.650238", "text": "def StartTime()\r\n ret = @dispatch._getproperty(1610743808, [], [])\r\n @lastargs = WIN32OLE::ARGV\r\n ret\r\n end", "title": "" }, { "docid": "1a4d58891b4f98c46eebd98cb15ea4d5", "score": "0.6492945", "text": "def start_date_time\n return nil unless start_date && start_time\n DateTime.new(start_date.year, start_date.month, start_date.day, start_time.hour, start_time.min, start_time.sec, start_time.zone)\n end", "title": "" }, { "docid": "f56389827ffca3deee4b77d4c52a2c26", "score": "0.649208", "text": "def start_time=(_arg0); end", "title": "" }, { "docid": "43188f1a2c0df2d20c8717669f690c65", "score": "0.64840615", "text": "def start_time\n if (start_time = @host.at('tag[name=HOST_START]'))\n DateTime.strptime(start_time.inner_text, fmt='%a %b %d %H:%M:%S %Y')\n else\n false\n end\n end", "title": "" }, { "docid": "89264e5aa0322821d684f4e1fa777457", "score": "0.6468959", "text": "def start(value)\n merge(ucstart: value.iso8601)\n end", "title": "" }, { "docid": "f9db71df0d0c23bc4b0ca3bb63b86305", "score": "0.6466878", "text": "def start_time(*args)\n raw = starts_at || shift.starts_at\n raw = Time.local date.year, date.month, date.day, raw.hour, raw.min\n return raw if args.include? :raw\n raw.to_s(:meridian_time).strip\n end", "title": "" }, { "docid": "526c68aa74bec87110348934f4608b7b", "score": "0.64566904", "text": "def start_date\n @raw.first.date\n end", "title": "" }, { "docid": "446b1efa411d0f518fa719b3cc00dcaa", "score": "0.6445682", "text": "def utc_start_time\n @time.utc.strftime(\"%Y-%m-%dT%H:%M:%S.000Z\")\n end", "title": "" }, { "docid": "0ed029f97eadad999f8901919bcd1627", "score": "0.64349025", "text": "def started_at; end", "title": "" }, { "docid": "0ed029f97eadad999f8901919bcd1627", "score": "0.64349025", "text": "def started_at; end", "title": "" }, { "docid": "0ed029f97eadad999f8901919bcd1627", "score": "0.64349025", "text": "def started_at; end", "title": "" }, { "docid": "0ed029f97eadad999f8901919bcd1627", "score": "0.64349025", "text": "def started_at; end", "title": "" }, { "docid": "0ed029f97eadad999f8901919bcd1627", "score": "0.64349025", "text": "def started_at; end", "title": "" }, { "docid": "f9a13b3290455607d68cf2af200e2a8a", "score": "0.64303976", "text": "def starttime; Time.parse(@starttime_str); end", "title": "" }, { "docid": "0204e8bc665d359bb9c1f3d8fa2f7ae8", "score": "0.6427772", "text": "def starting_at\n @starting_at ||= parse_or_at(@attrs[:starting_at]) if @attrs[:starting_at]\n end", "title": "" }, { "docid": "2d31ff9fd6631085bb8ca122d43205c9", "score": "0.6427062", "text": "def local_start_at\n Timestamp.new(@timestamp_value, 0, @offset.utc_total_offset)\n end", "title": "" }, { "docid": "d4866559f3862954815fa04489bbc36a", "score": "0.6420904", "text": "def start_time\n # API results are in milliseconds since the unix epoch\n epoch_msec = raw_result.fetch('time')\n epoch_sec = epoch_msec / 1000\n\n Time.at(epoch_sec).ctime\n end", "title": "" }, { "docid": "8540688cf8572f8cb39728b76fe80750", "score": "0.6413393", "text": "def s_time\n to_form_time(start_time.getlocal)\n end", "title": "" }, { "docid": "a98c6775c87d2415acebe810d5b79159", "score": "0.6412281", "text": "def start_time_string\n date_component = self.start_time.strftime(\"%b %-d\")\n time_component = self.start_time.strftime(\"%-l:%M%P %Z(%:z)\")\n\n \"#{date_component} at #{time_component}\"\n end", "title": "" }, { "docid": "41b527efffe7fb580b1953f9d62da84b", "score": "0.6392717", "text": "def expected_start\n val = super\n val = DatelessTime.new val unless val.blank?\n val\n end", "title": "" }, { "docid": "30a24e1693bda8b690e6f633e19833a0", "score": "0.63894004", "text": "def start_timestamp=(time)\n @start_timestamp = time.is_a?(Time) ? time.to_f : time\n end", "title": "" }, { "docid": "30a24e1693bda8b690e6f633e19833a0", "score": "0.63894004", "text": "def start_timestamp=(time)\n @start_timestamp = time.is_a?(Time) ? time.to_f : time\n end", "title": "" }, { "docid": "30a24e1693bda8b690e6f633e19833a0", "score": "0.63894004", "text": "def start_timestamp=(time)\n @start_timestamp = time.is_a?(Time) ? time.to_f : time\n end", "title": "" }, { "docid": "29569b52879592825156c4e146341d34", "score": "0.6385174", "text": "def query_start_time\n start_time - 1.hour\n end", "title": "" }, { "docid": "a96fe5dd05bb678822eef175c6ed8601", "score": "0.63748056", "text": "def get_start_date(page)\n page.css(WebScraper::JOB_DETAILS_SELECTOR)[WebScraper::JOB_START_DATE_POS].content.strip\n end", "title": "" }, { "docid": "e9c21d197d1b3182902149b2cbf3eabe", "score": "0.635678", "text": "def start_date\n earliest_date_phase = (self.phases).min_by { |s| s.start_date} if !self.phases.empty?\n if earliest_date_phase.present?\n earliest_date_phase.start_date\n else\n nil\n end\n end", "title": "" }, { "docid": "c7bc0343b05ad54531dbde8a7d65b533", "score": "0.634607", "text": "def display_time\n @display_time || start_time\n end", "title": "" }, { "docid": "31914e547a251043bad392af346e2c76", "score": "0.6343257", "text": "def time_min; Time.now.min; end", "title": "" } ]
a21ef1993fdb81d576a95607d78e9e41
:callseq: dh.compute_key(pub_bn) > string Returns a String containing a shared secret computed from the other party's public value. This method is provided for backwards compatibility, and calls derive internally. === Parameters _pub_bn_ is a OpenSSL::BN, not the DH instance returned by DHpublic_key as that contains the DH parameters only.
[ { "docid": "d41b7cb9778bfd64dca210e9e9a6317b", "score": "0.80366784", "text": "def compute_key(pub_bn)\n peer = dup\n peer.set_key(pub_bn, nil)\n derive(peer)\n end", "title": "" } ]
[ { "docid": "2c11101be279889cd7b6f4f973cb784a", "score": "0.70482284", "text": "def dh_compute_key(pubkey)\n peer = OpenSSL::PKey::EC.new(group)\n peer.public_key = pubkey\n derive(peer)\n end", "title": "" }, { "docid": "2c11101be279889cd7b6f4f973cb784a", "score": "0.70482284", "text": "def dh_compute_key(pubkey)\n peer = OpenSSL::PKey::EC.new(group)\n peer.public_key = pubkey\n derive(peer)\n end", "title": "" }, { "docid": "ab33aa26222faf8deda211a051d84ad4", "score": "0.6522516", "text": "def public_key\n DH.new(to_der)\n end", "title": "" }, { "docid": "fb5b3d8cd71d05bde441fd48db84fd6f", "score": "0.63441086", "text": "def pubkey\n # Split every 2 bytes\n paths = combined_hash.unpack('S>*')\n paths.inject(payment_base) { |key, p| key.derive(p) }\n end", "title": "" }, { "docid": "fe6720f8ad92b985c09ac65ac51a3fd4", "score": "0.6232339", "text": "def compute_shared_secret(server_ecdh_pubkey); end", "title": "" }, { "docid": "66c40a4a6914b4e63d4fbc5cdf3c45f7", "score": "0.61222637", "text": "def public_key\n encode64(curve.public_key.to_bn.to_s(2))\n end", "title": "" }, { "docid": "5a610f6f7a87076677e0fc30473d07b1", "score": "0.5981401", "text": "def build_key(public_key, private_key)\n group = OpenSSL::PKey::EC::Group.new('prime256v1')\n key = OpenSSL::PKey::EC.new(group)\n\n public_bn = OpenSSL::BN.new(public_key, 16)\n private_bn = OpenSSL::BN.new(private_key, 16)\n public_key = OpenSSL::PKey::EC::Point.new(group, public_bn)\n\n key.tap do\n key.public_key = public_key\n key.private_key = private_bn\n end\n end", "title": "" }, { "docid": "7fc5556647eef26ca334847fc81dfd36", "score": "0.58643067", "text": "def public_key\n @public_key.to_der\n end", "title": "" }, { "docid": "32f17da2b9ded4b30c3d401628e05680", "score": "0.5854071", "text": "def key\n ECDSA.build_key(public_key, private_key)\n end", "title": "" }, { "docid": "e178a7afd7ef8dd29e54af2d1ec16678", "score": "0.5772077", "text": "def public_key\n OpenSSL::PKey.read(public_to_der)\n end", "title": "" }, { "docid": "e178a7afd7ef8dd29e54af2d1ec16678", "score": "0.5772077", "text": "def public_key\n OpenSSL::PKey.read(public_to_der)\n end", "title": "" }, { "docid": "fdb3edf7b671bd5d40aac38e535141d4", "score": "0.57060087", "text": "def public_key_string\n [@public_key.to_s].pack(\"m*\").gsub(\"\\n\", \"\")\n end", "title": "" }, { "docid": "0f3cb399956b1e36339ae10b83abf5a4", "score": "0.56737006", "text": "def _calculate_derived_key(dk, password, salt, iterations, dklen, hlen)\n (dklen.to_f / hlen).ceil.times do |i|\n # the start of the block in the key we're computing\n offset = hlen * i\n\n # the value of the salt for this block includes the 1-based block number\n salt[salt.bytesize - 4, 4] = [ i + 1 ].pack('N')\n\n # the final value of this block of the key\n dk[offset, hlen] = _calculate_chained_hmac(password, salt, iterations)\n end\n end", "title": "" }, { "docid": "25c6e1731c84216e1d038be6b8b27ce1", "score": "0.56364304", "text": "def public_key\n @priv.public_key\n end", "title": "" }, { "docid": "53d2185a7413bd808e331e4edf927b93", "score": "0.5604904", "text": "def generate_key # :nodoc:\n p, g = get_parameters\n\n asn1 = OpenSSL::ASN1::Sequence(\n [\n OpenSSL::ASN1::Integer(p),\n OpenSSL::ASN1::Integer(g)\n ]\n )\n\n dh_params = OpenSSL::PKey::DH.new(asn1.to_der)\n # XXX No private key size check! In theory the latter call should work but fails on OpenSSL 3.0 as\n # dh_paramgen_subprime_len is now reserved for DHX algorithm\n # key = OpenSSL::PKey.generate_key(dh_params, \"dh_paramgen_subprime_len\" => data[:need_bytes]/8)\n if OpenSSL::PKey.respond_to?(:generate_key)\n OpenSSL::PKey.generate_key(dh_params)\n else\n dh_params.generate_key!\n dh_params\n end\n end", "title": "" }, { "docid": "62d924b0346411b5ae9c79bb4e98be92", "score": "0.5576458", "text": "def public_key\n @pub\n end", "title": "" }, { "docid": "9716b0917e08d7be5a0c3efd9425d4a8", "score": "0.5532403", "text": "def public_key\n as_public_key(rpc(:account_key, _access: :key))\n end", "title": "" }, { "docid": "82b61951a20bf275ced3466114ae0111", "score": "0.5523876", "text": "def ecdh_public_key_bytes; end", "title": "" }, { "docid": "e33974837a33e0120bfd0751a8de0338", "score": "0.5514614", "text": "def public_key(private_key)\n private_key_int = private_key.to_i(16)\n KeyGen::GROUP.generator.multiply_by_scalar(private_key_int)\n end", "title": "" }, { "docid": "7f0e1f9b343552e80b6b7a2426319ed9", "score": "0.5488411", "text": "def public_key_hash\n Crypto.hash_public_key(public_key)\n end", "title": "" }, { "docid": "ac81ed66c6ebdaddebbc8d96791d6cfb", "score": "0.5469118", "text": "def pgp_pub_encrypt(value)\n encode_to_hex Arel::Nodes::NamedFunction.new 'pgp_pub_encrypt',\n [ bind_param(value),\n dearmor(public_key),\n Arel::Nodes::Quoted.new(ENCRYPT_OPTS.map{|k,v| \"#{k}=#{v}\" }.join(',')) ]\n end", "title": "" }, { "docid": "12d32c4778d8888b03ccecb539bea399", "score": "0.5441999", "text": "def generate_key_pair\n\tg = 2\n\tp = generate_safe_prime(g)\n\td = rand(p)\n\te2 = ModMath.pow(g, d, p)\n\n\tpublic_key = [p, g, e2]\n\tprivate_key = [p, g, d]\n\n\treturn public_key, private_key\nend", "title": "" }, { "docid": "730b223c74c5eedf9bd9434aad6f76fb", "score": "0.54257995", "text": "def public_key\n Akero.replate(@cert.to_s, Akero::PLATE_CERT)\n end", "title": "" }, { "docid": "7da5c1897c5ebdf36a55bab3bdd11d8a", "score": "0.54140395", "text": "def public_key_for_push_header\n trim_encode64(curve.public_key.to_bn.to_s(2))\n end", "title": "" }, { "docid": "c488f7c936889fa8be23a13bdd58f166", "score": "0.5412566", "text": "def private_key\n @private_key.to_der\n end", "title": "" }, { "docid": "3d63a8944cda4969d6dcb0649ad0315f", "score": "0.5406578", "text": "def one_time_public_key\n token = generate_token('get_encription_public_key', @public_key)\n response = commit(:pci_encryption_key, token: token)\n response.params['encryption_key']\n end", "title": "" }, { "docid": "0d2daf9cc91a093f3d4627b08585ff00", "score": "0.5399358", "text": "def gen_key\n # get 2 random primes\n p, q = Prime.each.take_while {|x| x <= KEY_SPACE}.sample(2)\n # special easy case of Euler's totient function\n phi = (p-1)*(q-1)\n # calculate modulus, public key, and private key\n n = p*q\n e = get_public(phi)\n d = get_private(phi, e)\n # print results\n puts \"modulus: #{n}\"\n puts \"public key: #{e}\"\n puts \"private key: #{d}\"\n puts \"(internal information)\"\n puts \"phi: #{phi}\"\n puts \"p,q: #{p},#{q}\"\nend", "title": "" }, { "docid": "70262f2196ba327cfef79aa1cca28064", "score": "0.53924936", "text": "def gen_ec_pub_key(priv_key, priv_key_password = nil)\n # if the file exists try to read the content\n # if not assume we were passed the key and set the string to the content\n key_content = ::File.exist?(priv_key) ? File.read(priv_key) : priv_key\n key = ::OpenSSL::PKey::EC.new key_content, priv_key_password\n\n # Get curve type (prime256v1...)\n group = ::OpenSSL::PKey::EC::Group.new(key.group.curve_name)\n # Get Generator point & public point (priv * generator)\n generator = group.generator\n pub_point = generator.mul(key.private_key)\n key.public_key = pub_point\n\n # Public Key in pem\n public_key = ::OpenSSL::PKey::EC.new\n public_key.group = group\n public_key.public_key = pub_point\n public_key.to_pem\n end", "title": "" }, { "docid": "8dfe795add843fc1f4da7e421ffb9b98", "score": "0.53622186", "text": "def builder_keypair\n if File.exists?(\"#{cluster_data_dir}/builder_key\")\n OpenSSL::PKey::RSA.new(File.read(\"#{cluster_data_dir}/builder_key\"))\n else\n OpenSSL::PKey::RSA.generate(2048)\n end\n end", "title": "" }, { "docid": "76d40962b13362b6c2a4d3773069dc19", "score": "0.5340949", "text": "def public_key\n # Base64 encode without line feeds\n Base64.strict_encode64(public_key_raw)\n end", "title": "" }, { "docid": "ba16df04603a8e017aafc5b28886d9a0", "score": "0.5331942", "text": "def public_key_to_address(public_key_bin)\n Secp256k1::Util.bin_to_hex(keccak256(public_key_bin[1..-1])[-20..-1])\nend", "title": "" }, { "docid": "2872d8209a9e93e14444f11630a3ccde", "score": "0.53269005", "text": "def public_key_to_address(public_key_bin)\n Secp256k1::Util.bin_to_hex(keccak256(public_key_bin[1..-1])[-20..-1])\n end", "title": "" }, { "docid": "96dc14c5078aec3e5650b42afb980b34", "score": "0.53099626", "text": "def to_bytes\n @public_key\n end", "title": "" }, { "docid": "83fcd8b0704848f82c13e159e3b1d4e9", "score": "0.5308382", "text": "def get_public_key\n return @public_key\n end", "title": "" }, { "docid": "1a6ace41ac473a69fb3a2f51c9a363bf", "score": "0.52764434", "text": "def priv_key\n key = master_ext_key.derive(PURPOSE_TYPE, true).derive(Tapyrus.chain_params.bip44_coin_type, true)\n\n # Split every 2 bytes\n paths = combined_hash.unpack('S>*')\n paths.inject(key) { |key, p| key.derive(p) }\n end", "title": "" }, { "docid": "03bd0c95b645dcf98eafdddc86394c4b", "score": "0.5275577", "text": "def compute_public_key_hash(public_key)\n public_key_der = Core::VirgilKeyPair.public_key_to_der(public_key)\n if use_SHA256_fingerprints\n return generate_hash(public_key_der, HashAlgorithm::SHA256)\n end\n\n generate_hash(public_key_der, HashAlgorithm::SHA512)[0..7]\n end", "title": "" }, { "docid": "30a9ea498575505db33d63562ded4ac5", "score": "0.5271995", "text": "def secret_keygen\n ('k' + Digest.hexencode(rand(9).to_s + self.message[0..2]) + self.id.to_s) \n end", "title": "" }, { "docid": "24b2369e1b78260b367f8e6cdd3ea3e5", "score": "0.5240621", "text": "def derive(secret, prefix)\n begin\n fatal(\"Nil/empty secret.\") if (secret.nil? or secret.empty?)\n key = prefix + secret\n key = OpenSSL::Digest::SHA256.digest(key)\n return key[0..15]\n rescue Exception => e\n debug(\"Error: derive: #{e}\")\n return\n end\n end", "title": "" }, { "docid": "abeb25d26a64ebfe5657c19a51a844ef", "score": "0.5225583", "text": "def generate_asset_id(pub_key)\n pubkey_hash_to_asset_id(hash160(pub_key))\n end", "title": "" }, { "docid": "c36ba47965e56b95750ff9d7d62a9921", "score": "0.52182806", "text": "def generate_keys\n one = 1.to_bn\n # Gera os 2 numeros primos aleatorios\n p = OpenSSL::BN.generate_prime(512, safe=true)\n q = OpenSSL::BN.generate_prime(512, safe=true)\n # gera n\n n = p * q\n # Computa a função totiente phi(n) = (p -1) (q -1)\n phi_n = (p - one) * (q - one)\n # pega o valor de e (pega um primo aleatorio menor que que phi n e testa se é co-primo com phi(n))\n e = OpenSSL::BN.generate_prime(256, safe=true)\n while(phi_n.gcd(e) > one) do\n e = e + one\n end\n # calcula d, o inverso multiplicativo de e\n d = e.to_bn.mod_inverse(phi_n)\n pub_key = [n, e]\n pvt_key = [n, d]\n return [pub_key, pvt_key]\n end", "title": "" }, { "docid": "829121e7899da5ab80536a1d05deaa2d", "score": "0.5212888", "text": "def public_key\n Base64.encode64(\"conversation_#{id}\").gsub(/(=|\\n)/, '') << id.to_s.last\n end", "title": "" }, { "docid": "e41bd5411102a313a4b81b8e2dc57680", "score": "0.52106875", "text": "def recover_priv(msg1, msg2, sig1_b64, sig2_b64)\r\n #WIP!\r\n public_key = recoverpub_b64(msg1, sig1_b64)\r\n public_key2 = recoverpub_b64(msg2, sig2_b64)\r\n\r\n msghash1 = Base64.decode64(msg1)\r\n msghash2 = Base64.decode64(msg2)\r\n sig1 = ECDSA::Format::SignatureDerString.decode(Base64.decode64(sig1_b64))\r\n sig2 = ECDSA::Format::SignatureDerString.decode(Base64.decode64(sig2_b64))\r\n\r\n puts 'public key x: %#x' % public_key.x\r\n puts 'public key y: %#x' % public_key.y\r\n\r\n raise 'R values are not the same' if sig1.r != sig2.r\r\n \r\n r1 = sig1.r\r\n r2 = sig2.r\r\n \r\n r = sig1.r\r\n #puts 'sig1 r: '+r1.to_s()\r\n #puts 'sig2 r: '+r2.to_s()\r\n #puts 'sig1 s: '+sig1.s.to_s()\r\n #puts 'sig2 s: '+sig2.s.to_s()\r\n puts 'r = %#x' % r1\r\n puts 's1 = %#x' % sig1.s\r\n puts 's2 = %#x' % sig2.s\r\n \r\n # Step 1: k = (z1 - z2)/(s1 - s2)\r\n field = ECDSA::PrimeField.new($group.order)\r\n z1 = ECDSA::Format::IntegerOctetString.decode(msghash1)\r\n puts 'z1 = %#x' % z1\r\n puts(Base64.strict_encode64(msghash1))\r\n z2 = ECDSA::Format::IntegerOctetString.decode(msghash2)\r\n puts 'z2 = %#x' % z2\r\n puts(Base64.strict_encode64(msghash2))\r\n k_candidates = [\r\n field.mod((z1 - z2) * field.inverse(sig1.s - sig2.s)),\r\n field.mod((z1 - z2) * field.inverse(sig1.s + sig2.s)),\r\n field.mod((z1 - z2) * field.inverse(-sig1.s - sig2.s)),\r\n field.mod((z1 - z2) * field.inverse(-sig1.s + sig2.s)),\r\n ]\r\n \r\n private_key = nil\r\n k_candidates.each do |k|\r\n next unless $group.new_point(k).x == r\r\n private_key_maybe = field.mod(field.mod(sig1.s * k - z1) * field.inverse(r))\r\n if public_key == $group.new_point(private_key_maybe)\r\n private_key = private_key_maybe\r\n end\r\n end\r\n print(\"Privatekey:\")\r\n puts (private_key)\r\n puts 'Private Key: %#x' % private_key\r\n puts\r\n end", "title": "" }, { "docid": "ae24dfa519e41c26fffffa4587eaf743", "score": "0.5202296", "text": "def compute_hashkey api_key, params\n joined_params = params.sort.map do |k,v|\n \"#{k}=#{v}\"\n end.join(JOIN_CHAR)\n Digest::SHA1.hexdigest \"#{joined_params}#{JOIN_CHAR}#{api_key}\"\n end", "title": "" }, { "docid": "90cd67ae9be999853da6854d7baddde1", "score": "0.5188868", "text": "def public_key\n public_key_object.to_pem\n end", "title": "" }, { "docid": "2ce06290c09684a682c81e188a88df3b", "score": "0.5181808", "text": "def diffie_hellman(key2)\n\n lib = BTC::OpenSSL\n lib.autorelease do |pool|\n\n pk = pool.new_bn(key2.private_key)\n n = lib.group_order\n\n # Convert pubkey to a EC point\n pubkey_x = pool.new_bn(self.compressed_public_key)\n pubkey_point = pool.new_ec_point\n lib.EC_POINT_bn2point(lib.group, pubkey_x, pubkey_point, pool.bn_ctx)\n\n # Compute point = pubkey*pk + 0*G\n point = pool.new_ec_point\n # /** Computes r = generator * n + q * m\n # * \\param group underlying EC_GROUP object\n # * \\param r EC_POINT object for the result\n # * \\param n BIGNUM with the multiplier for the group generator (optional)\n # * \\param q EC_POINT object with the first factor of the second summand\n # * \\param m BIGNUM with the second factor of the second summand\n # * \\param ctx BN_CTX object (optional)\n # * \\return 1 on success and 0 if an error occured\n # */\n # int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n, const EC_POINT *q, const BIGNUM *m, BN_CTX *ctx);\n lib.EC_POINT_mul(lib.group, point, nil, pubkey_point, pk, pool.bn_ctx)\n\n # Check for invalid derivation.\n if 1 == lib.EC_POINT_is_at_infinity(lib.group, point)\n raise MathError, \"Resulting point is at infinity.\"\n end\n\n lib.EC_POINT_point2bn(\n lib.group,\n point,\n self.public_key_compressed ?\n BTC::OpenSSL::POINT_CONVERSION_COMPRESSED :\n BTC::OpenSSL::POINT_CONVERSION_UNCOMPRESSED,\n pubkey_x,\n pool.bn_ctx\n )\n\n result_pubkey = lib.data_from_bn(pubkey_x, required_length: 33)\n return Key.new(public_key: result_pubkey)\n end\n end", "title": "" }, { "docid": "fb0f47118d4dc04ce439ceccdfe078b7", "score": "0.51813906", "text": "def generate_key!\n unless priv_key\n tmp = OpenSSL::PKey.generate_key(self)\n set_key(tmp.pub_key, tmp.priv_key)\n end\n self\n end", "title": "" }, { "docid": "ff34e50a96670953a8711334de76939c", "score": "0.5162836", "text": "def client_secret\n base = bb.hex\n # base += BIG_PRIME_N * @multiplier\n base -= modpow(GENERATOR, @user.private_key) * multiplier\n base = base % BIG_PRIME_N\n modpow(base, @user.private_key * u.hex + @a)\n end", "title": "" }, { "docid": "6f07b3739456ed7a3f9a6f7c42aeac4a", "score": "0.5153347", "text": "def encrypt_message pub_key, message\n p_key = pub_key.shuffle[0 .. pub_key.length / 2] # randomly select half the values\n sum = 0\n p_key.each{ |i| sum += i}\n return sum + message\nend", "title": "" }, { "docid": "d6115bb33c08177ab67d8f88f9176646", "score": "0.5145389", "text": "def public_key; end", "title": "" }, { "docid": "d6115bb33c08177ab67d8f88f9176646", "score": "0.5145389", "text": "def public_key; end", "title": "" }, { "docid": "d6115bb33c08177ab67d8f88f9176646", "score": "0.5145389", "text": "def public_key; end", "title": "" }, { "docid": "fc784fd103a27164b01b87e8e4707b5a", "score": "0.51236695", "text": "def public_key\n encode_tz(:edpk, 32)\n end", "title": "" }, { "docid": "22dc935770de7783eedf1b9ce9053e55", "score": "0.5114299", "text": "def get_key(address)\n privkey = get_private_key address\n key = Bitcoin::Key.from_base58(privkey)\n key\nend", "title": "" }, { "docid": "bac01e47c33ab517012c8a1ee5cc0704", "score": "0.5107233", "text": "def rsa_public(input, n, e)\n input_bn = OpenSSL::BN.new(input.to_s)\n n_bn = OpenSSL::BN.new(n.to_s)\n e_bn = OpenSSL::BN.new(e.to_s)\n (input_bn.mod_exp(e_bn, n_bn)).to_i\nend", "title": "" }, { "docid": "d2492432ff753c583b4b5c9cb39855f9", "score": "0.5094886", "text": "def generate_key\n key = RbNaCl::Random.random_bytes(RbNaCl::SecretBox.key_bytes)\n Base64.strict_encode64 key\n end", "title": "" }, { "docid": "f47a3a8378ae61aedba94bd1c8cea69a", "score": "0.50891495", "text": "def private_key\n encode64(curve.private_key.to_s(2))\n end", "title": "" }, { "docid": "dc2d7468cd7cfdf2cb849fae14988461", "score": "0.5076003", "text": "def get_encryption_key\n key_bytes = @sha_size / 8\n if @alg.respond_to?(:preshared_key)\n key = @alg.preshared_key\n unless key.size == key_bytes\n raise Sandal::KeyError, \"The pre-shared content key must be #{@sha_size} bits.\"\n end\n key\n else\n SecureRandom.random_bytes(key_bytes)\n end\n end", "title": "" }, { "docid": "977a131fd1910802f8021b1da730055b", "score": "0.5069258", "text": "def public_decrypt(ciphertext)\n @public_key.public_decrypt(ciphertext)\n end", "title": "" }, { "docid": "277deae1a5d17d67aedc9cdf3450230e", "score": "0.5061709", "text": "def get_public_key(private_key)\n PointG1.from_private_key(private_key)\n end", "title": "" }, { "docid": "30891aa73113e3bd90abeb2a8e5b92dd", "score": "0.5046088", "text": "def generate_ecdsa!\n if !File.exists?('public_key.ecdsa.pem')\n puts 'generating new ECDSA key pair'\n\n # First, choose a recommended curve\n ecdsa_key = OpenSSL::PKey::EC.new 'secp384r1'\n\n # Generate private key\n ecdsa_key.generate_key\n\n # Now generate a corresponding public key\n ecdsa_public = OpenSSL::PKey::EC.new ecdsa_key\n ecdsa_public.private_key = nil\n\n # store public key\n open 'public_key.ecdsa.pem', 'w' do |io|\n io.write ecdsa_public.to_pem\n end\n\n # encrypt and store private key\n encypt_and_store(ecdsa_key, 'private.ecdsa.secure.pem')\n\n # return the private key\n key = ecdsa_key\n else\n puts 'loading existing ECDSA key pair'\n key_pem = File.read 'private.ecdsa.secure.pem'\n key = OpenSSL::PKey::EC.new key_pem, DECRYPT_PASSPHRASE\n end\n\n return key\n end", "title": "" }, { "docid": "a9756dfada60b02706f459510a2615c3", "score": "0.5020715", "text": "def ssh_public_key_conversion\n methods = SSH_CONVERSION[type]\n methods.inject([typestr.length].pack(\"N\") + typestr) do |pubkeystr, m|\n # Given public_key_object.class == OpenSSL::BN, public_key_object.to_s(0)\n # returns an MPI formatted string (length prefixed bytes). This is not\n # supported by JRuby, so we still have to deal with length and data separately.\n val = public_key_object.send(m)\n\n case type\n when \"dsa\",\"rsa\" then data = self.class.ssh_public_key_data_dsarsa(val)\n when \"ecdsa\" then data = self.class.ssh_public_key_data_ecdsa(val)\n else\n raise \"Unknown key type: #{type}\"\n end\n\n pubkeystr + [data.length].pack(\"N\") + data\n end\n end", "title": "" }, { "docid": "7eb24eb39c66127eefe1c3531462d31f", "score": "0.50128716", "text": "def generate_key_pair(compressed: true)\n private_key = 1 + SecureRandom.random_number(GROUP.order - 1)\n public_key = GROUP.generator.to_jacobian * private_key\n privkey = ECDSA::Format::IntegerOctetString.encode(private_key, 32)\n pubkey = public_key.to_affine.to_hex(compressed)\n [privkey.bth, pubkey]\n end", "title": "" }, { "docid": "e63ae5fe5e03d52b47acf17639658941", "score": "0.5011831", "text": "def to_rsa_pkey\n FrontEndBuilds::Utils::SSHPubKeyConvert\n .convert(pubkey)\n end", "title": "" }, { "docid": "60721462908347e1dfdb904f9ba09e9f", "score": "0.50062597", "text": "def encrypt_key(key, public_key)\n encrypted_key = public_key.public_encrypt(key)\n encode encrypted_key\n end", "title": "" }, { "docid": "81e9ce8f88c31a7ee5404dc106a647bd", "score": "0.5003991", "text": "def public_key_data\n @public_key\n end", "title": "" }, { "docid": "0b2e70bac9183b4cb16c7fca92e91206", "score": "0.49985248", "text": "def crypto_key\n # Returns singleton object\n EmailEncryptionKey.instance.key\n end", "title": "" }, { "docid": "635b61508d3e9a586af66d9f8ac8de42", "score": "0.49952006", "text": "def public_key\n @data_public_key ||= load_public_key\n end", "title": "" }, { "docid": "1a72bb2f1680a5c81b92282f5eb33610", "score": "0.49906754", "text": "def private_key\n @priv\n end", "title": "" }, { "docid": "8a546ccaebf76c596013fb051598e37e", "score": "0.49780232", "text": "def find_cipher_key(*args)\n fail ArgumentError, 'Unknown key derivation name ', args[1] unless args[1] == 'PBKDF2'\n\n ::OpenSSL::PKCS5.pbkdf2_hmac_sha1(args[2], args[3], args[4], args[0].key_len)\n end", "title": "" }, { "docid": "24d1685161e55b711bb03d3cb863d48d", "score": "0.4962267", "text": "def static_key_ecb(message)\n unknown = \"Um9sbGluJyBpbiBteSA1LjAKV2l0aCBteSByYWctdG9wIGRvd24gc28gbXkgaGFpciBjYW4gYmxvdwpUaGUgZ2lybGllcyBvbiBzdGFuZGJ5IHdhdmluZyBqdXN0IHRvIHNheSBoaQpEaWQgeW91IHN0b3A/IE5vLCBJIGp1c3QgZHJvdmUgYnkK\"\n udecoded = Base64.decode64(unknown)\n\n message_appended = message + udecoded\n message_appended = pkcs7_pad(message_appended, 16)\n\n cipher = encrypt_ecb(message_appended, STATIC_KEY)\nend", "title": "" }, { "docid": "4a8d445f7ddd67e5c71bc07c4efb54eb", "score": "0.49586475", "text": "def public_key\n require_key\n\n @private_key.public_key.to_pem\n end", "title": "" }, { "docid": "48df58d2fa6dabaf88e370cd75da82b4", "score": "0.49553657", "text": "def generate_secret_key\n r = Aws::Kms.new('saas', 'saas').decrypt(@client.api_salt)\n return r unless r.success?\n\n api_salt_d = r.data[:plaintext]\n\n client_api_secret_d = SecureRandom.hex\n\n r = LocalCipher.new(api_salt_d).encrypt(client_api_secret_d)\n return r unless r.success?\n\n {e_secret_key: r.data[:ciphertext_blob], d_secret_key: client_api_secret_d}\n end", "title": "" }, { "docid": "46b4ceae7da7597b4bd51b6f9e0d239b", "score": "0.4952408", "text": "def export_public_key\n public_key = context.crypto.extract_public_key(private_key)\n VirgilBuffer.from_bytes(context.crypto.export_public_key(public_key))\n end", "title": "" }, { "docid": "fa575b21b677b8aa41c7ae50c559c994", "score": "0.4949105", "text": "def generate_secret_key_base\n webui_priv_pem_path = ENV['WEBUI_SRC_PATH']\n secret_key_base = nil\n begin\n webui_priv_key = File.read(webui_priv_pem_path)\n # Get first `WEBUI_KEY_SUBSTRING_LEN` characters\n webui_key_substring_for_encryption = webui_priv_key[0..(WEBUI_KEY_SUBSTRING_LEN-1)]\n secret_key_base = Base64.encode64(webui_key_substring_for_encryption)\n rescue StandardError => e\n puts \"Could not find the webui key in erchef service for generation of secret_key_base for OCID. OCID secret_key_base will assume the default value...\"\n return nil\n end\n secret_key_base = tidy_up_secret_key_base(secret_key_base)\n end", "title": "" }, { "docid": "0a46e7617f3bb6cfb8ed90a7fb70a24d", "score": "0.4943025", "text": "def public_key_fingerprint\n Cryptosphere.kdf(public_key).unpack('H*').first.scan(/.{4}/).join(\":\")\n end", "title": "" }, { "docid": "d311b3066a100eab6cfd9b61d0d6dc29", "score": "0.49397832", "text": "def get_crypto_key_hex\n return @crypto_key if ! @crypto_key\n @crypto_key.unpack(\"H*\")\n end", "title": "" }, { "docid": "fc451d960a5eab6d10dff65cd725720c", "score": "0.49383155", "text": "def cryptor\n key = Rails.application.secrets.secret_key_base.bytes[0..31].pack( \"c\" * 32 )\n ActiveSupport::MessageEncryptor.new(key)\n end", "title": "" }, { "docid": "4a9f192d5dc267fd485fcff880993175", "score": "0.493722", "text": "def friend_public_key= value\n self[:friend_public_key] = value.to_s\n end", "title": "" }, { "docid": "9afb1087af2eaaea39e1b7b1a6fe49e4", "score": "0.492203", "text": "def gen_pub_key(tn)\n begin\n pub = rand(3..tn)\n # end until Prime.fermat_prime?(pub) && pub.gcd(tn) == 1\n end until pub % 2 != 0 && pub.gcd(tn) == 1\n pub\n end", "title": "" }, { "docid": "19251e2d6964adb1a894808c0edeaf5f", "score": "0.49166343", "text": "def transcend_public_key\n connection = Faraday.new() do |conn|\n conn.request :authorization, 'Bearer', $TRANSCEND_API_KEY\n conn.method :get\n end\n response = connection.get($PUBLIC_KEY_URL)\n OpenSSL::PKey.read(response.body)\nend", "title": "" }, { "docid": "ffcac8e217af190fd4d386681702d3f5", "score": "0.49151015", "text": "def privkey(add_compressed_suffix=false)\n compressed_suffix = add_compressed_suffix && compressed ? \"01\" : \"\"\n [key.private_key.to_s(16) + compressed_suffix].pack('H*')\n end", "title": "" }, { "docid": "ac197b83cdd1a6da4ded617982d2453d", "score": "0.48984864", "text": "def public_key\n @cert.public_key\n end", "title": "" }, { "docid": "a2040d4634e6b21993b1aa8f04b7cb71", "score": "0.4894544", "text": "def public_key\n return @children['public-key'][:value]\n end", "title": "" }, { "docid": "b863d89d99a71ce6b86fcdc1e1ee0c93", "score": "0.48903596", "text": "def masa_pki\n masakey.public_key.to_der\n end", "title": "" }, { "docid": "3229f94efb6725fa149bd1e71bba116f", "score": "0.4887998", "text": "def parse_ec_pubkey?(pub_key, allow_hybrid = false)\n pub_key = pub_key.htb\n return false if !allow_hybrid && ![0x02, 0x03, 0x04].include?(pub_key[0].ord)\n with_context do |context|\n pubkey = FFI::MemoryPointer.new(:uchar, pub_key.bytesize).put_bytes(0, pub_key)\n internal_pubkey = FFI::MemoryPointer.new(:uchar, 64)\n result = secp256k1_ec_pubkey_parse(context, internal_pubkey, pubkey, pub_key.bytesize)\n result == 1\n end\n end", "title": "" }, { "docid": "fcee3ad3b923532505c0e1487a7b379c", "score": "0.4887931", "text": "def ecdsa(data, alg)\n # TODO:\n # - fixme\n # - support P-256 as SHA256\n ecdsa_key = OpenSSL::PKey::EC.new('prime256v1')\n ecdsa_key.generate_key\n ecdsa_public = OpenSSL::PKey::EC.new(ecdsa_key)\n ecdsa_public.private_key = nil\n end", "title": "" }, { "docid": "dc57033182421dfb6d875574cfead7a5", "score": "0.48849073", "text": "def publickey hashid, &block\n em_get( \"/clients/#{uuid}/#{hashid}/publickey\" ) { |response| block.call( response ) }\n end", "title": "" }, { "docid": "a723d0ff2135c666b99efefc3af41760", "score": "0.4884084", "text": "def public_key\n return @public_key if File.exist?(@agent_file) && File.exist?(@key_file)\n # create the agent and key if at least one file does not exist (anymore)\n create_agent_key_combo\n @public_key\n end", "title": "" }, { "docid": "8281e46bb04483c44cf2636dd8b08606", "score": "0.48829478", "text": "def rsa_private(input, n, d)\n input_bn = OpenSSL::BN.new(input.to_s)\n n_bn = OpenSSL::BN.new(n.to_s)\n d_bn = OpenSSL::BN.new(d.to_s)\n (input_bn.mod_exp(d_bn, n_bn)).to_i\nend", "title": "" }, { "docid": "a68da7ed58a27725bd7f2ab52fcfb680", "score": "0.48794937", "text": "def to_script_pubkey\n v = ver == 0 ? ver : ver + 0x50\n ([v, prog.length] + prog).pack('C*').unpack(\"H*\").first\n end", "title": "" }, { "docid": "96fefef1f471fd63c1b2ec20c38210c7", "score": "0.4878704", "text": "def encryption_key\n return @encryption_fu_attrs['-encryption-key-'] if @encryption_fu_attrs['-encryption-key-']\n \n public_key = self.send self.encryption_fu_options[:public_key_field]\n if public_key.blank?\n public_key = self.generate_public_encryption_key\n self.send \"#{self.encryption_fu_options[:public_key_field]}=\".to_sym, public_key\n end\n private_key = self.private_encryption_key\n \n @encryption_fu_attrs['-encryption-key-'] = Digest::SHA256.hexdigest(\"-#{private_key}-#{public_key}-\")\n end", "title": "" }, { "docid": "05f73d73ba4266a10be5258f5da8e80f", "score": "0.48736322", "text": "def private_key\n # jruby-openssl OpenSSL::PKey::EC support isn't complete\n # https://github.com/jruby/jruby-openssl/issues/189\n jruby_not_implemented(\"OpenSSL::PKey::EC is not fully implemented\") if type == \"ecdsa\"\n\n key_object.to_pem\n end", "title": "" }, { "docid": "ac2b4615f1db8c3b33ff2dd6db9d597c", "score": "0.4872662", "text": "def aggregate(pubkeys)\n pubkeys = pubkeys.map do |p|\n pubkey = hex2bin(p)\n raise ArgumentError, \"Public key must be 33 bytes.\" unless pubkey.bytesize == 33\n pubkey\n end\n pk2 = second_key(pubkeys)\n q = ECDSA::Ext::JacobianPoint.infinity_point(GROUP)\n l = hash_keys(pubkeys)\n pubkeys.each do |p|\n begin\n point = string2point(p).to_jacobian\n rescue ECDSA::Format::DecodeError\n raise ArgumentError, 'Invalid public key.'\n end\n coeff = p == pk2 ? 1 : Schnorr.tagged_hash('KeyAgg coefficient', l + p).bti\n q += point * coeff\n end\n KeyAggContext.new(q.to_affine, 1, 0)\n end", "title": "" }, { "docid": "18b28804ae8e8aa5d61f4c0095c52755", "score": "0.4858261", "text": "def public_key(arg = nil)\n set_or_return(\n :public_key,\n arg,\n kind_of: String\n )\n end", "title": "" }, { "docid": "3213a7fed1085c3d83701c363e33aaf1", "score": "0.48563766", "text": "def get_d e\n\t\t@e_public_key = e\n\t\tcurrent_mod_z = nil\n\n\t\tbegin\n\t\t\tcurrent_mod_z = current_mod_z ? (current_mod_z + @z) : @z\n\t\t\t@d_secret_key = (current_mod_z + 1) / @e_public_key\n\t\t\tdivision_mod = (current_mod_z + 1) % @e_public_key\n\t end while not (division_mod == 0 and @e_public_key != @d_secret_key)\n\n\t\t@d_secret_key\n\tend", "title": "" }, { "docid": "c5647f5e10dc7f4bed086b78293141ce", "score": "0.4846311", "text": "def digest\n Digest::SHA1.hexdigest(@pub.to_der)\n end", "title": "" }, { "docid": "bd880c8c311faf788397937262b4018d", "score": "0.484494", "text": "def generate\n key = Bitcoin::Key.generate.priv\n @log.info(\"Bitcoin private key generated: #{key[0..8]}...\")\n key\n end", "title": "" }, { "docid": "829241ba6ad9b3f1da0e106e3d068aea", "score": "0.482745", "text": "def private_key\n\t '-----BEGIN RSA PRIVATE KEY----- Proc-Type: 4,ENCRYPTED DEK-Info: DES-EDE3-CBC,3D37CD3A313CADA2 7c1TAxzv6Gn2OmZzVNtEnU9lqrEwRL65huGc9ewQQ7senY3rkBgIqBzqVarAfS0I 6OMimI57q7XywAiFn7CZ+L7fbXdNuvmGx5JDNRwylgGWR+hPi9JMKEAP1yjdJPRS 608pDXIliz5bO0GdvufQxQ91MPjE4Bs5AT8TIE3bzuFllBYJD/mLpkK4bOjLHswI 7W7afVctpYaRAwzb64Z+gUQZL0BIcQzG2wYvFU3vAs5sCtEy9o7riY/bBi78EEH6 go01DkgYLt8M7ApTwblJNJR0G/8bwy3oDgdieM42sFLzftxwjeBhIiF1ExH+KuYA ftAcROOfr8rduvNNc6jJcx2lyze+4joPjHDBXZr27bg3o3SwOQCIXUHe0DHG0PHn TbZkL2btHH36mTMq0j6P9R4t1wLhJ8Pq2LjLDwLhXw3Tb8aIX1tpShxyy9Yv8F84 Q6dfBLe4yqmvW1Db2nGmZ++gPua2OGWuNXwjivt2XrZ0fGAGri5j9bsqyvDsHwUS aRs8PaG97rgmyRGHYUoicBdgeFZhBHSLlU5F6RNUTOgK9QAHP4+bdKbMQxvhveh8 +v9o7Xa7BlqEvUYXIfBwEbHZoJx4t90XSndSS3chlfoEb6vcxOBmplUZlWs55aSL U7dW1MaE48Afav6TtM2VsN9RzwU8QSplpm7z9C9xkYVBMN6UcKIbnHH1yXdhTGEG uaEvPrtSh+BroAx1OmMjkmb0s1PjgDqLEtaYifP1OXgSS3uTqPBcpgUZDnuYQZmW Ihv7SvGdyWVQUgpv5LukyZPhXdlsCQ+8TlEYn4MOl87uxqo3KCVzVdmhAx2PWS/q wLcyOq0wJuvgAAtmI4/EnXVaP5P6WQ7rixfxdDfR1nI5TnDQkgs2xquyb0cms0J+ hXkIGvQOMAzq2Js3Ad7qyiklDASR20zZt6JPKTgZpLq682Fx+LJCCryAqjye2nAI 0w5SHEd80J/lAUEYo/HrNDBWS0JzD4lfERwUxgXxvynFI1ak38h0YP9RR2ka0pMI DJ8G6/w3Ir1qgLM/E+bTvp1YE683J/j1+vdYC/eoAbki2wgJAitYFdexLpw/qMvj xonY4iyhVkgzQb0GObesjPhr0CQ1gRC8p/A68Pk4cXejKTO95gUnD682Mu6lgYXQ e3rEnNVUruiPEzMKbkPLIsaWfUKfGRb0okQmuISXEfjyLfjkUgD6bxes+9KuHdvj pZze3dOgB1W6ZGsbrQ8ooXAOewYbhDcEqVsPOItVBoZ14CmCSd1X8RiW1dnfZBLa 5W8L7HaVLgiKUWlu2N6BE3etMK/fzhLh1K8WT6PxqzqVfJZZ9TYwVSYbcJuej0Hf ioHwYgqO22aZrp+ciJplCyOooFOKVVW45iLPtSHX64aE6FKbdPEPcndIOl0J9ah0 Hwicaw0ADP4STb83NysAZdHO2UVNEERkp2P4XmgeeH3gYHhPv3xCbbDejrrRJjeq VRer8i6HxiuJ/SxNKvbiwztF/44nWJ+9m2FoNqumTITdQAx7VU3681uEsO9ZbsJU Lbt0zwxna4X6WEtjdy5ExqLlU+wnzWgG+I11vgXSarye2oTuGPK8wjBkfEqdRTxs -----END RSA PRIVATE KEY----- '\n\tend", "title": "" }, { "docid": "f072f0e5181220a8a2a89b2d6f56d6f8", "score": "0.48197785", "text": "def generate\n key = Bitcoin::Key.generate.priv\n info(\"Bitcoin private key generated: #{key[0..8]}...\")\n key\n end", "title": "" } ]
397f2748a8ae8a3baf95741b74897ae7
GET /members/1 GET /members/1.json
[ { "docid": "3004b574d95a1c30a15c076b01bf29f6", "score": "0.7146131", "text": "def show\n @member = Member.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @member }\n end\n end", "title": "" } ]
[ { "docid": "d743f502b758a7352730ff7d6044c6b3", "score": "0.80884856", "text": "def my_members(params = {})\n get(\"/members\", params)\n end", "title": "" }, { "docid": "2eb3a656ce97b066f36c71fd7f539be3", "score": "0.7862207", "text": "def show\n members = MemberRepo.find(params[:id])\n render json: members, status: :ok, root: 'members', serializer: MemberDetailSerializer\n end", "title": "" }, { "docid": "c41c688e390c73de8cd5e7c44571a3ad", "score": "0.756929", "text": "def index\n render status: :ok, json: @members\n end", "title": "" }, { "docid": "03779520fb328432773da0f15da11510", "score": "0.74215746", "text": "def show\n @member = Member.find(params[:id])\n\n render json: @member\n end", "title": "" }, { "docid": "dfd5b42935983f7ae1f42b3dbb8e62a5", "score": "0.74062735", "text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @members }\n end\n end", "title": "" }, { "docid": "7400cfee316355bbda9fbee093c771c2", "score": "0.7406126", "text": "def index\n @members = Member.all\n\n render json: @members\n end", "title": "" }, { "docid": "f17e3650bf620a5ea670b9edafe66a65", "score": "0.7354469", "text": "def index\n render json: @members = Member.all\n end", "title": "" }, { "docid": "fff53f69f11080c7ee190b78087df56f", "score": "0.73517674", "text": "def members\n request(:members)\n end", "title": "" }, { "docid": "5ef76d412a21ce596604a31668b973b9", "score": "0.7342003", "text": "def index\n @members = Member.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @members }\n end\n end", "title": "" }, { "docid": "5ef76d412a21ce596604a31668b973b9", "score": "0.7342003", "text": "def index\n @members = Member.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @members }\n end\n end", "title": "" }, { "docid": "5ef76d412a21ce596604a31668b973b9", "score": "0.7342003", "text": "def index\n @members = Member.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @members }\n end\n end", "title": "" }, { "docid": "5a5847ee3b8bb2cf5e30c0d681a0ee3f", "score": "0.72213477", "text": "def getMember(memberId)\n\tmember = RestClient.get(\"https://api.trello.com/1/members/\"+memberId+\"?key=\"+$key+\"&token=\"+$token+\"&filter=open\")\n\tmember = JSON.parse(member)\nend", "title": "" }, { "docid": "665e62bc9bf91d9e9a702526c6936a48", "score": "0.71577024", "text": "def show\n \n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json:@member }\n end\n end", "title": "" }, { "docid": "2b3f0b3befd0253d4dcd2dd621ccdfcb", "score": "0.7148426", "text": "def show\n\n @member = Member.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @member }\n end\n end", "title": "" }, { "docid": "edabeee53c7b6838f64f53267b05e6e4", "score": "0.7141896", "text": "def members\n res = request('members', include_attributes: true)\n res.map { |member| Member.new(member) }\n end", "title": "" }, { "docid": "06ee0199166be0608aee0e0018e65507", "score": "0.71319747", "text": "def lists_members_show(options = {})\n @req.get(\"/1.1/lists/members/show.json\", options)\n end", "title": "" }, { "docid": "c30a9f688ac6e341c60a1991424efb29", "score": "0.7125333", "text": "def show\n @member = Member.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @member }\n end\n end", "title": "" }, { "docid": "b7902f0f8a08b514cd05127e9e1dab9b", "score": "0.71157575", "text": "def lists_members(options = {})\n @req.get(\"/1.1/lists/members.json\", options)\n end", "title": "" }, { "docid": "62a78a21778cc3e8e2d719fdfd87e629", "score": "0.71124184", "text": "def members(options = {})\n if options[:since]\n options[:since] = options[:since].strftime(\"%Y-%m-%d %H:%M:%S\")\n end\n options.merge!(:id => self.id, :method => \"listMembers\")\n response = post(options)\n if options[:full_details]\n response.map do |response_user|\n member(response_user[\"email\"])\n end\n else\n response.map do |response_user|\n MonkeyWrench::Member.new(response_user)\n end\n end\n end", "title": "" }, { "docid": "aacbacf001a7ff0de9067a988329c4be", "score": "0.71059096", "text": "def index\n @members = Member.limit(10)\n @members = @members.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @members }\n end\n end", "title": "" }, { "docid": "b5c821dd65d279e11ed092d96614e5ec", "score": "0.70936525", "text": "def show\n @member = Member.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @member }\n end\n end", "title": "" }, { "docid": "b5c821dd65d279e11ed092d96614e5ec", "score": "0.70936525", "text": "def show\n @member = Member.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @member }\n end\n end", "title": "" }, { "docid": "b5c821dd65d279e11ed092d96614e5ec", "score": "0.70936525", "text": "def show\n @member = Member.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @member }\n end\n end", "title": "" }, { "docid": "1579bff1a9b3ec0f478d809ff872ab2b", "score": "0.70514244", "text": "def index\n respond_with @members\n end", "title": "" }, { "docid": "8df43961332abd61632658964e1ed8f0", "score": "0.7028867", "text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @member }\n end\n end", "title": "" }, { "docid": "7db2d89800c1475e284a978a4f4b0567", "score": "0.7023846", "text": "def show\n #@member = Member.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @member }\n end\n end", "title": "" }, { "docid": "5d7ab938af72fb341755aa0eae1ebcfe", "score": "0.7006466", "text": "def get_members\n @members = @group.members\n @members.filter_paginate!(params[:per_page], params[:page]) { |r| true }\n @members.collect! { |p| p.to_hash(@user, @client) }\n size = @members.count_available\n render_json :entry => @members, :size => size and return\n end", "title": "" }, { "docid": "80bbde47e8d6ef04a860d7b45f46034e", "score": "0.69769573", "text": "def members\n connection.get do |req|\n req.url \"agent/members\"\n end\n end", "title": "" }, { "docid": "03b896faac4905570070165bed0251b8", "score": "0.6976858", "text": "def show\n @members = Member.all\n end", "title": "" }, { "docid": "d8b5428c7146a3320c153d8ea323dd66", "score": "0.69663215", "text": "def show\n render status: :ok, json: @member\n end", "title": "" }, { "docid": "2a2ee7f2d16b10e31309d30f239b0271", "score": "0.69648796", "text": "def get_members(url)\n get url\n check_error_response(last_response)\n assert last_response.ok?, \"get list of member from extant group\"\n JSON.parse(last_response.body)['members']\n end", "title": "" }, { "docid": "4a613cb061c4438fbb452f873067ffb2", "score": "0.69407994", "text": "def index\n render json: Member.all\n end", "title": "" }, { "docid": "f48a770d20d603b345cd45b0d558f315", "score": "0.6938388", "text": "def index\n @members = Member.all\n end", "title": "" }, { "docid": "f48a770d20d603b345cd45b0d558f315", "score": "0.6938388", "text": "def index\n @members = Member.all\n end", "title": "" }, { "docid": "f48a770d20d603b345cd45b0d558f315", "score": "0.6938388", "text": "def index\n @members = Member.all\n end", "title": "" }, { "docid": "f48a770d20d603b345cd45b0d558f315", "score": "0.6938388", "text": "def index\n @members = Member.all\n end", "title": "" }, { "docid": "f48a770d20d603b345cd45b0d558f315", "score": "0.6938388", "text": "def index\n @members = Member.all\n end", "title": "" }, { "docid": "f48a770d20d603b345cd45b0d558f315", "score": "0.6938388", "text": "def index\n @members = Member.all\n end", "title": "" }, { "docid": "f48a770d20d603b345cd45b0d558f315", "score": "0.6938388", "text": "def index\n @members = Member.all\n end", "title": "" }, { "docid": "f48a770d20d603b345cd45b0d558f315", "score": "0.6938388", "text": "def index\n @members = Member.all\n end", "title": "" }, { "docid": "f48a770d20d603b345cd45b0d558f315", "score": "0.6938388", "text": "def index\n @members = Member.all\n end", "title": "" }, { "docid": "f48a770d20d603b345cd45b0d558f315", "score": "0.6938388", "text": "def index\n @members = Member.all\n end", "title": "" }, { "docid": "f48a770d20d603b345cd45b0d558f315", "score": "0.6938388", "text": "def index\n @members = Member.all\n end", "title": "" }, { "docid": "f48a770d20d603b345cd45b0d558f315", "score": "0.6938388", "text": "def index\n @members = Member.all\n end", "title": "" }, { "docid": "f48a770d20d603b345cd45b0d558f315", "score": "0.6938388", "text": "def index\n @members = Member.all\n end", "title": "" }, { "docid": "f48a770d20d603b345cd45b0d558f315", "score": "0.6938388", "text": "def index\n @members = Member.all\n end", "title": "" }, { "docid": "f48a770d20d603b345cd45b0d558f315", "score": "0.6938388", "text": "def index\n @members = Member.all\n end", "title": "" }, { "docid": "462464d41083c135c7055d53e0dac050", "score": "0.6921794", "text": "def index\n @members = Member.all\n end", "title": "" }, { "docid": "162583ff4143d153cecd9dd62de62eca", "score": "0.6916415", "text": "def members\n api.list_members(login)\n end", "title": "" }, { "docid": "de8b6fff6718b2b16890caed6f0bff35", "score": "0.69070923", "text": "def members\n return @members if @members\n @members = member_ids.map do |member_id|\n Client.get(\"/members/#{member_id}\").json_into(Member)\n end\n end", "title": "" }, { "docid": "948b4ac9aa98f58ceed427c99707c289", "score": "0.6862252", "text": "def show_members\n @members\n end", "title": "" }, { "docid": "429ee3ad851fc0f8a9b9efe4f6236101", "score": "0.6853811", "text": "def show_members\n @members.each do |member|\n puts member.id.to_s + \" | \" + member.name\n end\n end", "title": "" }, { "docid": "4de5e502c9104ca57856a88b555415a2", "score": "0.68504983", "text": "def index\n @members = Member.all\n render json: @members, except: [:password_digest]\n end", "title": "" }, { "docid": "8ecba688b6b04d9f6b3a28f88ed16b43", "score": "0.68472236", "text": "def members\n url = ['/v1/agent/members']\n\n # If the request fails, it's probably due to a bad path\n # so return a PathNotFound error.\n begin\n ret = @conn.get concat_url url\n rescue Faraday::ClientError\n raise Diplomat::PathNotFound\n end\n JSON.parse(ret.body).map { |node| OpenStruct.new node }\n end", "title": "" }, { "docid": "aac988e73eba2319e64ab890df8243fd", "score": "0.6844717", "text": "def index\n\t\t@members = Member.all\n\tend", "title": "" }, { "docid": "de6607f6baebff477557dc96a43aad6a", "score": "0.6834984", "text": "def get_members(id)\n\t\t\tself.class.get(\"/teams/#{id}/members\", :headers => @headers)\n\t\tend", "title": "" }, { "docid": "f47253848264dbabfa2b8a6c88e524e7", "score": "0.67842495", "text": "def index\n if !(current_user)\n redirect_to root_url\n else\n @members = Member.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @members }\n end\n end\nend", "title": "" }, { "docid": "af84a2e9957c40f942c4e491331beb42", "score": "0.677554", "text": "def index_members\n render json: @mixoff.followers\n end", "title": "" }, { "docid": "058834ea5f9155dad8044ebdfda16253", "score": "0.6769433", "text": "def index\n @members = Member.order(\"#{sort_column} #{sort_direction}\").paginate(:page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @members }\n end\n end", "title": "" }, { "docid": "757f85107769687078d51a5e72bb65ae", "score": "0.6767487", "text": "def index\n @members = Member.where(:user_id => @user.id)\n end", "title": "" }, { "docid": "c9f1a2f4abee616d5d25c5b10d1ba5d8", "score": "0.6762317", "text": "def get_members(room)\n make_request(:get, \"/rooms/#{room}/members\")['chunk']\n end", "title": "" }, { "docid": "08ff30f611147abf3bc286fef939006a", "score": "0.6754874", "text": "def index\n #Rails.logger.info(\">>>ADMIN::Member Controller>>Index: #{@module_name}\")\n @members = Member.all\n\n respond_with do |format|\n format.html # index.html.erb\n format.json { render json: @members }\n end\n end", "title": "" }, { "docid": "dac2891857e53f6a3fb5c58e8cb99879", "score": "0.67532086", "text": "def members\n resp = connection.get do |req|\n req.url members_path\n end\n\n return response_to_models(resp) if resp.success?\n\n raise_exception_based_on_response!(resp, object_identifier)\n end", "title": "" }, { "docid": "b320ad3ad994fe31e1aad52bda93121b", "score": "0.6753117", "text": "def index\n @members = User.paginate(page: params[:page])\n end", "title": "" }, { "docid": "77eb56536e55fd8c1d438bddd6e2bca9", "score": "0.67100906", "text": "def members()\n _params = {}\n return @master.call 'vip/members', _params\n end", "title": "" }, { "docid": "1a9715270f12b7389762b67bb877a2bc", "score": "0.6710065", "text": "def get_members(params = {})\n connection.call_method('lists.get_members', params.merge(id_params)).map {|member| Dashamail::Member.new(connection, member)}\n end", "title": "" }, { "docid": "03a5039c8f0e0ef0c3fbfbb7deca55f0", "score": "0.670795", "text": "def show\n\t\t@member = Member.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: @member, include: :statuses }\n\t\tend\n\tend", "title": "" }, { "docid": "54817214259b0b65e6e2bdf98f4e6462", "score": "0.6701185", "text": "def show\n @members_section = MembersSection.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @members_section }\n end\n end", "title": "" }, { "docid": "f892b1aab58ffd8bded0a9b026789b56", "score": "0.6698392", "text": "def get_members(opts = {})\n data, _status_code, _headers = get_members_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "b268993a60896c7e4dec02537e41c58a", "score": "0.6696472", "text": "def get_members( params )\n LastFM.get( \"group.getMembers\", params )\n end", "title": "" }, { "docid": "e1001641c7dcb6db1e0069aa5e163457", "score": "0.66754264", "text": "def show\n @user = User.find(params[:id])\n @members = @user.guidances\n end", "title": "" }, { "docid": "6178a2302a80355d61d3acd08b2b89ab", "score": "0.66607636", "text": "def index\n @users = User.all\n @users = User.get_members_only\n end", "title": "" }, { "docid": "c5e1b0f4dc87cd12d34fec4f81c66bc6", "score": "0.66595685", "text": "def members group_id\n request :get, resource_uri(\"members\", @format), {:group_id => group_id}\n end", "title": "" }, { "docid": "310a0d4acfa89ca7060abc65de665ef1", "score": "0.6657853", "text": "def view_member()\n sql = \"\n SELECT * FROM members\n where members.id = $1\n \"\n values = [@member_id]\n member = SqlRunner.run(sql, values)\n result = Member.new(member.first)\n return result\n end", "title": "" }, { "docid": "9758824396a3a76c595e772395dba3f1", "score": "0.6640342", "text": "def members\n res = @conn.get 'users.list', token: @api_token\n Array(JSON.parse(res.body)['members'])\n end", "title": "" }, { "docid": "c7c4672272772c00d517da8f2ca8adf4", "score": "0.66384953", "text": "def room_members(room_id)\n get(\"rooms/#{room_id}/members\")\n end", "title": "" }, { "docid": "dd0c9934ece8713bebb2cf1e6a585a4d", "score": "0.6636587", "text": "def search\n @members = search_with_filters params\n respond_to do |format|\n format.json { render :json => @members }\n end\n end", "title": "" }, { "docid": "1a98c26d0848ce652f692fd3d783dddf", "score": "0.6636488", "text": "def index\n @members = Member.page params[:page]\n end", "title": "" }, { "docid": "528f5be09d223daa5eb35c1dbf4aea4c", "score": "0.66264224", "text": "def members\n @members, @add, completed_queue, @nonAdmins = ProjectService.new.show_members(params,current_user)\n \t render json: {add: @add, members: @members,completed_queue: completed_queue, nonAdmins: @nonAdmins} \n end", "title": "" }, { "docid": "dea8dfe2a3c6a48c6d78ddf6d53bd27f", "score": "0.6620102", "text": "def index\n @member_service_members = MemberService::Member.all\n end", "title": "" }, { "docid": "fd73660fdfcdcae2d1d82565cf220e52", "score": "0.66149396", "text": "def show\n @meetup_member = MeetupMember.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @meetup_member }\n end\n end", "title": "" }, { "docid": "acae8af205a34062a4fd9ec0eb35be31", "score": "0.6612368", "text": "def index\n @user_members = User::Member.all\n end", "title": "" }, { "docid": "4497938ab207ef9fae227adea3455a10", "score": "0.66020656", "text": "def show\n @membership = Membership.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @membership }\n end\n end", "title": "" }, { "docid": "4497938ab207ef9fae227adea3455a10", "score": "0.66020656", "text": "def show\n @membership = Membership.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @membership }\n end\n end", "title": "" }, { "docid": "4497938ab207ef9fae227adea3455a10", "score": "0.66020656", "text": "def show\n @membership = Membership.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @membership }\n end\n end", "title": "" }, { "docid": "4497938ab207ef9fae227adea3455a10", "score": "0.66020656", "text": "def show\n @membership = Membership.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @membership }\n end\n end", "title": "" }, { "docid": "4497938ab207ef9fae227adea3455a10", "score": "0.66020656", "text": "def show\n @membership = Membership.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @membership }\n end\n end", "title": "" }, { "docid": "4497938ab207ef9fae227adea3455a10", "score": "0.66020656", "text": "def show\n @membership = Membership.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @membership }\n end\n end", "title": "" }, { "docid": "4497938ab207ef9fae227adea3455a10", "score": "0.66020656", "text": "def show\n @membership = Membership.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @membership }\n end\n end", "title": "" } ]
1a09aa880962e32abeadceaafdac270d
Q: Write a test that will fail if list and the return value of list.process are different objects.
[ { "docid": "8b024f1bba4dd2684d84362728dcef4f", "score": "0.7964352", "text": "def test_same_object\n assert_same(list, list.process)\nend", "title": "" } ]
[ { "docid": "522ad8f28e6dfe15d31314c7329bc1f2", "score": "0.75329316", "text": "def test_same_object\n assert_same(@list, @list.process)\n\n # LS Solution\n # assert_kind_of Numeric, value\n end", "title": "" }, { "docid": "0c33371a26e61de6b65aa5e13c34dbb6", "score": "0.64089394", "text": "def test_each_return_object\n # assert_instance_of(TodoList, @list.each {})\n assert_equal(@list, @list.each { |item| nil })\n end", "title": "" }, { "docid": "78aa0e46469b763fa2be7a23f6732dd3", "score": "0.61147153", "text": "def test_multiple_process\r\n linklist = @mymodel.link_list\r\n nodelist = @mymodel.node_list \r\n \r\n process1 = nodelist.add_node(1, 'process one', PROCESS) \r\n process2 = nodelist.add_node(2, 'process two', PROCESS)\r\n process3 = nodelist.add_node(3, 'process three', PROCESS) \r\n \r\n link1 = linklist.add_link(process1, process2, true)\r\n link2 = linklist.add_link(process1, process3, true)\r\n\r\n process1.evidence = [0.63, 0.64]\r\n \r\n assert_equal([0.63, 0.64], process2.evidence)\r\n assert_equal([0.63, 0.64], process3.evidence) \r\n \r\n #remove the callbacks for process 2 as a side affect of deleting the link\r\n linklist.remove_link(link1)\r\n \r\n process1.evidence = [0.44, 0.50]\r\n\r\n assert_equal(\"undefined\", process2.evidence)\r\n assert_equal([0.44, 0.50], process3.evidence) \r\n end", "title": "" }, { "docid": "e8de4ceb78cc40726b15f0c7f163e063", "score": "0.59025884", "text": "def run(list); end", "title": "" }, { "docid": "726db92921ae6f26436b49dc6420be29", "score": "0.5762946", "text": "def test_append_1_item_to_list\n# fail 'This list in test should not work'\n result = interpret 'l=[1,22,333,4444];l=:l+[55555];:l'\n assert_eq result, [1,22,333,4444,55555]\n end", "title": "" }, { "docid": "a09321ffc86b66be8bce36e00e76f0af", "score": "0.5590215", "text": "def run(list)\n list.reject {|item| call(item).is_a?(FalseClass) }\n end", "title": "" }, { "docid": "e6561b93521b57bb03d3202beaadfdfa", "score": "0.55600387", "text": "def test_each\n verify = []\n @list.each {|item| verify << item}\n\n assert_equal(verify, @todos)\n end", "title": "" }, { "docid": "613895148fdcd101e0a87222c0f31a65", "score": "0.555267", "text": "def test_pop\n assert_equal(@list.pop, @todo3)\n assert_equal([@todo1, @todo2], @list.to_a)\n end", "title": "" }, { "docid": "f1f5ba8357e0b024ef980eeb2b19af1f", "score": "0.5531533", "text": "def test_run_list_input\n T2Server::Run.create($uri, $wkf_lists, $creds, $conn_params) do |run|\n many = [[[\"boo\"]], [[\"\", \"Hello\"]], [], [[], [\"test\"], []]]\n single = [1, 2, 3, 4, 5]\n single_out = single.map { |v| v.to_s } # Taverna outputs strings!\n\n run.input_port(\"SINGLE_IN\").value = single\n run.input_port(\"MANY_IN\").value = many\n assert_nothing_raised { run.start }\n assert(run.running?)\n run.wait\n\n assert_equal(run.output_port(\"MANY\").value, many)\n assert_equal(run.output_port(\"SINGLE\").value, single_out)\n end\n end", "title": "" }, { "docid": "5eec349c881b20e52e3bb203a91ad3df", "score": "0.55074525", "text": "def process(item)\n raise StandardError, 'Cannot process this item' if @exception_item == item.item\n @failed_item != item.item\n end", "title": "" }, { "docid": "ee3a8cdc8426a2005357a389d1db04cc", "score": "0.5481823", "text": "def testCommandLineList\n executeMaster( [ '--list' ] )\n end", "title": "" }, { "docid": "146c392ab88217e1697c37f75d508b09", "score": "0.54223835", "text": "def remove(process)\n @lists.each do |list|\n break unless list.delete(process).nil?\n end\n end", "title": "" }, { "docid": "a8e7d1efeecec287d88e6503e9840646", "score": "0.5415312", "text": "def test_run_list_for_large_dependencies\n @task.call\n expected = [:mop, :handwash, :clean, :meat, :bread, :sandwich]\n actual = @tm.run_list_for(:sandwich)\n assert_equal expected, actual\n end", "title": "" }, { "docid": "c832d2f5f9b94a18ce56477da8a81d0c", "score": "0.5374684", "text": "def testNominal\n executeProcess(\n [\n '--ticket', '123',\n '--task', '456'\n ]\n ) do |iError, iSlaveActions|\n assert_equal(\n {\n Tools::TicketTracker => {\n Actions::Ticket_AddLinkToTask => [\n [ '123', '456' ]\n ]\n },\n Tools::ProjectManager => {\n Actions::Task_AddLinkToTicket => [\n [ '456', '123' ]\n ]\n }\n },\n iSlaveActions\n )\n end\n end", "title": "" }, { "docid": "571f047c02a1a16e22ea322595265c67", "score": "0.5373704", "text": "def test_run_list_stop\n self.assert_not_running 'decodefiles'\n pid = @client.call :start_stage, 'decodefiles'\n self.running_assert do |running|\n assert running.map{|r| true if r[0] == pid and r[1] == 'decodefiles'}, \"[#{pid}, 'decodefiles'] wasn't present in running_stages\"\n end\n @client.call :stop_stage, pid\n self.assert_not_running 'decodefiles'\n end", "title": "" }, { "docid": "fd91d8c8cf5aab28bf4735a8227aa878", "score": "0.53516924", "text": "def test_execute_rpn_valid_one\r\n input = [[\"LET A 1\", \"LET B 2\", \"PRINT A B +\"]]\r\n val = 0\r\n assert_output(\"3\\n\") {val = @arg_checker.execute_rpn(input)}\r\n assert_equal [], val\r\n end", "title": "" }, { "docid": "28561c68cc45eccc21ba46acb3677fad", "score": "0.5345821", "text": "def remove_item(list, item)\n# input: item to be removed, list\n# steps: \n # check if item exists\n # remove item\n list.delete(item)\n # print success message of item removed\n p \"You've removed #{item}.\"\n# output: updated list\n list\nend", "title": "" }, { "docid": "7b946c3a17fa06838325cf457012f084", "score": "0.531309", "text": "def process(*e)\n # process through callbacks\n @list.each do |item|\n return true if item.block.call(*e) == true\n end\n false\n end", "title": "" }, { "docid": "8a5d832f66627afd78799b8f3f923eb1", "score": "0.53076977", "text": "def test_execute_rpn_valid_two\r\n input = [[\"LET A 1\", \"LET B 2\", \"PRINT A B +\"], [\"PRINT -1 1 +\"]]\r\n val = 0\r\n assert_output(\"3\\n0\\n\") {val = @arg_checker.execute_rpn(input)}\r\n assert_equal [], val\r\n end", "title": "" }, { "docid": "cee6455d618d6a52996cfa981fe203eb", "score": "0.528732", "text": "def test_to_a\r\n assert_equal(@todos, @list.to_a)\r\n end", "title": "" }, { "docid": "e40a2c63856449f79e39ca774a3305fc", "score": "0.5278036", "text": "def test_process_output_return_type\n assert_instance_of(String, @wc_empty.process_output(@wc_empty.count))\n assert_instance_of(String, @wc_n_e.process_output(@wc_n_e.count))\n assert_instance_of(String, @wc_nil.process_output(@wc_nil.count))\n assert_instance_of(String, @wc_long.process_output(@wc_long.count))\n assert_instance_of(String, @wc_super_long.process_output(@wc_super_long.count))\n assert_instance_of(String, @wc_new.process_output(@wc_new.count))\n end", "title": "" }, { "docid": "34671b93d3ebc20689b2276476e45568", "score": "0.5267561", "text": "def validate_list(input)\n list_request = input[:list_request].call\n if list_request.success?\n Success(input.merge(list: list_request.value!))\n else\n Failure(list_request.failure)\n end\n end", "title": "" }, { "docid": "702820a8447a66e64f980100b0a2f18d", "score": "0.5261617", "text": "def execute process\n raise 'Process not defined' unless process\n logger.info(\"#{host}: Size of collection --> #{collection.size}\")\n collection.each do |e|\n process.call(e)\n e = nil\n bar.increment!\n end\n end", "title": "" }, { "docid": "2f7805a15e7d8f2d5da21607b55db34d", "score": "0.5250791", "text": "def process item\n end", "title": "" }, { "docid": "fcdc6b1a91b3dc537cdf2860c7b3db9e", "score": "0.52420497", "text": "def test_to_a\n assert_equal(@todos, @list.to_a)\n end", "title": "" }, { "docid": "3cb9e64031e8886332d38f003295783f", "score": "0.52384174", "text": "def test_truth\n assert_kind_of ValueList, @value_list\n end", "title": "" }, { "docid": "3c595a0ecb36963e2eb850a28e7e5e3f", "score": "0.52279186", "text": "def test_validity_var\n assert_nil @process.check_validity(['5', 'b', '-'])\n end", "title": "" }, { "docid": "5c1a0b91a3a00a6878709b7f9d85fa82", "score": "0.5216804", "text": "def test_to_a\n assert_equal(@todos, @list.to_a)\n end", "title": "" }, { "docid": "5c1a0b91a3a00a6878709b7f9d85fa82", "score": "0.5216804", "text": "def test_to_a\n assert_equal(@todos, @list.to_a)\n end", "title": "" }, { "docid": "5c1a0b91a3a00a6878709b7f9d85fa82", "score": "0.5216804", "text": "def test_to_a\n assert_equal(@todos, @list.to_a)\n end", "title": "" }, { "docid": "5c1a0b91a3a00a6878709b7f9d85fa82", "score": "0.5216804", "text": "def test_to_a\n assert_equal(@todos, @list.to_a)\n end", "title": "" }, { "docid": "5c1a0b91a3a00a6878709b7f9d85fa82", "score": "0.5216804", "text": "def test_to_a\n assert_equal(@todos, @list.to_a)\n end", "title": "" }, { "docid": "5c1a0b91a3a00a6878709b7f9d85fa82", "score": "0.5216804", "text": "def test_to_a\n assert_equal(@todos, @list.to_a)\n end", "title": "" }, { "docid": "5c1a0b91a3a00a6878709b7f9d85fa82", "score": "0.5216804", "text": "def test_to_a\n assert_equal(@todos, @list.to_a)\n end", "title": "" }, { "docid": "eac01928f2b285c5695157f2c44c8b82", "score": "0.52042574", "text": "def test_list_getall()\n # 1. no lists\n assert_equal [], One::EmailDirect::Facade.list_getall(@credentials)\n\n\n # 2. one list\n One::EmailDirect::Facade.list_add(@credentials, @list_getall1[:name], @list_getall1[:description])\n result = One::EmailDirect::Facade.list_getall(@credentials)\n expected = [{\n :element_name => @list_getall1[:name],\n :description => @list_getall1[:description]\n }]\n result.collect! {|element| element.delete(:element_id); element} # remove ids\n assert_equal expected, result\n\n\n # 3. two lists\n One::EmailDirect::Facade.list_add(@credentials, @list_getall2[:name], @list_getall2[:description])\n result = One::EmailDirect::Facade.list_getall(@credentials)\n expected = [{\n :element_name => @list_getall1[:name],\n :description => @list_getall1[:description]\n }, {\n :element_name => @list_getall2[:name],\n :description => @list_getall2[:description]\n }]\n result.collect! {|element| element.delete(:element_id); element} # remove ids\n assert_equal expected, result\n\n\n # 4. three lists\n One::EmailDirect::Facade.list_add(@credentials, @list_getall3[:name], @list_getall3[:description])\n result = One::EmailDirect::Facade.list_getall(@credentials)\n expected = [{\n :element_name => @list_getall1[:name],\n :description => @list_getall1[:description]\n }, {\n :element_name => @list_getall2[:name],\n :description => @list_getall2[:description]\n }, {\n :element_name => @list_getall3[:name],\n :description => @list_getall3[:description]\n }]\n result.collect! {|element| element.delete(:element_id); element} # remove ids\n assert_equal expected, result\n end", "title": "" }, { "docid": "ba432d4c1bc88b0bf8dbb7b3b5459942", "score": "0.51976603", "text": "def process_result_add_del_on_list(result)\n @conn.class.check_fail_abort(result)\n @conn.class.process_result_add_del_on_list(result)\n end", "title": "" }, { "docid": "ba432d4c1bc88b0bf8dbb7b3b5459942", "score": "0.51976603", "text": "def process_result_add_del_on_list(result)\n @conn.class.check_fail_abort(result)\n @conn.class.process_result_add_del_on_list(result)\n end", "title": "" }, { "docid": "5aa1853ba59b0a5b72d0d6dba112e4c5", "score": "0.5188052", "text": "def process_result(result); end", "title": "" }, { "docid": "2c6be521a8291e838563838e9806f57b", "score": "0.51817244", "text": "def process_list()\n return @process_list\n end", "title": "" }, { "docid": "6fa5b1e1d53a2bb78671f940f07c2fca", "score": "0.51800084", "text": "def testProcessingOrder\n execute_Process_WithConf({\n :WaveFiles => {\n :FilesList => [\n {\n :Name => 'Wave.wav',\n :Processes => [\n {\n :Name => 'Test',\n :Param1 => 'TestParam1'\n }\n ]\n }\n ],\n :GlobalProcesses_Before => [\n {\n :Name => 'Test',\n :Param1 => 'TestParam0'\n }\n ],\n :GlobalProcesses_After => [\n {\n :Name => 'Test',\n :Param1 => 'TestParam2'\n }\n ]\n }\n },\n :PrepareFiles => [\n [ 'Wave/Empty.wav', 'Wave.wav' ]\n ]) do |iStdOUTLog, iStdERRLog, iExitStatus|\n assert_exitstatus 0, iExitStatus\n lWave0FileName = getFileFromGlob('04_Process/Wave/Wave.0.Test.????????????????????????????????.wav')\n lWave1FileName = getFileFromGlob('04_Process/Wave/Wave.1.Test.????????????????????????????????.wav')\n lWave2FileName = getFileFromGlob('04_Process/Wave/Wave.2.Test.????????????????????????????????.wav')\n assert_rb_content [\n {\n :InputFileName => 'Wave.wav',\n :OutputFileName => lWave0FileName,\n :Params => {\n :Param1 => 'TestParam0'\n }\n },\n {\n :InputFileName => lWave0FileName,\n :OutputFileName => lWave1FileName,\n :Params => {\n :Param1 => 'TestParam1'\n }\n },\n {\n :InputFileName => lWave1FileName,\n :OutputFileName => lWave2FileName,\n :Params => {\n :Param1 => 'TestParam2'\n }\n }\n ], 'Process_Test.rb'\n end\n end", "title": "" }, { "docid": "f3b918916adc6f2de8635beecde4022c", "score": "0.516039", "text": "def test_args_valid\n args = [0, 1, 1]\n refute check_args(args)\n end", "title": "" }, { "docid": "971d1de02babcb5c149730804414cc2c", "score": "0.51522136", "text": "def test_to_a\n assert_equal(@todos_array, @list.to_a)\n end", "title": "" }, { "docid": "cdf0ad94f73ce94d5e8e2fc670a2b5c3", "score": "0.5150706", "text": "def test_to_a\n assert_equal(@todos, @list.to_a) \n # this test passes, since in TodoList class, we defined the #to_a method to simply return @todos instance variable.\n # must reference @list isntead of list, since we did not create attr_accessor\n end", "title": "" }, { "docid": "8cd0ca07840340fc912bda5e1ef5a3fb", "score": "0.51475006", "text": "def process_in_list\n if !APP_CONFIG[\"processes\"].map { |x| x[\"code\"] }.include?(process)\n errors.add(:process, \"#{process} not included in list of valid statuses\")\n end\n end", "title": "" }, { "docid": "cefb9001e91336b5ecaaca582f2f7c53", "score": "0.51416326", "text": "def test_list_add()\n # 1. create a new list\n One::EmailDirect::Facade.list_add(@credentials, @list_add[:name], @list_add[:description])\n result = get_single_list(@list_add[:name])\n expected = {\n :element_name => @list_add[:name],\n :description => @list_add[:description]\n }\n\n assert_not_nil result\n result.delete(:element_id)\n assert_equal expected, result\n\n\n # 2. create a new list with a previously used name\n assert_raises One::EmailDirect::EmailDirectException do\n One::EmailDirect::Facade.list_add(@credentials, @list_add[:name], @list_add[:description])\n end\n end", "title": "" }, { "docid": "a9a8c494b6631ffe9828e3c5a2964ff9", "score": "0.5136402", "text": "def test_run_list_and_file\n T2Server::Run.create($uri, $wkf_l_v, $creds, $conn_params) do |run|\n list = [\"one\", 2, :three]\n list_out = list.map { |v| v.to_s }\n\n run.input_port(\"list_in\").value = list\n run.input_port(\"singleton_in\").file = $file_input\n assert_nothing_raised { run.start }\n assert(run.running?)\n run.wait\n\n assert_equal(run.output_port(\"list_out\").value, list_out)\n assert_equal(run.output_port(\"singleton_out\").value, \"Hello, World!\")\n end\n end", "title": "" }, { "docid": "b642fe3e48b961f9b5ec106b1c6f11d1", "score": "0.51243114", "text": "def test_select\n @todo2.done!\n other_list = TodoList.new(\"Today's Todos\")\n other_list.add(@todo2)\n assert_equal(other_list, @list.select { |todo| todo.done? })\n end", "title": "" }, { "docid": "42d083b26d093dff4a2b9105983b5523", "score": "0.5114217", "text": "def process_each(input, output)\n nil\n end", "title": "" }, { "docid": "7dc7a13e92661b3256f5921c5d2c7f43", "score": "0.51044565", "text": "def process_list(list, origin)\n return if !list || list.empty?\n origin_points = list.map(&:first)\n index = origin_points.index(origin)\n return if !index || index < 0\n process_remaining_of_list_from_index(index, list)\n end", "title": "" }, { "docid": "de5d6d35ecbaace74fe3e2c3cb23fe05", "score": "0.50993824", "text": "def test_executing_series_of_commands_again #for sanity\n # The actual results\n results = []\n [\n 'DEFINE ManualReview BackgroundCheck',\n 'CREATE dan@fountain.com',\n 'CREATE paul@fountain.com',\n 'CREATE paul@fountain.com',\n 'ADVANCE paul@fountain.com',\n 'ADVANCE paul@fountain.com BackgroundCheck',\n 'DECIDE paul@fountain.com 1',\n 'DECIDE dan@fountain.com 1',\n \"ADVANCE dan@fountain.com\",\n 'DECIDE dan@fountain.com 1'\n\n ].each do |line|\n results << ProcessCommand.formulate_output_line(line)\n end\n\n # The expected results\n [\n 'DEFINE ManualReview BackgroundCheck',\n 'CREATE dan@fountain.com',\n 'CREATE paul@fountain.com',\n 'Duplicate applicant',\n 'ADVANCE paul@fountain.com',\n 'Already in BackgroundCheck',\n 'Hired paul@fountain.com',\n 'Failed to decide for dan@fountain.com',\n 'ADVANCE dan@fountain.com',\n 'Hired dan@fountain.com' \n ].each_with_index do |output_line, index|\n assert_equal output_line, results[index]\n end\n end", "title": "" }, { "docid": "00a31e09cba80844b3f0691597ba1ede", "score": "0.5087241", "text": "def check_list(list, expect_head, expect_tail)\n puts \"\\n___check_list___\"\n head = (list.head.nil?) ? \"nil\" : list.head.value\n tail = (list.tail.nil?) ? \"nil\" : list.tail.value\n puts \"Actual: Head = #{head} Tail = #{tail}\"\n puts \"Expected: Head = #{expect_head} Tail = #{expect_tail}\"\n unless (head == expect_head) && (tail == expect_tail)\n puts \"\\n>>>> ERROR <<<< (section above) \"\n end\nend", "title": "" }, { "docid": "36e9aee406619f7d4355eafc5383655f", "score": "0.50863534", "text": "def test_get_items_not_all_done\n assert_equal(false, @todo_list.all_done?)\n end", "title": "" }, { "docid": "a166027bcd6993e65dc08bcb5f85bc0a", "score": "0.5084242", "text": "def testProcess\n executeMaster( [ '--process', 'DummyProcess', '--user', 'DummyUser' ], :AddRegressionProcesses => true ) do |iError|\n assert_equal([], $Variables[:ProcessParameters])\n end\n end", "title": "" }, { "docid": "cbdf14f55b86cec6f913ad681ce80ed6", "score": "0.5083638", "text": "def process_items(items)\n items.each do |item|\n next if item.nil? or item == ''\n msg(\" Found item #{item}...\")\n item = postprocess(item)\n next if item.nil? or item == ''\n\n msg(\" Matched as #{item}\")\n return item\n end\n return nil\n end", "title": "" }, { "docid": "7a83bfdb95dd772f6644410ea986eadc", "score": "0.50802946", "text": "def test_todo_list_output\n @todo_list.add(TODOITEM.create(1, 'test1', 'test_due_date1'))\n @todo_list_output = @todo_list.list\n assert_equal([{:complete=>false,:description=>\"test1\",:due_date=>\"test_due_date1\",:id=>1}], @todo_list_output)\n end", "title": "" }, { "docid": "dd59f3b42e4118abccbe6fe62ce22919", "score": "0.50801617", "text": "def runlist_override_sanity_check!\n # Convert to array and remove whitespace\n if override_runlist.is_a?(String)\n @override_runlist = override_runlist.split(\",\").map(&:strip)\n end\n @override_runlist = [override_runlist].flatten.compact\n override_runlist.map! do |item|\n if item.is_a?(Chef::RunList::RunListItem)\n item\n else\n Chef::RunList::RunListItem.new(item)\n end\n end\n end", "title": "" }, { "docid": "dd59f3b42e4118abccbe6fe62ce22919", "score": "0.50801617", "text": "def runlist_override_sanity_check!\n # Convert to array and remove whitespace\n if override_runlist.is_a?(String)\n @override_runlist = override_runlist.split(\",\").map(&:strip)\n end\n @override_runlist = [override_runlist].flatten.compact\n override_runlist.map! do |item|\n if item.is_a?(Chef::RunList::RunListItem)\n item\n else\n Chef::RunList::RunListItem.new(item)\n end\n end\n end", "title": "" }, { "docid": "a8089d43f8fc95e92f28f7e2e73fb82c", "score": "0.507916", "text": "def test_list_primes_2\n # skip\n expected = [2]\n actual = list_primes(2)\n assert_equal(expected, actual)\n end", "title": "" }, { "docid": "0e5ae0adce0232ad0bfbf5bb7e8aa32f", "score": "0.5061668", "text": "def process_list(list)\n list = list\n modified_list = []\n\n if list.empty?\n puts \"this list is empty\"\n else\n list.each do |id, item|\n # we don't want query string info from linked urls\n url = item['resolved_url'].split(\"?\")[0]\n\n if item[\"has_video\"].to_i == 0\n content = \"<a href='#{URI.escape(url)}'>#{url}</a>\"\n else\n videos = item[\"videos\"]\n content = \"\"\n videos.each do |video|\n src = video[1][\"src\"]\n content += \"<a href='#{URI.escape(src)}'>#{src}</a>\"\n end\n end\n\n content += \"<div><br /></div>\"\n content += CGI.escapeHTML(item['excerpt'])\n\n # some items get saved to pocket without titles\n title = if item[\"resolved_title\"].empty?\n url\n else\n item[\"resolved_title\"]\n end\n\n note_data = {\n :id => id,\n :title => title,\n :content => content\n }\n\n if item[\"tags\"].count > 1\n puts \"What tag do you want for the article \\\"#{title}\\\"\"\n puts \"Available: #{item['tags'].keys}\"\n selected = $stdin.gets.chomp\n\n while !item['tags'].include? selected\n puts \"You typed '#{selected}' which is not in the list of tags.\"\n puts \"Try again: #{item['tags'].keys}\"\n selected = $stdin.gets.chomp\n end\n\n note_data[:notebook] = selected\n else\n note_data[:notebook] = item[\"tags\"].keys[0]\n end\n\n modified_list.push(note_data)\n end\n end\n\n modified_list\n end", "title": "" }, { "docid": "e760390bdc56f24cba1a000a0e28ebd6", "score": "0.5058618", "text": "def testProcessingOrder\n execute_Process_WithConf({\n :Recordings => {\n :Tracks => {\n [1] => {\n :Env => :Env1,\n :Processes => [\n {\n :Name => 'Test',\n :Param1 => 'TestParam2'\n }\n ]\n }\n },\n :EnvProcesses_Before => {\n :Env1 => [\n {\n :Name => 'Test',\n :Param1 => 'TestParam1'\n }\n ]\n },\n :EnvProcesses_After => {\n :Env1 => [\n {\n :Name => 'Test',\n :Param1 => 'TestParam3'\n }\n ]\n },\n :GlobalProcesses_Before => [\n {\n :Name => 'Test',\n :Param1 => 'TestParam0'\n }\n ],\n :GlobalProcesses_After => [\n {\n :Name => 'Test',\n :Param1 => 'TestParam4'\n }\n ]\n }\n },\n :PrepareFiles => getPreparedFiles(:Recorded_Env1_1, :Cleaned_Env1_1)\n ) do |iStdOUTLog, iStdERRLog, iExitStatus|\n assert_exitstatus 0, iExitStatus\n lWave0FileName = getFileFromGlob('04_Process/Record/Env1.1.04.NoiseGate.0.Test.????????????????????????????????.wav')\n lWave1FileName = getFileFromGlob('04_Process/Record/Env1.1.04.NoiseGate.1.Test.????????????????????????????????.wav')\n lWave2FileName = getFileFromGlob('04_Process/Record/Env1.1.04.NoiseGate.2.Test.????????????????????????????????.wav')\n lWave3FileName = getFileFromGlob('04_Process/Record/Env1.1.04.NoiseGate.3.Test.????????????????????????????????.wav')\n lWave4FileName = getFileFromGlob('04_Process/Record/Env1.1.04.NoiseGate.4.Test.????????????????????????????????.wav')\n assert_rb_content [\n {\n :InputFileName => '02_Clean/Record/Env1.1.04.NoiseGate.wav',\n :OutputFileName => lWave0FileName,\n :Params => {\n :Param1 => 'TestParam0'\n }\n },\n {\n :InputFileName => lWave0FileName,\n :OutputFileName => lWave1FileName,\n :Params => {\n :Param1 => 'TestParam1'\n }\n },\n {\n :InputFileName => lWave1FileName,\n :OutputFileName => lWave2FileName,\n :Params => {\n :Param1 => 'TestParam2'\n }\n },\n {\n :InputFileName => lWave2FileName,\n :OutputFileName => lWave3FileName,\n :Params => {\n :Param1 => 'TestParam3'\n }\n },\n {\n :InputFileName => lWave3FileName,\n :OutputFileName => lWave4FileName,\n :Params => {\n :Param1 => 'TestParam4'\n }\n }\n ], 'Process_Test.rb'\n end\n end", "title": "" }, { "docid": "d500ae19dcd3163471669c98c83f7fac", "score": "0.5035059", "text": "def runlist_override_sanity_check!\n # Convert to array and remove whitespace\n if @override_runlist.is_a?(String)\n @override_runlist = @override_runlist.split(',').map { |e| e.strip }\n end\n @override_runlist = [@override_runlist].flatten.compact\n @override_runlist.map! do |item|\n if(item.is_a?(Chef::RunList::RunListItem))\n item\n else\n Chef::RunList::RunListItem.new(item)\n end\n end\n end", "title": "" }, { "docid": "2928d87dd43e2b7052e65abb4a8db6c6", "score": "0.50304896", "text": "def testNominalWithFilesList\n setupTest(:FilesList => true) do |iTasksFileName, iTicketsFileName, iLocalRepository, iFilesFileName|\n $Context[:OS_ExecAnswers] = [\n # svn up => no conflict\n [ 0, 'M SampleFile.txt' ],\n # svn ci => success\n [ 0, 'Sending SampleFile.txt\nTransmitting file data .\nCommitted revision 314.' ]\n ]\n executeProcess(\n [\n '--user', 'CommitUser',\n '--branch', 'BranchName',\n '--comment', 'CommitComment',\n '--tasksfile', iTasksFileName,\n '--ticketsfile', iTicketsFileName,\n '--filesfile', iFilesFileName,\n '--local', iLocalRepository\n ]\n ) do |iError, iSlaveActions|\n checkCallsMatch(\n [\n [ 'query', 'svn update --accept=postpone \"File name 1\" FileName2 \"File name 3\"' ],\n [ 'query', 'svn ci --message \"CommitComment\" --username CommitUser \"File name 1\" FileName2 \"File name 3\"' ]\n ],\n $Variables[:OS_Exec]\n )\n assert_equal(@@CommonSlaveActions, iSlaveActions)\n end\n end\n end", "title": "" }, { "docid": "62fcd6c89233402e703f28e627f0a2a5", "score": "0.5030307", "text": "def sync_result_list\n if type != FINAL_STATUS\n raise 'Can only sync results using a finalized result list'\n end\n\n if invalid?\n raise 'Result list must be valid before syncing can be performed'\n end\n\n\n end", "title": "" }, { "docid": "af3a876a05246c7abded5c68a7d1af3c", "score": "0.5024654", "text": "def test_reverse_each\n expect do\n @list.reverse_each { |img| expect(img).to be_instance_of(Magick::Image) }\n end.not_to raise_error\n end", "title": "" }, { "docid": "6a8c5edf17fc526c9fbf6d02cc02c392", "score": "0.5018223", "text": "def excluded_from_list?(fn); end", "title": "" }, { "docid": "c6d372f764bf69ae692bea0498810026", "score": "0.5016452", "text": "def assert_empty_list(arg)\n assert_list arg\n assert(arg.empty?)\n end", "title": "" }, { "docid": "dfa6fb725c419e0be0ff8dc3c85f0977", "score": "0.50116706", "text": "def test_execute_rpn_other_error\r\n input = [[\"LET A 1\", \"LET B 2\", \"PRINT A B +\"], [\"PRINT C\"]]\r\n val = 0\r\n assert_output(\"3\\n\") {val = @arg_checker.execute_rpn(input)}\r\n assert_equal [1, \"C\", 4], val\r\n end", "title": "" }, { "docid": "774b9e5c318199d9cb8f6ae9367ce690", "score": "0.5009871", "text": "def _process(processors = [])\n @validation_result = nil\n result = DataWrangler::Validators::Result.success(@value)\n\n processors.each do |processor|\n result = processor.run(result)\n break if result.failure?\n end\n\n @validation_result = result\n @validation_result.success?\n end", "title": "" }, { "docid": "f48384ccbb3d3f83a43cf3991d567277", "score": "0.5008679", "text": "def run_selected_tests(test_list)\n read_env\n ret = true\n test_list = test_list.split(/[\\s,]+/) if test_list.is_a? String\n self.failed_tests -= test_list\n test_list.each do |test|\n ret &= run_a_test test\n end\n ret\n end", "title": "" }, { "docid": "5f12b28ef16d9614415b55f2b2dd0768", "score": "0.500768", "text": "def each_child_process(process, &block)\n parents = [process]\n \n @list.each do |element| \n oh_is_it = parents.any?{|par| par.id == element.parent_id}\n if oh_is_it then\n parents << element\n end\n end\n \n parents.delete(process)\n parents.each(&block)\n end", "title": "" }, { "docid": "522cb97a1425fbc5b392bf44bf36f8c9", "score": "0.5004017", "text": "def test_munge_list\n # single string is converted to one-member array\n assert_equal(\n ['this'],\n Messages::Actions.munge_list('this')\n )\n\n assert_equal(\n ['this', 'that', 'theother'],\n Messages::Actions.munge_list(['this', ', that', 'that', ' and theother'])\n )\n end", "title": "" }, { "docid": "48f4f17829565e9c96f887d28323eaab", "score": "0.49959767", "text": "def process_result(result)\n result\n end", "title": "" }, { "docid": "899f3c8ad991b060e765bbfecc94d63a", "score": "0.498622", "text": "def test_can_index_list_w_result_of_fn_call\n result = interpret 'a=[1,2]; defn id() { 0 }; :a[id()]'\n assert_eq result, 1\n end", "title": "" }, { "docid": "f7ff0d1b31157d5565f00da42fbd29be", "score": "0.49801835", "text": "def test_e31_delete\n root = Utils::ListNode.new('1')\n list = Utils::LinkedList.new(root)\n create_list(list, '2', '3', '4', '5', '6')\n\n root2 = Utils::ListNode.new('1')\n list2 = Utils::LinkedList.new(root2)\n create_list(list2, '2', '3', '4', '5', '6')\n\n root3 = Utils::ListNode.new('1')\n list3 = Utils::LinkedList.new(root3)\n create_list(list3, '2', '3', '4', '5', '6')\n\n verify_method :e31_delete,\n :with =>\n [\n {params: [root, '5'], predicate: Proc.new { check_delete('5', root) }},\n {params: [root2, '4'], predicate: Proc.new { check_delete('4', root2) }},\n {params: [root3, '7'], predicate: Proc.new { check_delete('7', root3) }},\n ]\n\n end", "title": "" }, { "docid": "bcee3b7f8ac101bae6ea21bf0540433c", "score": "0.49742252", "text": "def process_on_item\n # Assume first level to be array so ignore it\n return true if stack.count < 1\n\n # Process only top level items\n return false if stack.count > 1\n\n raise ArgumentError.new(\"\\\"process_data\\\" can't be null!\") if process_data.nil?\n process_data.call stack.pop, stack.count\n true\n end", "title": "" }, { "docid": "9fd726215b63ebf38dd15648a29f0c10", "score": "0.4973583", "text": "def test_case1_wrong_result \n assert_not_equal(8,Remoteprogram.new('1 20','2 18 19','5 15 14 17 1 17').result)\n\n end", "title": "" }, { "docid": "10abacb972cb73d4a9afdc8c249077fb", "score": "0.49731317", "text": "def test_list_get()\n One::EmailDirect::Facade.list_add(@credentials, @list_get[:name], @list_get[:description])\n\n\n # 1.\n result = One::EmailDirect::Facade.list_get(@credentials, @list_get[:name])\n assert result.has_key? :element_id\n assert result.has_key? :element_name\n assert result.has_key? :description\n result.delete(:element_id)\n expected = {\n :element_name => @list_get[:name],\n :description => @list_get[:description]\n }\n assert_equal expected, result\n\n\n # 2.\n assert_nil One::EmailDirect::Facade.list_get(@credentials, 'inexistent')\n end", "title": "" }, { "docid": "a83dca724bbd6ca5b87a80fa143bd23a", "score": "0.49665183", "text": "def test_checklist_status_vals_for_test_execution_one_execution_errored_one_failing\n test, c1_task, c3_task = setup_checklist_status_vals_for_execution\n c1_task.test_executions.create!(state: :errored, _id: '12345', sibling_execution_id: '54321', user: @user)\n c3_task.test_executions.create!(state: :failed, _id: '54321', sibling_execution_id: '12345', user: @user)\n assert_equal [0, 1, 0, 0, 1], checklist_status_vals_for_execution(test, 'C1')\n end", "title": "" }, { "docid": "5241d527fad8349293905a5708d48ca7", "score": "0.49600875", "text": "def test_ps(process, expected_value, error_msg)\n found = true\n begin\n ChefInit::Process.running?(process)\n rescue ChefInit::Exceptions::ProcessNotFound => e\n found = false\n ensure\n if found == expected_value then pass else fail error_msg end\n end\n end", "title": "" }, { "docid": "360319e11725ab5c78893a6b6704e40d", "score": "0.494789", "text": "def toppings_should_be(list) \r\n list.each do |topping|\r\n assert_text_in_body topping\r\n end\r\n end", "title": "" }, { "docid": "a38a54776ab969e4acd37302dcfb710e", "score": "0.49420053", "text": "def test_this_later\n @collection << Peiger::Item.new(4, 4)\n assert_equal false, @collection.next_order?(10)\n end", "title": "" }, { "docid": "ceae30fe4748b5025990e7128ed6aa9a", "score": "0.49362162", "text": "def test_loop_each_number_with_only_one_number\n result = loop_each_number([\"3\"])\n assert_equal([\"1\",\"3\"],result)\n end", "title": "" }, { "docid": "642edac774337cea62648841ed888e1c", "score": "0.49294126", "text": "def test_check_args_valid\n\t\targs = Prospect.new(0)\n\t\tassert_silent {args.check_args [1, 2]}\n\tend", "title": "" }, { "docid": "e15ef43c57e1050a7f58a9460def1c09", "score": "0.49170536", "text": "def list_processes\n check_connection\n @fields = @protocol.process_info_command\n @result_exist = true\n store_result\n end", "title": "" }, { "docid": "2407fc48ff5e1c2aebc1fc509ebd20fe", "score": "0.4916875", "text": "def cycleCheckProcessingList()\n ## completed demand list.\n compList = [] ;\n @processingList.each{|demand|\n if(demand.getState() == :afterDropOff) then\n compList.push(demand) ;\n @completedList.push(demand) ;\n demand.complete(@simulator) ;\n outputDemandLogInJson(demand) ;\n end\n }\n compList.each{|demand|\n @processingList.delete(demand) ;\n }\n \n ## cancelled demand list.\n @newCancelledList.each{|demand|\n outputDemandLogInJson(demand) ;\n compList.push(demand) ;\n }\n @newCancelledList.clear() ;\n \n return compList ;\n end", "title": "" }, { "docid": "1448ed7f0a96b9c78db72109eec6c50c", "score": "0.4910941", "text": "def test_filter(result)\n [result,result]\n end", "title": "" }, { "docid": "c124a3dcbcf26c643566ef684ed1a1ad", "score": "0.4910531", "text": "def solution_02(list)\n nil\nend", "title": "" }, { "docid": "dce570e663ad6fa2367814b55ea0cfeb", "score": "0.49083963", "text": "def test_013\n testList = MovieList.new\n movie2 = Movie.new( 'Gone with the Wind', 6, 'Better' )\n\ttestList.add( movie2 )\n movie1 = Movie.new( 'Grease', 9, 'best' )\n testList.add( movie1 )\n\tfoundMovie = testList.getMovie( 'grease' )\n\tassert_not_nil( foundMovie, 'Failure finding the movie GREASE in the movie list' )\n\tassert( foundMovie.name == 'GREASE', 'Expected GREASE but wrong movie returned. Movie found: ' + foundMovie.name )\n\t\n\tfoundMovie = testList.getMovie( 'gone with the wind' )\n\tassert_not_nil( foundMovie, 'Failure finding the movie GONE WITH THE WIND in the movie list' )\n\tassert( foundMovie.name == 'GONE WITH THE WIND', 'Expected GONE WITH THE WIND but wrong movie returned. Movie found: ' + foundMovie.name )\n end", "title": "" }, { "docid": "afde93979867224b01b70cf1b261c354", "score": "0.4907891", "text": "def test_listable_1\n a = authors(:author1)\n l = a.listable_products()\n assert_equal(1, l.size)\n assert_equal(products(:product1), l[0])\n end", "title": "" }, { "docid": "1fcb091bc393f59a309cb94548565e2e", "score": "0.49046886", "text": "def test_filtered_list\n\n end", "title": "" }, { "docid": "e3438856e255cfbedbb06c1cddbd3f9a", "score": "0.49042696", "text": "def assert_list(arg)\n assert_kind_of(C::NodeList, arg)\n end", "title": "" }, { "docid": "93ba64e3a32c1eabfffb95a138f09814", "score": "0.4899827", "text": "def test_add_shovel\n list = Marshal.load(Marshal.dump(@list))\n todo4 = Todo.new(\"hello\")\n list.add(todo4)\n @list << todo4\n assert_equal(list, @list)\n end", "title": "" }, { "docid": "88ad64a33ca2ebb85f0acbfdfbdeabae", "score": "0.4891649", "text": "def process_result_add_del_on_list(result)\n @conn.class.process_result_add_del_on_list(result)\n end", "title": "" }, { "docid": "88ad64a33ca2ebb85f0acbfdfbdeabae", "score": "0.4891649", "text": "def process_result_add_del_on_list(result)\n @conn.class.process_result_add_del_on_list(result)\n end", "title": "" }, { "docid": "95695f22cfbbc153ad56f5821a0fc779", "score": "0.48851824", "text": "def seems_valid_result?(result)\n not(result.nil?) and Array===result and result.size==3\n end", "title": "" }, { "docid": "3380a5e16220fd1518674035acfa5640", "score": "0.48833618", "text": "def test_each\n array = [1,2,3]\n result = []\n array.each do |x|\n result << x\n end\n assert_equal([1,2,3], result)\n end", "title": "" }, { "docid": "2fc80ab4e74ff964363904ed82e8e580", "score": "0.48823786", "text": "def test_for_createItem\n assert( @db.createItem( @list1 ).kind_of?( Recipe ), \n\t \"List1 does not produce a recipe.\" )\n\tassert( @db.createItem( @list2 ).kind_of?( BasicFood ), \n\t \"List2 does not produce a basic food.\" )\n end", "title": "" }, { "docid": "d78d4d7a19b74c6be264489f878a1b22", "score": "0.48785022", "text": "def run!\n raise ThreadedProcessorError.new(\"Object list is empty!\") if (@list.empty? || !@list.is_a?(Array))\n raise ThreadedProcessorError.new(\"Assign block\") if @block.nil?\n threads = (1..@max_threads).map do |i|\n Thread.new(@queue) do |q|\n until ( q == ( obj = q.deq ) )\n @block.call(obj)\n end\n end\n end\n @list.each{|o| @queue.enq o}\n threads.size.times{@queue.enq @queue}\n threads.each{|t| t.join}\n true\n end", "title": "" }, { "docid": "360029af7dcc95c6a868ca5234478813", "score": "0.48775396", "text": "def test_splitter_empty\n assert_equal [], @process.line_splitter('')\n end", "title": "" }, { "docid": "3f259afbd394532b4e18d93adb1d0c31", "score": "0.48765078", "text": "def dont_test_clean_results\n repository = Repository.find(:first)\n article1 = Article.create!(:title=> \"a\", :uri=>\"http://www.example.com/1\", :repository=>repository)\n article2 = Article.create!(:title=> \"b\", :uri=>\"http://www.example.com/2\", :repository=>repository)\n identical_results = [ [\"Winter Olympic\", article1] , [\"Winter Olympic\", article2] ]\n cleaned_results = Article.clean_results(identical_results)\n assert identical_results.size == 2, \"Wrong number of original items\"\n assert cleaned_results.size == 1, \"Wrong number of final items\"\n containing_results = [ [\"Winter Olympic Games\", article1] , [\"Winter Olympic\", article2] ]\n cleaned_results = Article.clean_results(containing_results)\n assert containing_results.size == 2, \"Wrong number of original items\"\n assert cleaned_results.size == 1, \"Wrong number of final items\"\n end", "title": "" } ]
3b7c3dc465cb2c09389afb5d9555f35d
Called on file(s) additions that the Guard plugin watches.
[ { "docid": "e9050d4e3037ca179091cdfe134fc2d7", "score": "0.0", "text": "def run_on_additions(paths)\n run_partially(paths)\n end", "title": "" } ]
[ { "docid": "1a26a135e9cd540938154bed95e57d75", "score": "0.67840475", "text": "def watchable_files; end", "title": "" }, { "docid": "99b9a307bcb1b5c8d928c82e24cbe740", "score": "0.6669997", "text": "def start_watch_files\n watched_files.each do |file|\n @notifier.watch(file, :modify) do\n Js2coffee.watch_file(file)\n end\n end\n end", "title": "" }, { "docid": "a6edbcb68d78880cf0eaacef97dea1f5", "score": "0.65901035", "text": "def file_watcher; end", "title": "" }, { "docid": "c3e77d1a4e4bdc674632ac33e574c24d", "score": "0.6544324", "text": "def add_to_guardfile\n if evaluator.guardfile_include?(name)\n UI.info \"Guardfile already includes #{name} guard\"\n else\n content = File.read(\"Guardfile\")\n File.open(\"Guardfile\", \"wb\") do |f|\n f.puts(content)\n f.puts(\"\")\n f.puts(plugin_class.template(plugin_location))\n end\n\n UI.info INFO_ADDED_GUARD_TO_GUARDFILE % name\n end\n end", "title": "" }, { "docid": "f56f8960280e8ca4b07d37ef43930e69", "score": "0.65052927", "text": "def notify(changed_files)\n ::Guard.guards.each do |guard|\n paths = Watcher.match_files(guard, changed_files)\n guard.run_on_change(paths) unless paths.empty?\n end\n end", "title": "" }, { "docid": "ce79dd33131e4c65bb75abf907cc8ac8", "score": "0.64579064", "text": "def add_callback(file, &block)\n\t\tdir, filename = File.split(file)\n\t\tif ! @dirs.include?(dir) or ! @dirs[dir].include?(filename)\n\t\t\traise StandardError, \"File #{file} is not watched\"\n\t\telse\n\t\t\tif @callbacks.include?(file)\n\t\t\t\traise StandardError, \"File #{file} already have associated callbacks\"\n\t\t\telse\n\t\t\t\t@callbacks[file] = block\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "1a7519faa6a0612321e6eb190d52157c", "score": "0.64030105", "text": "def listeners\n watch_paths.map do |pth|\n gem_path_dir = File.join(@gem_base, pth)\n Listen.to(gem_path_dir, only: /\\.html\\.erb$/) do |modded, added, removed|\n Rails.logger.warn(\"[#{self.class}] : updates: changed => #{modded}, added: #{added}, removed: #{removed}\")\n (modded + added).each do |f|\n dest = Rails.root.join(pth, File.basename(f))\n Rails.logger.info(\"Updating #{f} to #{dest}\")\n FileUtils.copy_file(f, dest)\n end\n end\n end\n end", "title": "" }, { "docid": "f71e3bdcd6ab8506c9ccb7c5b42e6937", "score": "0.6383796", "text": "def on_other_file; end", "title": "" }, { "docid": "8317f33d9bcc57238d66f0ebe703d2a4", "score": "0.6355249", "text": "def add_watch(n_file)\n \t@notifier.watch(n_file,:all_events) do |event|\n \t\tputs \"event name :- #{event.name} and event flags :- #{event.flags}\"\n \t\tcheck_event_status(event,n_file)\n \tend\n end", "title": "" }, { "docid": "b3aa59d24a84a8c4bfc94d2c3d883a9f", "score": "0.62738806", "text": "def watch(file_name)\n raise LogFileNotFoundError unless File::exists?(file_name)\n raise LogFileAlreadyIncludedError if @watched_files.include?(file_name)\n @watched_files << file_name\n end", "title": "" }, { "docid": "a8ff9c1fc3ae72e658ea133a675795b0", "score": "0.62678915", "text": "def started(_files_to_lint)\n end", "title": "" }, { "docid": "bf394a8d506a92c0a73c3d909d6b19c6", "score": "0.62226415", "text": "def register_files_for_cleanup(*files)\n @dropped_files += files\n end", "title": "" }, { "docid": "873eb70640ee4871871d99d0b6829af5", "score": "0.6182692", "text": "def watch_feature_files\n files.each do |file|\n watch(file)\n end \n end", "title": "" }, { "docid": "6a159b26940d8126f430b032c0605886", "score": "0.6154546", "text": "def run_all\n run_on_change(Watcher.match_files(self, Dir.glob(File.join('**', '*.*'))))\n end", "title": "" }, { "docid": "6a159b26940d8126f430b032c0605886", "score": "0.6154546", "text": "def run_all\n run_on_change(Watcher.match_files(self, Dir.glob(File.join('**', '*.*'))))\n end", "title": "" }, { "docid": "d7423c61f783e6f40b80cf03798bd788", "score": "0.61539", "text": "def run_on_changes(modified, added, removed)\n ::Guard::UI.clearable\n\n #TODO: this should be handled like every other plugin\n if ::Guard::Watcher.match_guardfile?(modified)\n ::Guard.evaluator.reevaluate_guardfile\n end\n\n _scoped_plugins do |guard|\n modified_paths = ::Guard::Watcher.match_files(guard, modified)\n added_paths = ::Guard::Watcher.match_files(guard, added)\n removed_paths = ::Guard::Watcher.match_files(guard, removed)\n\n ::Guard::UI.clear if _clearable?(guard, modified_paths, added_paths, removed_paths)\n\n _run_first_task_found(guard, MODIFICATION_TASKS, modified_paths) unless modified_paths.empty?\n _run_first_task_found(guard, ADDITION_TASKS, added_paths) unless added_paths.empty?\n _run_first_task_found(guard, REMOVAL_TASKS, removed_paths) unless removed_paths.empty?\n end\n end", "title": "" }, { "docid": "5ebfd1bc78320c0f13b6b1c501453ab0", "score": "0.6127523", "text": "def run_all\n run_on_modifications(Watcher.match_files(self, Dir.glob(File.join('**', '*.*'))))\n end", "title": "" }, { "docid": "b2e0619953589214a8ab90f9d893fcb4", "score": "0.6124389", "text": "def run_all\n patterns = @watchers.map { |w| w.pattern }\n files = Dir.glob('**/*.*')\n r = []\n files.each do |file|\n patterns.each do |pattern|\n r << file if file.match(Regexp.new(pattern))\n end\n end\n run_on_change(r)\n end", "title": "" }, { "docid": "1189c62d2648f4c473cb37819e5ee41e", "score": "0.6109328", "text": "def register_files_for_cleanup(*files)\n\t\t@dropped_files ||= []\n\t\t@dropped_files += files\n\n\t\tnil\n\tend", "title": "" }, { "docid": "25d9f491e9e3e9330099fd6e0e08118a", "score": "0.6086796", "text": "def run_all\n run_on_change(Watcher.match_files(self, Dir.glob('**/*')))\n end", "title": "" }, { "docid": "c86be67e5ffa2bd69ee9671762c71e7f", "score": "0.60852605", "text": "def run_all\n run_on_change(Watcher.match_files(self, Dir.glob(File.join('**', '[^_]*.*'))))\n end", "title": "" }, { "docid": "2600429e1fc40f3a58d12773719ff3cc", "score": "0.608515", "text": "def _after_reevaluate_guardfile\n ::Guard::Notifier.turn_on if ::Guard::Notifier.enabled?\n\n if ::Guard.plugins.empty?\n ::Guard::Notifier.notify('No plugins found in Guardfile, please add at least one.', title: 'Guard re-evaluate', image: :failed)\n else\n msg = 'Guardfile has been re-evaluated.'\n ::Guard::UI.info(msg)\n ::Guard::Notifier.notify(msg, title: 'Guard re-evaluate')\n\n ::Guard.runner.run(:start)\n end\n end", "title": "" }, { "docid": "a389df19b2488e1474d1b7b7575c5dfa", "score": "0.60772187", "text": "def run_on_changes(paths)\n #paths.each do |p| ::Guard::UI.info(\"Files effect : #{p}\") end\n @command.sync\n end", "title": "" }, { "docid": "4d77410a6c2c68e3f2c04c06a4979945", "score": "0.60622025", "text": "def run_once\n files = scan_files\n keys = [files.keys, @files.keys] # current files, previous files\n\n find_added(files, *keys)\n find_modified(files, *keys)\n find_removed(*keys)\n\n notify_observers\n @files = files # store the current file list for the next iteration\n self\n end", "title": "" }, { "docid": "e87033e4dc363c2e5d279a2c9276efb0", "score": "0.6059753", "text": "def run_on_changes(_paths)\n jammit\n end", "title": "" }, { "docid": "a42ea3dcea59ca81aef53d447e5f29f9", "score": "0.60531473", "text": "def on_other_file\n # Typically do nothing here\n end", "title": "" }, { "docid": "66c96c4e21f318e07ac44b18d0622b6d", "score": "0.6051755", "text": "def run_all\n run_on_change(Watcher.match_files(self, Dir.glob('{,**/}*{,.*}').uniq))\n end", "title": "" }, { "docid": "66c96c4e21f318e07ac44b18d0622b6d", "score": "0.6051755", "text": "def run_all\n run_on_change(Watcher.match_files(self, Dir.glob('{,**/}*{,.*}').uniq))\n end", "title": "" }, { "docid": "1e931d7196f1361d42997965c6ae80e0", "score": "0.6042094", "text": "def run_all\n run_on_changes(Watcher.match_files(self, Dir.glob('**{,/*/**}/*').uniq.compact))\n end", "title": "" }, { "docid": "1a4acb17f481626e51a7d544dd02e997", "score": "0.60041386", "text": "def changed_and_added_files\n check_repo\n changed_files + added_files\n end", "title": "" }, { "docid": "9847ff5253110e6224c83fb52b1ac897", "score": "0.59945375", "text": "def run_all\n run_on_changes(Watcher.match_files(self, Dir.glob(File.join('**', '*.*'))))\n end", "title": "" }, { "docid": "fd4de112ddfa9c824af0ffa6f631f8e5", "score": "0.5965059", "text": "def track_files(glob); end", "title": "" }, { "docid": "9cda591e8f10e8a43bc7e64b8477bf96", "score": "0.59584486", "text": "def run_all\n patterns = @watchers.map {|w| w.pattern}\n files = Dir.glob('**/*.*')\n r = []\n files.each do |file|\n patterns.each do |pattern|\n r << file if file.match(Regexp.new(pattern))\n end\n end\n run_on_change(r)\n end", "title": "" }, { "docid": "93187ec877fcb24377c262ad42bed7b3", "score": "0.5943842", "text": "def initial_add\n begin\n @warn_files_count = 0\n @warn_too_many_files = true\n yield\n ensure\n @warn_files_count = 0\n @warn_too_many_files = false\n end\n end", "title": "" }, { "docid": "32036937c8b17dbe9f8eed020a44948d", "score": "0.5936591", "text": "def added?(file); end", "title": "" }, { "docid": "96aa591c2b897eaf30554bf2021d8518", "score": "0.5925916", "text": "def run_all\n run_on_changes(Watcher.match_files(self, Dir.glob(\"**/*\")))\n end", "title": "" }, { "docid": "15ce51af94cdd3641e4da3d43ee22aef", "score": "0.5909168", "text": "def _add_hooks\n _add_load_guard_rc_hook\n _add_load_project_guard_rc_hook\n _add_restore_visibility_hook if _stty_exists?\n end", "title": "" }, { "docid": "29ceade992a13fac65ee9aa0c25d4c92", "score": "0.5903846", "text": "def add_extra_files(*files); end", "title": "" }, { "docid": "8fc58d078de5ff7e155b8bc3b0f43433", "score": "0.5902845", "text": "def h_file(filename, events)\n @events[filename] = [] unless @events[filename]\n\n @events[filename] += events\n Log.debug(\"Watcher File added events for file #{filename}\")\n end", "title": "" }, { "docid": "2369c132114751a9a9673b045ccdc37c", "score": "0.5896134", "text": "def run_on_changes(paths)\n paths.each do |file|\n ::Guard::UI.info \"Testing #{file}.\"\n test file\n end\n end", "title": "" }, { "docid": "e7351abba95613f8a7923c7c6faf6a3d", "score": "0.5894796", "text": "def run_on_change(paths)\n jammit\n end", "title": "" }, { "docid": "6d4d8cae99426484e821680a1920f0de", "score": "0.5873108", "text": "def run_on_additions(paths)\n puts \"Something was added!\"\n end", "title": "" }, { "docid": "94b7a2bf710939fd8b6ede7f055ff3dd", "score": "0.5859088", "text": "def on_require(file, &action)\n REQUIRE_HOOKS[file] = [] unless REQUIRE_HOOKS.has_key?(file)\n REQUIRE_HOOKS[file] << action\n end", "title": "" }, { "docid": "5f6f6225cd0d04bbc35b03a823c7567f", "score": "0.5856096", "text": "def extra_debug_files(filename)\n yaml_file(filename)\n html_file(filename)\n txt_file(filename)\n end", "title": "" }, { "docid": "6bb7db79bddf9ae8b33a7b12797849d1", "score": "0.5854175", "text": "def run_all\n run_on_changes files.reject {|f| partial?(f) }\n end", "title": "" }, { "docid": "6bb7db79bddf9ae8b33a7b12797849d1", "score": "0.5854175", "text": "def run_all\n run_on_changes files.reject {|f| partial?(f) }\n end", "title": "" }, { "docid": "7ec06875c54df1eae3b6834dcbad1ec1", "score": "0.58478826", "text": "def scan\n unless @@files_seen.include? @file_name\n\t@@files_seen << @file_name\n\tremove_commented_out_lines\n\tif module_name = do_module\n\t @@module_name = module_name\n\t do_methods module_name\n\telse\n\t do_classes\n\t @classes.keys.each do |c|\n\t do_constants c\n\t do_methods c\n\t do_includes\n\t do_aliases c\n\t end\n\t end\n else\n\tputs \"Seen #{@file_name} before\" unless @options.quiet\n end\n @top_level\n end", "title": "" }, { "docid": "fdb53f455b756c4a0d31b2537d044450", "score": "0.5842525", "text": "def reload!\n # Detect changed files\n rotation do |file, mtime|\n # Retrive the last modified time\n new_file = MTIMES[file].nil?\n previous_mtime = MTIMES[file] ||= mtime\n logger.devel \"Detected a new file #{file}\" if new_file\n # We skip to next file if it is not new and not modified\n next unless new_file || mtime > previous_mtime\n # Now we can reload our file\n apps = mounted_apps_of(file)\n if apps.present?\n apps.each { |app| app.app_obj.reload! }\n else\n safe_load(file, :force => new_file)\n # Reload also apps\n Padrino.mounted_apps.each do |app|\n app.app_obj.reload! if app.app_obj.dependencies.include?(file)\n end\n end\n end\n end", "title": "" }, { "docid": "3c7a1e7a53741de1bd44ff155169988e", "score": "0.5840651", "text": "def append_file(name)\n puts \"append file: #{name}\"\n config_add_source name\nend", "title": "" }, { "docid": "4ea1e9adf7a03135cea22bbceb2ebbf1", "score": "0.5795999", "text": "def _add_hooks(options)\n _add_load_guard_rc_hook(Pathname(options[:guard_rc] || GUARD_RC))\n _add_load_project_guard_rc_hook(Pathname.pwd + \".guardrc\")\n _add_restore_visibility_hook if terminal_settings.configurable?\n end", "title": "" }, { "docid": "f36d720514fd345cb313a16884fa6eb8", "score": "0.5785161", "text": "def file_watcher=(_arg0); end", "title": "" }, { "docid": "f50ed3dcd4b63d3d7c090032a6705850", "score": "0.5782593", "text": "def run_on_modifications(files)\n files.each do |path|\n puts \"Performing Code Climate analysis of #{path.inspect}\"\n ::Guard::Dsl.new.eager(\"codeclimate analyze #{Shellwords.escape(path)}\")\n end\n end", "title": "" }, { "docid": "6a993b0298bf936549aacf9027b5336b", "score": "0.5769811", "text": "def added_files\n @repository.chdir do\n @added ||= @repository.status.added.to_a.map(&:first)\n end\n end", "title": "" }, { "docid": "dd195b200b05b781902a55671f67b1d6", "score": "0.5762733", "text": "def watch()\n GALogger.log(\"Watching...\")\n system(\"filewatcher '*.{m,swift}' 'xctestfile $FILENAME'\", out: $stdout, err: :out)\n end", "title": "" }, { "docid": "31fd6fd9c745d4bde9e6e6d417f45441", "score": "0.57586503", "text": "def offending_files(files = nil)\n files_to_lint = fetch_files_to_lint(files)\n pronto(files_to_lint)\n end", "title": "" }, { "docid": "814e3703fd30d9ef6500b61481cdb53a", "score": "0.57502204", "text": "def setup_listener\n listener_callback = lambda do |modified, added, removed|\n\n # Convert to relative paths (respective to the watchdir it came from)\n @watchdirs.each do |watchdir|\n [modified, added, removed].each do |paths|\n paths.map! do |path|\n if path.start_with? watchdir\n path.sub \"#{watchdir}#{File::SEPARATOR}\", ''\n else\n path\n end\n end\n end\n end\n ::Guard::Dsl.reevaluate_guardfile if ::Guard::Watcher.match_guardfile?(modified)\n\n ::Guard.within_preserved_state do\n runner.run_on_changes(modified, added, removed)\n end\n end\n\n listener_options = {}\n %w[latency force_polling].each do |option|\n listener_options[option.to_sym] = options[option] if options.key?(option)\n end\n\n listen_args = @watchdirs + [listener_options]\n @listener = Listen.to(*listen_args).change(&listener_callback)\n end", "title": "" }, { "docid": "0cf08535efde0903e9a4ea773235b770", "score": "0.5749647", "text": "def scan_changed_with_spec(&block) # :yields: file, spec\n scan_changed do |file|\n spec = spec_for(file)\n block.call(file, spec) if File.exists?(spec)\n end\n end", "title": "" }, { "docid": "7e61ce84f9a3958955b806e57b7cd7e9", "score": "0.57403314", "text": "def register_file(name)\n @included_files << Pathname.new(name).expand_path.to_s\n end", "title": "" }, { "docid": "5feee701549cbabd71e359c2a65b3af1", "score": "0.5722055", "text": "def attach_source_watchers\n @source_watchers = {}\n \n @config.source_files.each do |file|\n watcher = FileWatcher.new(file, @interval)\n @source_watchers[file] = watcher\n \n watcher.on :change do\n fire(:source_change, file)\n end\n \n watcher.attach(@loop)\n end\n end", "title": "" }, { "docid": "f8c8ce85b7fc507a752ce41afbe3cada", "score": "0.5721161", "text": "def startWatch()\n \tself.fsRoots.each do |root|\n\t \t\taddWatch(root)\n\t \tend\n\t\trunWatch()\n\tend", "title": "" }, { "docid": "607d52cddea5e4c3f1290c6d7e32d120", "score": "0.57175994", "text": "def initialize options, processor, changed_files\n super(options, processor)\n\n @paths = changed_files.map {|f| @app_tree.expand_path(f) }\n @old_results = tracker.filtered_warnings # Old warnings from previous scan\n @changes = nil # True if files had to be rescanned\n @reindex = Set.new\n end", "title": "" }, { "docid": "9b593bfb73f0d54b8d0f2babd033f771", "score": "0.5715568", "text": "def add(*files)\n files.each do |file|\n state = self[file]\n if state.added? || state.modified? || state.normal?\n # fail if it's being tracked\n UI.warn \"#{file} already tracked!\"\n elsif state.removed?\n # check back on it if it's being removed\n normal_lookup file\n else\n # else add it\n add_path file, true\n\n @dirty = true\n @files[file] = DirStateEntry.new(:added, 0, -1, -1)\n @copy_map.delete file\n end\n end\n true # success\n end", "title": "" }, { "docid": "cd6c928348f8b6ffddd83f5fe0d7d935", "score": "0.57139796", "text": "def run_on_change(paths)\n paths.each do |file|\n output_file = get_output(file)\n FileUtils.mkdir_p File.dirname(output_file)\n\n FileUtils.cp(file, output_file)\n ::Guard::UI.info \"# copied '#{file}' to '#{output_file}'\"\n ::Guard::Notifier.notify(\"# copied #{file}\", :title => \"Guard::Copy\", :image => :success) if @options[:notifications]\n end\n notify paths\n end", "title": "" }, { "docid": "4dbc12ef490efb967f5a621927c2d15e", "score": "0.5713972", "text": "def addFile(file)\n\t\tif file.respond_to?(\"interesting\") then\n\t\t\t@files << file\n\t\t\tdetermineInterest\n\t\tend\n\tend", "title": "" }, { "docid": "b4732108e204b788ec16e8bceed81b9e", "score": "0.5707047", "text": "def tracked_files; end", "title": "" }, { "docid": "0cd0a00cb8e093b2631a91d803a1394f", "score": "0.5706315", "text": "def add_file(path, trace); end", "title": "" }, { "docid": "06a2908bf75f3e78fe87ec1423b54b16", "score": "0.57057714", "text": "def watch(&block)\n path = File.expand_path(@path)\n @logger.info(\"Watching for changes to #{path}\")\n dir = File.dirname(path)\n fname = File.basename(path)\n Listen.to(dir, :filter => /#{Regexp.quote(fname)}/) do |modified, added, removed|\n begin\n @logger.info(\"Change to control file detected...\")\n inifile = IniFile.load(path)\n distributions = parse!(inifile)\n\n @watch_mutex.synchronize do\n @distributions = distributions\n end\n @logger.info(\"...rebuilt\")\n yield if block_given?\n rescue => e\n @logger.error(\"Error reloading changes: #{e}\")\n @logger.error(e)\n end\n end\n end", "title": "" }, { "docid": "a2917b7d38e9b50d049d75b4c326f18e", "score": "0.5700769", "text": "def _add_load_project_guard_rc_hook\n Pry.config.hooks.add_hook :when_started, :load_project_guard_rc do\n project_guard_rc = Dir.pwd + '/.guardrc'\n load project_guard_rc if File.exist?(project_guard_rc)\n end\n end", "title": "" }, { "docid": "1f01f651f81d606760e24d537dc1c964", "score": "0.5699896", "text": "def reload!\n changed_files = []\n\n @monitor_dirs.keys.each do |dir|\n check_monitor_dir(dir, changed_files)\n end\n\n removed_files = []\n delete_hooks = []\n\n @monitor_files.to_a.each do |file, (time, delete_hook)|\n if File.file?(file)\n if file_changed?(file, time)\n changed_files << file\n end\n else\n delete_hooks << [delete_hook, file] if delete_hook\n removed_files << file\n end\n end\n\n remove_files(removed_files)\n delete_hooks.each{|hook, file| hook.call(file)}\n\n return if changed_files.empty?\n\n unless @dependencies.empty?\n changed_files = Unreloader.expand_directory_paths(reload_files(changed_files))\n \n order = @dependency_order\n order &= changed_files\n changed_files = order + (changed_files - order)\n end\n\n unless @skip_reload.empty?\n changed_files -= Unreloader.expand_directory_paths(@skip_reload)\n end\n\n changed_files.select! do |file|\n @monitor_files.has_key?(file)\n end\n changed_files.each do |file|\n safe_load(file)\n end\n end", "title": "" }, { "docid": "f021d4b88875532cec362e3c7190acd9", "score": "0.56938267", "text": "def attach!\n # Bring the checker into local scope for the ruby block\n checker = file_update_checker\n\n reloader_class.to_prepare do\n checker.execute_if_updated\n end\n end", "title": "" }, { "docid": "70ffe4dcdd40ceae6d6ac78e73ccf7ab", "score": "0.5688443", "text": "def run_all\n run_on_modifications( Watcher.match_files(self, Dir.glob('**{,/*/**}/*.{tex,erb.tex,tex.erb}')) )\n end", "title": "" }, { "docid": "21afa2cf190d2ae3d24c048d58d8b8ab", "score": "0.56817436", "text": "def files_scheduled_for_add\n Dir[temp_plugin_name+\"/**/*\"].collect {|fn| fn.gsub(temp_plugin_name, '.')} -\n Dir[plugin.name+\"/**/*\"].collect{|fn| fn.gsub(plugin.name, '.')}\n end", "title": "" }, { "docid": "0915408e102c1933178d5983f8aba92b", "score": "0.56722647", "text": "def warn_if_adding(term:, files:)\n regexp = Regexp.new term\n files.each do |file|\n diff = git.diff_for_file(file)\n next unless diff\n\n added_lines = diff.patch.split(/\\n/).select { |line| line =~ /^\\+/ }\n warn \"Please think twice before adding #{term} to the project 😱 (#{file})\" if added_lines.any? { |line| line =~ regexp }\n end\nend", "title": "" }, { "docid": "b4151d7649aa3548451649a020555fe3", "score": "0.5667351", "text": "def addFile(srcFile)\n readFile(srcFile) ;\n scan() ;\n end", "title": "" }, { "docid": "c2d449ff01dd7beab882b94732fbfebc", "score": "0.56645393", "text": "def file(files)\n @files_included += [*files].map { |x| Wow::Package::FilePattern.new(x) }\n end", "title": "" }, { "docid": "65a7534b509d34a8cd084930da542c36", "score": "0.5658561", "text": "def run_on_additions(paths)\n run_on_modifications(paths)\n end", "title": "" }, { "docid": "57a1d1df242c1611a914c6a8e48e7feb", "score": "0.56553626", "text": "def watch\n raise 'Missing block - what should I do if a file changes?' unless block_given?\n\n if linux?\n @notifier.watch(@watched_files, :modify) do |file|\n yield file\n end\n elsif mac?\n dirs = @watched_files.map{|f| File.dirname(f)}\n\n @notifier.watch(dirs, file_events: true) do |files|\n files.each do |file|\n yield file if @watched_files.include?(file)\n end\n end\n end\n end", "title": "" }, { "docid": "f32ec5e24117efcc749505d830e79665", "score": "0.56466615", "text": "def _add_load_guard_rc_hook\n Pry.config.hooks.add_hook :when_started, :load_guard_rc do\n (self.class.options[:guard_rc] || GUARD_RC).tap do |p|\n load p if File.exist?(File.expand_path(p))\n end\n end\n end", "title": "" }, { "docid": "021b7a8c212eb28843da1be20f5bf7f6", "score": "0.564399", "text": "def scan_changed(&block) # :yields: file\n known_files.each do |known_file|\n new_mtime = mtime_for(known_file)\n if new_mtime != last_mtime[known_file]\n block.call(known_file)\n last_mtime[known_file]= new_mtime\n end\n end\n end", "title": "" }, { "docid": "d63c57a2737ae57bf78a6ac0e67baa8a", "score": "0.56406504", "text": "def files_to_run; end", "title": "" }, { "docid": "9d4d324a1cfc5da378d145f97ba57c73", "score": "0.56385094", "text": "def on_file_autoloaded(file); end", "title": "" }, { "docid": "e78526a18478f240ee59be1c36bfb246", "score": "0.5623691", "text": "def run_on_additions(paths)\n end", "title": "" }, { "docid": "e78526a18478f240ee59be1c36bfb246", "score": "0.5623691", "text": "def run_on_additions(paths)\n end", "title": "" }, { "docid": "e78526a18478f240ee59be1c36bfb246", "score": "0.5623691", "text": "def run_on_additions(paths)\n end", "title": "" }, { "docid": "3df0a1034aab6182fd40acfde412a24c", "score": "0.5623474", "text": "def watchable_files\n @@watchable_files ||= []\n end", "title": "" }, { "docid": "6bc279c8ba9ead16188eb0773f388409", "score": "0.56211996", "text": "def watch(watched_dirs)\n watched_dirs << @directory\n end", "title": "" }, { "docid": "fce9871885b113a440492a970cc4e73b", "score": "0.56136644", "text": "def monitor_local_open_files\n \n end", "title": "" }, { "docid": "c5409628f8e56113064caa4720c22c65", "score": "0.5610544", "text": "def file_loaded(filename)\n $loaded_files.push(filename.downcase) if not $loaded_files.include?(filename.downcase)\nend", "title": "" }, { "docid": "d2123ae8257db15ae178035a5aca888d", "score": "0.5608973", "text": "def added\n @files.select { |_k, f| f.type == 'A' }\n end", "title": "" }, { "docid": "5fef2c5c9c50ca862274bf6607b762e9", "score": "0.5601618", "text": "def add_file(file)\n @files << file\n @implicitly_defined = false\n end", "title": "" }, { "docid": "16b8c8a0e5323cbb2e55bf8caa249df1", "score": "0.55983317", "text": "def scan_sources(source_files)\n end", "title": "" }, { "docid": "1eb34ad8eceed9ee45bba0b5cd48fbd7", "score": "0.55977184", "text": "def run_on_change(files)\n run do\n run_on_guards do |guard|\n run_on_change_task(files, guard)\n end\n end\n end", "title": "" }, { "docid": "9f675bdab9c72ec476195154994a87ad", "score": "0.5591093", "text": "def run_on_changes(paths)\n paths.each do |path|\n file_changed(path)\n end\n end", "title": "" }, { "docid": "9f675bdab9c72ec476195154994a87ad", "score": "0.5591093", "text": "def run_on_changes(paths)\n paths.each do |path|\n file_changed(path)\n end\n end", "title": "" }, { "docid": "562c5692ba8fc600fb7428f49741cd01", "score": "0.55885893", "text": "def watched_file?(filename); end", "title": "" }, { "docid": "877b0b7c525be65a05c41ffac039cd7a", "score": "0.55749327", "text": "def initialize(options = {})\n super\n @options = options\n\n options[:sourcepath].each do |path|\n watchers << ::Guard::Watcher.new(%r{^#{ path }(.*\\.clj(s?))$})\n end\n puts \"Shin: initialized!\"\n end", "title": "" }, { "docid": "1bec2b429e0608cd2784c9d4434b80a6", "score": "0.5571671", "text": "def check!\n return unless @files\n @file_list = file_list( @files )\n new_signature = signature( @file_list )\n if @signature != new_signature\n # reload file list\n puts \"* Aerogel::Reloader reloading: #{@file_list}, group: #{@group}\"\n if @group\n # invoke :before group actions\n Aerogel::Reloader.reloaders.select{|r| r.group == @group && r.opts[:before] }.each do |r|\n r.action.call @file_list\n end\n end\n @action.call @file_list\n @signature = new_signature\n if @group\n # invoke :after group actions\n Aerogel::Reloader.reloaders.select{|r| r.group == @group && r.opts[:after] }.each do |r|\n r.action.call @file_list\n end\n end\n end\n end", "title": "" }, { "docid": "461c1c911993f26f869c5b1413de2071", "score": "0.5569996", "text": "def register_files(files)\n program_id.register_files(files)\n end", "title": "" }, { "docid": "d881c837ee688943654740cf6d2576c7", "score": "0.55667007", "text": "def watchers; end", "title": "" }, { "docid": "b06e9af25723502c42c543fe6d63a288", "score": "0.5561618", "text": "def run_on_change(paths)\n partials = paths.select { |f| ignored?(f) }\n return run_all unless partials.empty?\n\n changed_files = paths.reject{ |f| ignored?(f) }.map do |file|\n css_file = get_output(file)\n begin\n contents = build_sass(file)\n if contents\n if options[:noop]\n ::Guard::UI.info \"-> verified #{file}\", :reset => true\n ::Guard::Notifier.notify(\"verified #{file}\", :title => \"Guard::Sass\", :image => :success) if options[:notification] && !options[:hide_success]\n else\n File.open(css_file, 'w') {|f| f.write(contents) }\n ::Guard::UI.info \"-> rebuilt #{file}\", :reset => true\n ::Guard::Notifier.notify(\"rebuilt #{file}\", :title => \"Guard::Sass\", :image => :success) if options[:notification] && !options[:hide_success]\n end\n end\n css_file\n rescue ::Sass::SyntaxError => e\n ::Guard::UI.error \"Sass > #{e.sass_backtrace_str(file)}\"\n ::Guard::Notifier.notify((options[:noop] ? 'validation' : 'rebuild') + \" failed > #{e.sass_backtrace_str(file)}\", :title => \"Guard::Sass\", :image => :error) if options[:notification]\n nil\n end\n end.compact\n notify changed_files\n end", "title": "" }, { "docid": "494ab4588d21fbc5b734d150afa4fd57", "score": "0.55615956", "text": "def listen!\n Listen.to(@path, :relative_paths => true) do | modified, added, removed |\n\n # Add each reported file to the queue\n modified.each do | path |\n @queue << { :event => :modified, :path => path }\n end\n\n added.each do | path |\n @queue << { :event => :added, :path => path }\n end\n\n removed.each do | path |\n @queue << { :event => :removed, :path => path }\n end\n\n end\n end", "title": "" } ]
5af92868181187d56140b2bd8ab77f31
used to filter the generic GET responses based on a 'filter_str' containing a set of name/value pairs (where the names are fieldnames in the response to match against and the values are comparisonvalues that the values from those fieldnames must match for an object in the response to pass through the filter). The filtering done by this method supports a fairly complex syntax for the input 'filter_string' argument. In cases where the parsing fails or a comparison cannot be made, errors will be thrown. In all cases, attempts are made to make the error as selfexplanatory as possible
[ { "docid": "e571b75cefeeb0283656c95da5907fb4", "score": "0.63020056", "text": "def filter_hnl_response(response, filter_string)\n # if response is not an array or if all of the elements in the array are not hashes,\n # then throw an error\n raise ProjectHanlon::Error::Slice::InputError, \"Can only filter response arrays\" unless response.is_a?(Array) && response.select { |elem| elem.is_a?(Hash) }.size > 0\n raise ProjectHanlon::Error::Slice::InputError, \"Can only filter responses that are arrays of hash maps\" unless response.select { |elem| elem.is_a?(Hash) }.size == response.size\n # if the response is of the right type, then parse the filter_string\n # to construct a comparison hash\n comparison_hash = parse_filter_string(filter_string)\n # then, expand the response values to construct a corresponding array\n # of objects that we can test for matches to the comparison hash\n expanded_response = response.map { |response_elem|\n if response_elem.has_key?(\"@uri\")\n uri = URI.parse response_elem[\"@uri\"]\n http = Net::HTTP.new(uri.host, uri.port)\n request = Net::HTTP::Get.new(uri.request_uri)\n lcl_response = http.request(request)\n JSON.parse(lcl_response.body)[\"response\"]\n else\n # if get here, it's an error...should only be used for responses\n # that are a collection of objects (which will be a collection\n # of objects containing URIs that refer to specific instances\n # of the object in the input collection)\n raise ProjectHanlon::Error::Slice::InputError, \"Can only filter response arrays that contain URIs that reference response objects\"\n end\n }\n # determine which objects match based on the comparison hash constructed\n # from the filter_string (above)\n matching_indexes = response.each_index.select { |index|\n response_object_matches?(expanded_response[index], comparison_hash)\n }\n # and use the list of indexes that matched to filter the response array\n # to only include the elements that matched\n response.values_at(*matching_indexes)\n end", "title": "" } ]
[ { "docid": "599ddad93cf2c868d698a7e1179ac6d5", "score": "0.6626165", "text": "def parse_filter_string(filter_string)\n name_val_pairs = filter_string.split('+')\n comparison_hash = {}\n name_val_pairs.each { |name_val|\n comparison_pair = Hash[*name_val.split('=').flatten]\n comparison_hash.merge!(comparison_pair)\n }\n comparison_hash\n end", "title": "" }, { "docid": "416f7243d2f4d2f8a06ac6e7d28c6772", "score": "0.6533827", "text": "def parse!\n raise_invalid_filter_class unless valid_filter_class?\n\n filter_hash = ActiveSupport::HashWithIndifferentAccess.new\n if valid_filter_query?\n filter_param.keys.each do |k|\n if valid_filter_key?(k)\n # support notation ?filter[param]=value1,value2,value3&...\n requested = filter_param[k].split(',')\n allowed_values = allowed_filter_keys[k]\n raise_invalid_filter_value(k) unless FilterMatchers.matches?(allowed_values, requested)\n\n filter_hash[k] = requested\n else\n raise_invalid_filter_value(k)\n end\n end\n elsif filter_param.present?\n raise ArgumentError, 'filter'\n end\n filter_hash\n end", "title": "" }, { "docid": "8370bf1d0d7e9aa7148570dc45aaa2f3", "score": "0.586387", "text": "def filters?(str); end", "title": "" }, { "docid": "8370bf1d0d7e9aa7148570dc45aaa2f3", "score": "0.586387", "text": "def filters?(str); end", "title": "" }, { "docid": "86e98b280efe3780c7dada0f5d60e486", "score": "0.58550876", "text": "def parse_filter_string(string)\n hash = {}\n \n x = string.strip.split(/[\\s]+&&[\\s]+/i)\n t = x.map{|s| s.match(/^([a-zA-Z0-9_]+)[\\s]*(<>|<=>|<=|>=|<|>|=|!=)[\\s]*(.+)$/i).to_a}.compact\n\n t.each do |v|\n key, operator, value = v[1..3]\n value.tr!(\"'\", \"\")\n value.tr!('\"', \"\")\n\n if value.start_with?('[') && value.end_with?(']')\n value = value.tr('[]', '').split(',').map!{ |s| s.strip }\n end\n\n value = [value, ] unless value.is_a?(Array)\n value.map! do |s|\n if s.is_number?\n s.to_i\n elsif s.is_float?\n s.to_f\n else\n s\n end\n end\n\n hash.merge!({ key.to_sym => [operator, value] })\n end\n\n hash\n end", "title": "" }, { "docid": "a417f3f7df763b8e159bd985a69b0e3b", "score": "0.58244985", "text": "def parse_filter_params(model, options = {})\n\n options.reverse_merge({filter_chaining: \"OR\", filter_type: 'like'})\n filters_params = ActiveSupport::JSON.decode(params[:filter]) if params[:filter]\n compare_operator = options[:filter_type] == 'like' ? 'like' : '='\n filters_params ||= []\n condition_str = ''\n condition_values = []\n filters_params.each do |filter_params|\n condition_str += \"#{filter_params['property']} #{compare_operator} ? #{options[:filter_chaining]} \"\n filter_value = (compare_operator == 'like') ? \"%#{filter_params['value']}%\" : filter_params['value']\n condition_values << filter_value\n end\n condition_str.sub!(/ #{options[:filter_chaining]} $/,'')\n\n model.where(condition_str, *condition_values )\n end", "title": "" }, { "docid": "9199ba8f00c74ebb92a09adad3413c70", "score": "0.5793462", "text": "def filter_string(str)\n str.split(' ').reject do |v|\n @filters.any? { |filter| filter.call(v) }\n end\n end", "title": "" }, { "docid": "60c71c957dd1f91eaff682bd1558e0db", "score": "0.572733", "text": "def parse_filter(filter_argument = T.unsafe(nil), &filter_proc); end", "title": "" }, { "docid": "d0f4e495a7859f30b67df0981110679a", "score": "0.56872976", "text": "def validate_query_filters\n super\n\n or_filters.each_key do |field|\n if values_for(field)\n case type_for(field)\n when :integer\n add_filter_error(field, :invalid, true) if or_values_for(field).detect {|v| v.present? && !v.match(/\\A[+-]?\\d+(,[+-]?\\d+)*\\z/) }\n when :float\n add_filter_error(field, :invalid, true) if or_values_for(field).detect {|v| v.present? && !v.match(/\\A[+-]?\\d+(\\.\\d*)?\\z/) }\n when :date, :date_past\n case or_operator_for(field)\n when \"=\", \">=\", \"<=\", \"><\"\n add_filter_error(field, :invalid, true) if or_values_for(field).detect {|v|\n v.present? && (!v.match(/\\A\\d{4}-\\d{2}-\\d{2}(T\\d{2}((:)?\\d{2}){0,2}(Z|\\d{2}:?\\d{2})?)?\\z/) || parse_date(v).nil?)\n }\n when \">t-\", \"<t-\", \"t-\", \">t+\", \"<t+\", \"t+\", \"><t+\", \"><t-\"\n add_filter_error(field, :invalid, true) if or_values_for(field).detect {|v| v.present? && !v.match(/^\\d+$/) }\n end\n end\n end\n\n add_filter_error(field, :blank, true) unless\n # filter requires one or more values\n (or_values_for(field) and !or_values_for(field).first.blank?) or\n # filter doesn't require any value\n [\"o\", \"c\", \"!*\", \"*\", \"t\", \"ld\", \"w\", \"lw\", \"l2w\", \"m\", \"lm\", \"y\", \"*o\", \"!o\"].include? or_operator_for(field)\n end if or_filters && or_filters.respond_to?(:each_key)\n end", "title": "" }, { "docid": "0511030bf7e33de8007a14a13a49e683", "score": "0.5673731", "text": "def filter(val)\n raise \"filter requires a String.\" unless val.is_a? String\n @filter = val\n self\n end", "title": "" }, { "docid": "a12118df3c2ec2aec1cb71f0d0a61a01", "score": "0.5670261", "text": "def filters_must_be_formatted\n return unless filters\n\n begin\n formatted = JSON.parse(filters)\n formatted.each do |f|\n if !f.is_a?(Hash)\n errors.add(:filters, 'Incorrect format')\n elsif f['name'].blank?\n errors.add(:filters, 'No field defined')\n elsif f['values'].blank? && (f['to'].blank? || f['from'].blank?)\n errors.add(:filters, \"Column #{f['name']} has incorrect values\")\n end\n end\n rescue\n errors.add(:filters, 'Error parsing the filters')\n end\n end", "title": "" }, { "docid": "3c650a86ada019bc35ecfaf4689009cd", "score": "0.5581364", "text": "def filters_must_be_formatted\n if filters\n begin\n formatted = JSON.parse(filters)\n formatted.each do |f|\n unless f.is_a?(Hash)\n errors.add(:filters, 'Incorrect format')\n else\n if f['name'].blank?\n errors.add(:filters, 'No field defined')\n else\n if f['values'].blank? && (f['to'].blank? || f['from'].blank?)\n errors.add(:filters, \"Column #{f['name']} has incorrect values\")\n end\n end\n end\n end\n rescue\n errors.add(:filters, 'Error parsing the filters')\n end\n end\n end", "title": "" }, { "docid": "b58f7027ba17f732d195d8525f92d510", "score": "0.55765504", "text": "def filter(str)\n FILTERS.each do |f|\n str = f.filter(str)\n end\n str\n end", "title": "" }, { "docid": "c80e5c96aea447cdf7cc5d2f66b5d79a", "score": "0.5550098", "text": "def filter1(string)\n\nend", "title": "" }, { "docid": "af2f0f589d3df34492d5a3461ca8641e", "score": "0.55445904", "text": "def parse_filter(definition, primary, secondary = nil, extra = nil)\n\n if primary.is_a?(Hash)\n fail ClearlyQuery::FilterArgumentError.new(\"filter hash must have at least 1 entry, got '#{primary.size}'\", {hash: primary}) if primary.blank? || primary.size < 1\n fail ClearlyQuery::FilterArgumentError.new(\"extra must be null when processing a hash, got '#{extra}'\", {hash: primary}) unless extra.blank?\n\n conditions = []\n\n primary.each do |key, value|\n result = parse_filter(definition, key, value, secondary)\n if result.is_a?(Array)\n conditions.push(*result)\n else\n conditions.push(result)\n end\n end\n\n conditions\n\n elsif primary.is_a?(Symbol)\n\n case primary\n when :and, :or\n combiner = primary\n filter_hash = secondary\n result = parse_filter(definition, filter_hash)\n combine_all(combiner, result)\n when :not\n #combiner = primary\n filter_hash = secondary\n\n #fail CustomErrors::FilterArgumentError.new(\"'Not' must have a single combiner or field name, got #{filter_hash.size}\", {hash: filter_hash}) if filter_hash.size != 1\n\n result = parse_filter(definition, filter_hash)\n\n #fail CustomErrors::FilterArgumentError.new(\"'Not' must have a single filter, got #{hash.size}.\", {hash: filter_hash}) if result.size != 1\n\n if result.respond_to?(:map)\n negated_conditions = result.map { |c| compose_not(c) }\n else\n negated_conditions = [compose_not(result)]\n end\n negated_conditions\n\n when *definition.all_fields.dup.push(/\\./)\n field = primary\n field_conditions = secondary\n info = definition.parse_table_field(field)\n result = parse_filter(definition, field_conditions, info)\n\n build_subquery(definition, info, result)\n\n when *OPERATORS\n filter_name = primary\n filter_value = secondary\n info = extra\n\n table = info[:arel_table]\n column_name = info[:field_name]\n valid_fields = info[:filter_settings][:fields][:valid]\n\n custom_field = definition.build_custom_field(column_name)\n\n if custom_field.blank?\n condition(filter_name, table, column_name, valid_fields, filter_value)\n else\n condition_node(filter_name, custom_field, filter_value)\n end\n\n else\n fail ClearlyQuery::FilterArgumentError.new(\"unrecognised combiner or field name '#{primary}'\")\n end\n else\n fail ClearlyQuery::FilterArgumentError.new(\"unrecognised filter component '#{primary}'\")\n end\n end", "title": "" }, { "docid": "f7bb8f86498ca25d506e0b26b58fc9a8", "score": "0.551765", "text": "def filter2(string)\n\nend", "title": "" }, { "docid": "9d298cc55c2e9ed553154cee2609bf7c", "score": "0.544505", "text": "def data_filter(data, filters)\n if not data.is_a?(Array) or not filters.is_a?(String)\n return data\n end\n data = data.clone\n for filter in array_filter(filters.split(\",\"))\n key, value = array_filter(filter.split(\":\"))\n # find unspecified fields\n if value == nil\n data.select!{|d| d[key] == nil}\n # find fields that match regex\n elsif value.is_a?(String)\n data.select!{|d| d[key].to_s =~ /#{value}/m}\n end\n end\n return data\n end", "title": "" }, { "docid": "6f43f31509440e2850c947266a4de19a", "score": "0.540768", "text": "def ensure_filter_match!(key, passed_values, valid_values, message)\n if request.get?\n # For GET, it's not necessary to validate the values. Objects which don't exist\n # simply don't match the search.\n # For POST, we want to validate since the user's request to create push jobs\n # relating to nonexistent objects can't be satisfied.\n return\n end\n\n # It's valid to pass some non-string types (like integers) as a string\n valid_values = valid_values + valid_values.map(&:to_s)\n\n invalid_values = passed_values - valid_values\n return if invalid_values.empty?\n\n message += invalid_values.sort.join(', ').truncate(80)\n raise DetailedArgumentError.new(key => message)\n end", "title": "" }, { "docid": "ce521a18f4ad8946ed43d43cab1ff726", "score": "0.539587", "text": "def make_conditions(params, model)\n search_string = params[SEARCH_KEY]\n filter_string = params[FILTER_KEY]\n if search_string && filter_string\n error 400, convert(body_for(:invalid_params, [FILTER_KEY]))\n elsif search_string\n words = search_string.downcase.split(\" \")\n { :_keywords => { '$all' => words } }\n elsif filter_string\n begin\n unsafe = QS_FILTER.parse(filter_string)\n sanitize(unsafe, model)\n rescue QueryStringFilter::ParseError\n error 400, convert(body_for(:invalid_filter, filter_string))\n end\n else\n {}\n end\n end", "title": "" }, { "docid": "a3569467459724b8289daece4fecad50", "score": "0.53891647", "text": "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", "title": "" }, { "docid": "16840b02585a486956d61741bff019f6", "score": "0.535354", "text": "def filter_cards(filter_str)\n set_attributes_for(Card)\n Card.apply_filter(filter_str)\n end", "title": "" }, { "docid": "2a18283436c31ea7c219b817efb7ddfe", "score": "0.5337163", "text": "def valid_filter_modifiers(anytext, filter)\n # Weed out invalid filter requests\n puts \"checking valid_filter_modifiers: #{anytext}, filter: #{filter.inspect}\" if self.verbose_filters\n # We do not make_symring for two reasons:\n # 1. people will use whatever kind of filter value they need, and ruby can compare it.\n # 2. the filter param is an array\n # #filter = self.make_symring(filter)\n # Weed out invalid filter requests\n allowed = (self.search_filter_keys & filter)\n return false if !filter.empty? && allowed.empty?\n valid_filter_mods = self.get_filter_modifiers(anytext, allowed)\n valid_search_filters = valid_filter_mods.map do |fmod|\n puts \"filter mod #{fmod.inspect} => #{self.search_filters[:filter_modifiers_to_search_filters][fmod]}\" if self.verbose_filters\n self.search_filters[:filter_modifiers_to_search_filters][fmod]\n end.compact\n puts \"valid_filter_modifiers: #{valid_search_filters.inspect}\" if self.verbose_filters\n return valid_search_filters\n end", "title": "" }, { "docid": "3d5e6243450372b634285a10510221f6", "score": "0.53162485", "text": "def _filter r, options\n return r if params[:f].blank?\n return resource_class.filter r, params[:f], options if resource_class.respond_to? :filter\n r\n end", "title": "" }, { "docid": "6ca7fb1996a02b3275a199bf50843a94", "score": "0.5292581", "text": "def filter(filter)\n results = Config::ObjectList.new\n filter.each do |field, match_value|\n field = field.is_a?(Symbol) ? field.to_s : field\n match_value = match_value.is_a?(Symbol) ? match_value.to_s : match_value\n if match_value.is_a?(String) && match_value =~ /^!/\n operator = :not_equal\n match_value = match_value.sub(/^!/, '')\n else\n operator = :equal\n end\n each do |name, config|\n value = config[field]\n if value.is_a? Array\n if operator == :equal && value.include?(match_value)\n results[name] = config\n elsif operator == :not_equal && !value.include?(match_value)\n results[name] = config\n end\n else\n if operator == :equal && value == match_value\n results[name] = config\n elsif operator == :not_equal && value != match_value\n results[name] = config\n end\n end\n end\n end\n results\n end", "title": "" }, { "docid": "e495de4dbfd31bde9401b8cc491e3b18", "score": "0.5250567", "text": "def initialize(str, filters = FILTERS)\n @str, @filters = str.freeze, filters\n @actions = Parser.parse_template(str).freeze\n end", "title": "" }, { "docid": "dbeb89fb27c68dc00b47774c5cb74702", "score": "0.52496976", "text": "def filter(new_filters)\n new_filters = JSON.parse(new_filters) if new_filters.is_a?(String)\n if filters = query['_filter']\n filters = JSON.parse(filters)\n filters = [filters] unless filters.is_a?(Array)\n filters.push(new_filters)\n else\n filters = new_filters\n end\n query('_filter' => filters.to_json)\n end", "title": "" }, { "docid": "02e59fa60059baef2d7b5f2dbe9e8473", "score": "0.5244793", "text": "def validate_param_filters(v_properties, filters, test)\n filters.each do |filter|\n is_defined = false\n v_properties.each do |v_property|\n is_defined = v_property.key?(filter['name'])\n break if is_defined\n end\n\n if filter['is-not-defined']\n if is_defined\n success = false\n else\n success = true\n end\n # If there's no text-match, we can just check for existence\n elsif !filter['text-match'] || !is_defined\n success = is_defined\n else\n success = false\n v_properties.each do |v_property|\n # If we got all the way here, we'll need to validate the\n # text-match filter.\n success = Dav::StringUtil.text_match(v_property[filter['name']].value, filter['text-match']['value'], filter['text-match']['collation'], filter['text-match']['match-type'])\n break if success\n end\n\n success = !success if filter['text-match']['negate-condition']\n end\n\n # There are two conditions where we can already determine whether\n # or not this filter succeeds.\n return true if test == 'anyof' && success\n return false if test == 'allof' && !success\n end\n\n # If we got all the way here, it means we haven't been able to\n # determine early if the test failed or not.\n #\n # This implies for 'anyof' that the test failed, and for 'allof' that\n # we succeeded. Sounds weird, but makes sense.\n test == 'allof'\n end", "title": "" }, { "docid": "b01fe4be4a966a6123cfd2f27850efe6", "score": "0.52380466", "text": "def clean_filters\n cleaned_filters = {}\n self.filters.each do |name, value|\n if (self.filter_options[name.to_sym][:fields].detect{|f| f[:value] == value } rescue false)\n cleaned_filters[name.to_sym] = value\n end\n end\n self.filters = cleaned_filters\n end", "title": "" }, { "docid": "ffaf85ea5d6d196ae26b7e007acd0d5e", "score": "0.5227972", "text": "def validate_filter!(filters)\n filters.each_key do |key|\n # FIXME: real exception\n raise \"Bad key #{key} in Chef::NodeMap filter expression\" unless VALID_OPTS.include?(key)\n end\n end", "title": "" }, { "docid": "da477686dabbe2ac3762bff5a122b7c9", "score": "0.52222455", "text": "def filter( filter_name, value )\n defined? @filters \\\n or return nil\n @filters.respond_to? \"has_key?\" \\\n or return nil\n @filters.has_key? filter_name \\\n or return nil\n f = @filters[filter_name]\n f.call value\n end", "title": "" }, { "docid": "c284d88587c1db2285a1a0ec5385f9a6", "score": "0.52117854", "text": "def get_filter_string\n\t\treturn nil if @filters.size == 0\n\t\tfilters = []\n\n\t\t# Loop over each filtergroup\n\t\t# All conditions in a filtergroup are combined using AND\n\t\t# All filtergroups are combined using OR\n\t\t@filters.each_with_index do |filter, index|\n\t\t\tfields = []\n\n\t\t\t# Loop over all conditions in a filter group\n\t\t\tfilter.each do |condition|\n\t\t\t\tfield = condition[:field]\n\t\t\t\toperator = condition[:operator]\n\t\t\t\tvalue = condition[:value]\n\n\t\t\t\t# Some filters operate on strings and need wildcards\n\t\t\t\t# Transform value if needed\n\t\t\t\tcase operator\n\t\t\t\t\twhen FilterOperators::LIKE\n\t\t\t\t\t\tvalue = \"%#{value}%\"\n\t\t\t\t\twhen FilterOperators::STARTS_WITH\n\t\t\t\t\t\tvalue = \"#{value}%\"\n\t\t\t\t\twhen FilterOperators::NOT_LIKE\n\t\t\t\t\t\tvalue = \"%#{value}%\"\n\t\t\t\t\twhen FilterOperators::NOT_STARTS_WITH\n\t\t\t\t\t\tvalue = \"#{value}%\"\n\t\t\t\t\twhen FilterOperators::ENDS_WITH\n\t\t\t\t\t\tvalue = \"%#{value}\"\n\t\t\t\t\twhen FilterOperators::NOT_ENDS_WITH\n\t\t\t\t\t\tvalue = \"%#{value}\"\n\t\t\t\t\twhen FilterOperators::EMPTY\n\t\t\t\t\t\t# EMPTY and NOT_EMPTY operators require the filter to be in a different format\n\t\t\t\t\t\t# This because they take no value\n\t\t\t\t\t\tfields.push(\"<Field FieldId=\\\"#{field}\\\" OperatorType=\\\"#{operator}\\\" />\")\n\t\t\t\t\t\tnext\n\t\t\t\t\twhen FilterOperators::NOT_EMPTY\n\t\t\t\t\t\tfields.push(\"<Field FieldId=\\\"#{field}\\\" OperatorType=\\\"#{operator}\\\" />\")\n\t\t\t\t\t\tnext\n\t\t\t\tend\n\n\t\t\t\t# Add this filterstring to filters\n\t\t\t\tfields.push(\"<Field FieldId=\\\"#{field}\\\" OperatorType=\\\"#{operator}\\\">#{value}</Field>\")\n\t\t\tend\n\n\t\t\t# Make sure all filtergroups are OR'ed and add them\n\t\t\tfilters.push(\"<Filter FilterId=\\\"Filter #{index}\\\">#{fields.join}</Filter>\")\n\t\tend\n\n\t\t# Return the whole filterstring\n\t\treturn \"<Filters>#{filters.join}</Filters>\"\n\tend", "title": "" }, { "docid": "92125c3f9f9ec242aa3a0ea49be597e2", "score": "0.520375", "text": "def get_filter_conditions(filters, applied_filters)\n return {} if applied_filters.empty?\n filter_conditions = {}\n applied_filters.each do |applied_filter_key, applied_filter_values|\n applied_filter_details = array_item_by_key_value(filters, :name, applied_filter_key)\n case applied_filter_details[:es_type]\n when 'keyword'\n filter_conditions[applied_filter_details[:name]] = { terms: { applied_filter_details[:options][:field] => applied_filter_values } }\n when 'bool'\n filter_conditions[applied_filter_details[:name]] = { term: { applied_filter_details[:options][:field] => applied_filter_values } }\n when 'integer'\n if applied_filter_details[:options][:field].is_a? Array\n filter_conditions[applied_filter_details[:options][:field][0]] = { range: { applied_filter_details[:options][:field][0] => { gte: applied_filter_values[0] } } }\n filter_conditions[applied_filter_details[:options][:field][1]] = { range: { applied_filter_details[:options][:field][1] => { lte: applied_filter_values[1] } } }\n else\n filter_conditions[applied_filter_details[:name]] = { range: { applied_filter_details[:name] => { gte: applied_filter_values[0], lte: applied_filter_values[1] } } }\n end\n when 'datetime'\n min = Time.parse(\"#{Time.parse(applied_filter_values[0]).strftime('%Y/%m/%d %H:%M:%S')} #{\"UTC\"}\").utc.strftime('%Y%m%dT%H%M%S%z')\n max = Time.parse(\"#{Time.parse(applied_filter_values[1]).strftime('%Y/%m/%d %H:%M:%S')} #{\"UTC\"}\").utc.strftime('%Y%m%dT%H%M%S%z')\n filter_conditions[applied_filter_details[:name]] = { range: { applied_filter_details[:name] => { gte: min, lte: max } } }\n end\n end\n filter_conditions\n end", "title": "" }, { "docid": "a3de172426ac1b6f304395f562473f75", "score": "0.5198786", "text": "def set_filters(value)\n valid = []\n value.each do |filter|\n if (!filter['name'].blank? && !filter['to'].blank? && !filter['from'].blank?)\n valid << filter\n elsif (filter['name'] && filter['values'])\n # Hack to accept both an array of values or a JSON\n filter['values'] = if filter['values'].is_a? String\n JSON.parse(filter['values'])\n else\n filter['values']\n end\n valid << filter\n end\n end\n self.write_attribute :filters, valid.to_json\n end", "title": "" }, { "docid": "8a370cf7471de4926e7df13cc6d026cb", "score": "0.5197063", "text": "def validate_filter()\n filter_module = (RUBY_VERSION < '1.9') ? params[:filter] : params[:filter].to_sym\n if (params.key?(:filter) && @source::Filters::constants.include?(filter_module))\n @filter = \"#{@source.name}::Filters::#{params[:filter]}\".constantize\n else\n redirect_to root_path\n end\n end", "title": "" }, { "docid": "9425035f588c3bd5abe3390871b91ef6", "score": "0.5185074", "text": "def filter=(value)\n # nil and false disable the filter\n return @filter = false unless value # rubocop:disable Lint/ReturnInVoidContext\n\n @filter = value.to_s.downcase\n end", "title": "" }, { "docid": "85b4c8da89007e50410747fe9f3aa54e", "score": "0.5181552", "text": "def filter_string\n if params['gender']\n gender = \"gender = #{User.connection.quote(params['gender'])}\\n\"\n end\n\n if params['minAge']\n min = Integer(params['minAge'])\n min_age = \"age > #{User.connection.quote(min)}\\n\"\n end\n\n if params['maxAge']\n max = Integer(params['maxAge'])\n max_age = \"age < #{User.connection.quote(max)}\\n\"\n end\n\n return ['', gender, min_age, max_age].compact.join('AND ')\n rescue StandardError => e\n logger.warn(e)\n return ''\n end", "title": "" }, { "docid": "324d753efc0ea8154f1490c3b11b2aa6", "score": "0.51761824", "text": "def validate_string(value)\n raise CustomErrors::FilterArgumentError, 'Value must be a string' unless value.is_a?(String)\n end", "title": "" }, { "docid": "bdff18de721a71c866f75a6d7bfaec3a", "score": "0.51759523", "text": "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", "title": "" }, { "docid": "b3de028af7952ab3b8ea9806da056da4", "score": "0.5145926", "text": "def filter_proc(filters = {})\n lambda do |p|\n (filters[:name].nil? || p.name =~ filters[:name]) &&\n (filters[:appid_name].nil? || p.app_id_name =~ filters[:appid_name]) &&\n (filters[:appid].nil? || p.entitlements.app_id =~ filters[:appid]) &&\n (filters[:uuid].nil? || p.uuid =~ filters[:uuid]) &&\n (filters[:team].nil? || p.team_name =~ filters[:team] || p.team_ids.any? { |id| id =~ filters[:team] }) &&\n (filters[:exp].nil? || (p.expiration_date < DateTime.now) == filters[:exp]) &&\n (filters[:has_devices].nil? || !(p.provisioned_devices || []).empty? == filters[:has_devices]) &&\n (filters[:all_devices].nil? || p.provisions_all_devices == filters[:all_devices]) &&\n (filters[:aps_env].nil? || match_aps_env(p.entitlements.aps_environment, filters[:aps_env])) &&\n true\n end\n end", "title": "" }, { "docid": "8572e007ca6d79a4fe1850907c3f63bc", "score": "0.5132854", "text": "def validate_filter_settings(value)\n validate_hash(value)\n\n # Common filter settings\n\n validate_array(value[:valid_fields])\n validate_array_items(value[:valid_fields])\n\n validate_array(value[:render_fields])\n validate_array_items(value[:render_fields])\n\n validate_array(value[:text_fields]) if value.include?(:text_fields)\n validate_array_items(value[:text_fields]) if value.include?(:text_fields)\n\n unless value[:controller].is_a?(Symbol)\n raise CustomErrors::FilterArgumentError, 'Controller name must be a symbol.'\n end\n raise CustomErrors::FilterArgumentError, 'Action name must be a symbol.' unless value[:action].is_a?(Symbol)\n\n validate_hash(value[:defaults])\n\n unless value[:defaults][:order_by].is_a?(Symbol)\n raise CustomErrors::FilterArgumentError, 'Order by must be a symbol.'\n end\n unless value[:defaults][:direction].is_a?(Symbol)\n raise CustomErrors::FilterArgumentError, 'Direction must be a symbol.'\n end\n\n # advanced filter settings\n\n raise 'Filters using `field_mappings` are deprecated' if value.include?(:field_mappings)\n\n if value.include?(:capabilities)\n validate_hash(value[:capabilities])\n value[:capabilities].values do |capability|\n validate_hash(capability)\n validate_hash_key(capability, :can_list, [NilClass, Proc])\n validate_hash_key(capability, :can_item, [NilClass, Proc])\n validate_closure(capability[:can_list], [:klass]) if capability[:can_list]\n validate_closure(capability[:can_item], [:item]) if capability[:can_list]\n\n validate_hash_key(capability, :details, [Proc])\n validate_closure(capability[:details], [:can, item, klass]) if capability[:details]\n end\n end\n\n validate_closure(value[:custom_fields], [:item, :user]) if value.include?(:custom_fields)\n\n if value.include?(:custom_fields2)\n validate_hash(value[:custom_fields2])\n value[:custom_fields2].each_value do |custom_definition|\n validate_hash(custom_definition)\n validate_array(custom_definition[:query_attributes])\n\n if custom_definition[:query_attributes].length.positive?\n validate_closure(custom_definition[:transform], [:item])\n end\n\n validate_hash_key(custom_definition, :arel,\n [NilClass, Arel::Nodes::Node, Arel::Nodes::SqlLiteral, Arel::Attributes::Attribute])\n validate_hash_key(custom_definition, :type, [Symbol]) unless custom_definition[:arel].nil?\n end\n end\n\n validate_closure(value[:new_spec_fields], [:user]) if value.include?(:new_spec_fields)\n\n validate_hash_key(value, :base_association, ActiveRecord::Relation) if value.include?(:base_association)\n validate_hash_key(value, :base_association_key, Symbol) if value.include?(:base_association)\n validate_filter_associations(value[:valid_associations]) if value.include?(:valid_associations)\n end", "title": "" }, { "docid": "8b27d15f65671e825201213a0fa25ba7", "score": "0.5116596", "text": "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", "title": "" }, { "docid": "4647ce0a355aad990cd91cd047df1724", "score": "0.51052004", "text": "def filter (data)\n # leave the data untouched if we don't support the required filter\n return data if @filter.nil?\n\n # decode the data\n self.send(@filter, data)\n end", "title": "" }, { "docid": "3a7968af1ec6c6bc916d01c6f42eb49f", "score": "0.5103855", "text": "def apply_filters(entries, filters)\n filters.each{\n |filter|\n parts = filter.split(\"=\")\n \n # Determine if the filter is joined with a '=' or '!='\n last_char=parts[0][-1,1]\n if last_char == \"!\"\n test_equals = false\n key = parts[0][0, parts[0].length()-1]\n match = parts[1]\n else\n test_equals = true\n key = parts[0]\n match = parts[1]\n end\n \n entries.each{\n |e, entry|\n # Find the key value in entry, or nil if it doesn't exist\n value = find_entry_setting(entry, key)\n \n # Calculate if the returned value matches the filter value\n if value.is_a?(Array)\n is_equal = false\n value.each{\n |v|\n if is_value_match?(v, match)\n is_equal = true\n end\n }\n else\n is_equal = is_value_match?(value, match)\n end\n \n # Delete the entry if the result of the match check isn't what\n # the filter is looking for\n if is_equal != test_equals\n entries.delete(e)\n end\n }\n }\n \n return entries\n end", "title": "" }, { "docid": "859dfc995e054611d1a1a02befa0cfd1", "score": "0.50912505", "text": "def prepare_filters\n params = instance_values.symbolize_keys\n filters = clean_params(params)\n validate_filters(filters)\n end", "title": "" }, { "docid": "2235de21cbf5de86ea8651590a23aa0e", "score": "0.5088818", "text": "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", "title": "" }, { "docid": "e6deca2f99ffa222983cb311871c77e7", "score": "0.50791734", "text": "def set_filters\n @filters = ''\n @filters.concat(\"status:'Available'\")\n unless @manufacturer_or_publisher.blank?\n @filters.concat(\" AND (manufacturer:'#{@manufacturer_or_publisher}'\")\n @filters.concat(\" OR publisher:'#{@manufacturer_or_publisher}')\")\n end\n @filters.concat(\" AND category:'#{@category}'\") unless @category.blank?\n @filters.concat(\" AND seller_name:'#{@seller_name}'\") unless @seller_name.blank?\n end", "title": "" }, { "docid": "72c1d88af5e0588665d846a619640225", "score": "0.5053928", "text": "def filter_params\n params.fetch(:filter, {}).permit(:text, :type)\n end", "title": "" }, { "docid": "c91a3538bc335abfc43d51068e9daf21", "score": "0.50518954", "text": "def initialize(string_or_hash)\n if string_or_hash.class == String\n self.search_string = string_or_hash.strip\n self.operator = \"OR\"\n elsif string_or_hash.class == Hash\n self.terms = string_or_hash.keys.inject({}) {|hash,key| hash[key] = string_or_hash[key].strip; hash }\n self.operator = \"AND\"\n end\n end", "title": "" }, { "docid": "c6052292961f622110605a3e7c6bbb2e", "score": "0.504911", "text": "def process_filters(records,filter_params)\n return records unless filter_params\n filter_params.each do |field,filter_param|\n if filter_param.has_key?(\"value\")\n value = filter_param[\"value\"]\n next unless value.present?\n condition = filter_param[\"condition\"] || 'eq'\n case condition\n when \"eq\"\n value = true if value == 'true'\n value = [false, nil] if value == 'false'\n records = records.where(field.to_sym => value)\n when \"cont\"\n records = records.where(\"#{field} LIKE '%#{value}%'\")\n when \"ncont\"\n records = records.where(\"#{field} NOT LIKE '%#{value}%'\")\n when \"gt\"\n records = records.where(\"#{field} > ?\", value)\n when \"lt\"\n records = records.where(\"#{field} < ?\", value)\n end\n end\n end\n return records\n end", "title": "" }, { "docid": "6b60410073b48270ee0bdb1838706ea7", "score": "0.50437295", "text": "def parse_params(params)\n all_filters.each {|f| f.reset; f.active = false}\n data = params.symbolize_keys\n Array(data[:fields]).each do |name|\n filter = all_filters.find {|f| f.name == name}\n if filter\n filter.active = true\n operator = data[:operators][name].to_sym\n filter.operator = operator if filter.operators.include?(operator)\n filter.value = data[:values][name] unless operator == :blank\n end\n end\n validate\n end", "title": "" }, { "docid": "c24977057aa97e8a65a5db847be9cc24", "score": "0.503317", "text": "def filter\n params['filter_field'] || '*'\n end", "title": "" }, { "docid": "46eba9f0dde9dcafa23f377cbe006c5e", "score": "0.5023624", "text": "def validate_filter(filter)\r\n # Each field in the filter array must be a valid fieldname in the\r\n # table.\r\n filter.each { |f|\r\n raise 'Invalid field name: %s in filter!' % f unless \\\r\n @field_names.include?(f)\r\n }\r\n end", "title": "" }, { "docid": "3e4da6f5190b7c946fd70dfac510cb1d", "score": "0.50054735", "text": "def parse_filter_params(permitted:)\n # Symbolize the keys so the values can be used with keyword arguments in the filter scopes.\n filter_params = params[:filter].try(:permit, permitted).try(:to_h)\n end", "title": "" }, { "docid": "988ea438864c7af7c51671144bc0f283", "score": "0.49995258", "text": "def filter(field, operator, value, value2=nil)\n operator = operator.to_s.upcase\n raise ArgumentError, \"invalid operator\" unless Operators.include?(operator)\n \n chain { |x|\n filter = { 'field' => field, 'operator' => operator, 'value1' => value.to_s }\n filter['value2'] = value2.to_s if operator == 'BETWEEN'\n x.filters << filter\n }\n end", "title": "" }, { "docid": "69d0ce7fe679c92e3d59a4d8f0cd87cd", "score": "0.4958012", "text": "def filter\n @filter = params[:q]\n end", "title": "" }, { "docid": "0308e6781a8b340368034a78a85e8e17", "score": "0.49438375", "text": "def parse_filter_from_variable(variable_name, filter_name, **options)\n variable = instance_variable_get(\"@#{variable_name}\")\n @filters[filter_name] = variable if variable\n end", "title": "" }, { "docid": "d4e612c29112a00112515af3635604cc", "score": "0.49373847", "text": "def filter_string\n\t\treturn self.filter.to_s\n\tend", "title": "" }, { "docid": "eb36d24f72956b098866f2756644301b", "score": "0.49222738", "text": "def clean_filter(value)\n value = @filters[value] if value.is_a? Symbol\n ActiveRecord::Type::Boolean.new.cast(value)\n end", "title": "" }, { "docid": "c2342bae07ce05631724582e6a4d48d2", "score": "0.49174023", "text": "def filter_for(name)\r\n name = name.camelize + \"Filter\"\r\n f = nil\r\n \r\n # List queries place the modified_date_range directly in the filter\r\n if name == 'ModifiedDateRangeFilter'\r\n return filter if filter.respond_to_ole?('FromModifiedDate')\r\n end\r\n \r\n # Report Periods are more or less special circumstance\r\n if name =~ /^Report[Period|Date]/\r\n return @request.ORReportPeriod.ReportPeriod\r\n end\r\n \r\n # Try to get the filter directly\r\n if filter.respond_to_ole?(name)\r\n f = filter.send(name)\r\n end\r\n\r\n # Transaction Date Range Filters change name.\r\n if name == 'TxnDateRangeFilter' &&\r\n filter.respond_to_ole?('TransactionDateRangeFilter')\r\n f = filter.send(\"TransactionDateRangeFilter\").\r\n send(\"ORTransactionDateRangeFilter\").\r\n send(\"TxnDateRange\")\r\n end\r\n \r\n # Check if this is within an 'OR'\r\n if filter.respond_to_ole?(\"OR#{name}\")\r\n f = filter.send(\"OR#{name}\").send(name)\r\n elsif filter.respond_to_ole?(\"OR#{name.gsub(/Range/, '')}\")\r\n f = filter.send(\"OR#{name.gsub(/Range/, '')}\").send(name)\r\n end\r\n \r\n # DateRange OR's\r\n if filter.respond_to_ole?(\"ORDateRangeFilter\") && name =~ /DateRange/i\r\n f = filter.send(\"ORDateRangeFilter\").send(name)\r\n end\r\n\r\n # It might have a nested OR \r\n if f && f.respond_to_ole?(\"OR#{name}\")\r\n f = f.send(\"OR#{name}\")\r\n end\r\n \r\n # Ranges might have another step, with the 'Range' removed.\r\n if f && f.respond_to_ole?(name.gsub(/Range/, ''))\r\n f = f.send(name.gsub(/Range/, ''))\r\n end\r\n \r\n return f\r\n end", "title": "" }, { "docid": "b3523e7ae3e6c4c453c6918d38ecfb45", "score": "0.49172723", "text": "def get_filter_result params_hsh\n default_filter_result = {\n environment: ['chef_environment'],\n fqdn: ['fqdn'],\n ip: ['ipaddress'],\n run_list: ['run_list'],\n roles: ['roles'],\n platform: ['platform'],\n tags: ['tags'],\n }\n # always default name to name, it can still be overriden by specifying ?name=some,attr,path\n filter_result = {name: ['name']}\n # the only keys left in params_hsh should be for filter_result\n if params_hsh.empty?\n # if no GET params were given for filter_result to be generated, use the default\n filter_result = filter_result.merge default_filter_result\n else\n # if some GET params were given for filter_result, use them instead\n params_hsh.each do |k, v|\n if v.nil?\n # attribute path not specified, assume key is attribute path\n filter_result[k] = [k]\n else\n # attribute path specified\n filter_result[k] = v.split(',')\n end\n end\n end\n filter_result\n end", "title": "" }, { "docid": "67f3341d1bd434aaab0ea43affaba40d", "score": "0.49162933", "text": "def filters=(value)\n valid = []\n value.each do |filter|\n if !filter['name'].blank? && !filter['to'].blank? && !filter['from'].blank?\n valid << filter\n elsif filter['name'] && filter['values']\n # Hack to accept both an array of values or a JSON\n filter['values'] = if filter['values'].is_a? String\n JSON.parse(filter['values'])\n else\n filter['values']\n end\n valid << filter\n end\n end\n write_attribute :filters, valid.to_json\n end", "title": "" }, { "docid": "4e6a938aafa6c7582b1367a74e6acd56", "score": "0.49096665", "text": "def add_filters(filters); end", "title": "" }, { "docid": "7977630b9e7954d8d8dbf857e0fe3456", "score": "0.48960552", "text": "def stradivari_filter(stradivari_filter_options)\n raise NotImplementedError\n end", "title": "" }, { "docid": "f83da7a37c2c6c65e6e2268ff667266c", "score": "0.48898193", "text": "def filter(id:, **args)\n params = parameters(args) do\n optional_params\n end\n request(:get, \"filters/#{id}\", params)\n end", "title": "" }, { "docid": "f40360f64e09bcbd950a31f804aa4d5c", "score": "0.48865888", "text": "def filter *filters\n spawn :@filters, @filters + parse_filter_input(filters)\n end", "title": "" }, { "docid": "fe4623f919d35ae39c3c20f84225fbe6", "score": "0.48804113", "text": "def parse_query_string(query_string)\n ::Rack::Utils.parse_nested_query(query_string)\n end", "title": "" }, { "docid": "3aaa2b7271ce9b5f9aad2223f096df04", "score": "0.48715794", "text": "def apply_filter(data, filter_model)\n filter_type = filter_model.filter_type\n variable_name = filter_model.variable_name;\n value1 = filter_model.value1\n value2 = filter_model.value2\n\n case filter_type\n when 'equals'\n filter_hash = Hash.new\n filter_hash[variable_name] = value1\n data = data.where(filter_hash)\n\n when 'not_equals'\n filter_hash = Hash.new\n filter_hash[variable_name] = value1\n data = data.where.not(filter_hash)\n\n when 'greater_than'\n data = data.where(\"#{variable_name} > ?\", value1)\n\n when 'greater_than_or_equal'\n data = data.where(\"#{variable_name} >= ?\", value1)\n\n when 'less_than'\n data = data.where(\"#{variable_name} < ?\", value1)\n\n when 'less_than_or_equal'\n data = data.where(\"#{variable_name} <= ?\", value1)\n\n when 'from_to'\n data = data.where(\"#{variable_name} >= ? AND #{variable_name} <= ?\", value1, value2)\n\n else\n data\n end\n end", "title": "" }, { "docid": "12098328e050de9abd3fea66878bd501", "score": "0.48519623", "text": "def filter_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: FilterApi.filter_list ...'\n end\n # resource path\n local_var_path = '/filters'\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/vnd.feedpushr.filter.v1+json; type=collection'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<Filter>' \n\n # auth_names\n auth_names = opts[:auth_names] || []\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: FilterApi#filter_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "d1c8fa481e93cdb74f211a0a1fcfd99b", "score": "0.48486188", "text": "def filter_params( *allowed )\n\n # grab params\n filtered = params.permit( allowed ).to_h.symbolize_keys.select{ |k,v| v.match( FILTERS[ BASE_PARAMS[ k ]]) }\n\n # do any necessary parsing\n filtered.update( filtered ) do |k,v|\n\n v = Date.parse( v ).at_midnight.utc if BASE_PARAMS[ k ] == :date\n\n v\n\n end\n\n end", "title": "" }, { "docid": "eca5004a136e81313640b6f9d656536f", "score": "0.48434803", "text": "def filter(params)\n unless @xml_data\n return 'ERR: filter method only works with xml-based output!'\n\n end\n\n result = Array.new\n begin\n if @xml_data\n\n if params[:given]\n found = @xml_data.xpath(\"//#{params[:given][:entity]}[contains(text(), #{params[:given][:value].inspect})]\")\n if found.size > 0\n @xml_data.xpath(\"//#{params[:entity]}[contains(text(), #{params[:value].inspect})]\").each do |node|\n result << create_response_item(node)\n end\n end\n else # no conditional\n @xml_data.xpath(\"//#{params[:entity]}[contains(text(), #{params[:value].inspect})]\").each do |node|\n result << create_response_item(node)\n end\n end\n\n return result\n else # no xml data\n return 'ERR: no valid xml data!'\n\n end #if\n\n rescue Exception=>e\n return \"ERR: #filter: #{e}\"\n\n end\n\n return result\n\n end", "title": "" }, { "docid": "62637ee845941ec574dde9a0b8347fce", "score": "0.4841113", "text": "def filter_params\n @filter_params_cache ||= clean_hash(params[:filter]).with_indifferent_access\n end", "title": "" }, { "docid": "120ec84e8b1f5811f008b9827a273db2", "score": "0.483999", "text": "def filters?(str)\n @filters.any? { |filter| str =~ filter }\n end", "title": "" }, { "docid": "f3d3c1252a8c8972ab2d0d5ea8edfd10", "score": "0.48363668", "text": "def option_filter_value option\n option = \"#{option}_filter\"\n params[option].present? && params[option] != 'All' && params[option]\n end", "title": "" }, { "docid": "f224958ed5b92d9cac35552c290b5c53", "score": "0.4834845", "text": "def validate_filter\n ensure_filter_only_attributes\n ensure_no_unsupported_filters\n end", "title": "" }, { "docid": "f043657d5c19601b09b955f4a0216dd5", "score": "0.48227572", "text": "def parse_response(response_string)\n\n if (response_string.include? \"ERROR~\")\n return parse_errors(response_string)\n end\n\n pairs = response_string.split(@field_delim)\n pairs.each do |p|\n k,v = p.split(@value_delim)\n if @values.has_key?(k)\n @values[k] = [@values[k]] unless @values[k].is_a?(Array)\n @values[k] << v\n else\n @values[k] = v\n end\n end\n end", "title": "" }, { "docid": "c8f841a2a8de9d01d38ceecd5d9469c7", "score": "0.4812183", "text": "def Filter=(arg0)", "title": "" }, { "docid": "ec4bf242acda2140ae7b9340724797a6", "score": "0.4809102", "text": "def filter_options\n\t\t[\n\t\t\t['short_name', 'LENGTH(name) < 4', 'Short Name'],\n\t\t\t['medium_name', ['LENGTH(name) >= ? AND LENGTH(name) <= ?', 5, 10], 'Medium Name'],\n\t\t\t['long_name', lambda { |tag| tag.name.length > 10 }, 'Long Name']\n\t\t]\n\tend", "title": "" }, { "docid": "f16cffa42e86c87d4c74311536818a6b", "score": "0.4798704", "text": "def make_inexact_filters(filters, fields=nil)\n fields ||= filters.keys\n\n inexact_filters = filters.to_hash.each_with_object([[], []]) do |kv_pair, inexact_filters|\n k, v = kv_pair\n\n if fields.include? k.to_sym\n inexact_filters[0] << \"#{k} like ?\"\n inexact_filters[1] << \"%#{v}%\"\n else\n inexact_filters[0] << \"#{k} = ?\"\n inexact_filters[1] << v\n end\n end\n\n [inexact_filters[0].join(' AND ')] + inexact_filters[1]\n end", "title": "" }, { "docid": "46c24c2be4ceca522d8026bb12bc7d33", "score": "0.47906068", "text": "def named_filter; end", "title": "" }, { "docid": "a43aebd2b0038ebae339bdca63ed1af8", "score": "0.4788563", "text": "def set_filter(opts)\n opts = check_params(opts,[:filters])\n super(opts)\n end", "title": "" }, { "docid": "d5fe70252919be874a8f6aac44d5f222", "score": "0.47872493", "text": "def filter_specs_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: FilterApi.filter_specs ...'\n end\n # resource path\n local_var_path = '/filters/_specs'\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/vnd.feedpushr.filter-spec.v1+json; type=collection'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<FilterSpec>' \n\n # auth_names\n auth_names = opts[:auth_names] || []\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: FilterApi#filter_specs\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "69dfbd701a3f6c10c716f404e462beae", "score": "0.47799972", "text": "def filter(text, *filters)\n filters.inject(text) do |text,method_name|\n send(method_name, text)\n end\n rescue => boom\n \"<p><strong>Boom!</strong></p><pre>#{escape_html(boom.to_s)}</pre>\"\n end", "title": "" }, { "docid": "69dfbd701a3f6c10c716f404e462beae", "score": "0.47799972", "text": "def filter(text, *filters)\n filters.inject(text) do |text,method_name|\n send(method_name, text)\n end\n rescue => boom\n \"<p><strong>Boom!</strong></p><pre>#{escape_html(boom.to_s)}</pre>\"\n end", "title": "" }, { "docid": "4c3ddb20c503da95e018034f370c3705", "score": "0.4774892", "text": "def filter_get_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: FilterApi.filter_get ...'\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling FilterApi.filter_get\"\n end\n # resource path\n local_var_path = '/filters/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/vnd.feedpushr.filter.v1+json', 'application/vnd.goa.error'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Filter' \n\n # auth_names\n auth_names = opts[:auth_names] || []\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: FilterApi#filter_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "230cae08cb90a5d43a6cd140637cc2fa", "score": "0.4770159", "text": "def FilterExpr(path, parsed); end", "title": "" }, { "docid": "37c4f6bb9de2e99ce545a4a256f74575", "score": "0.47625816", "text": "def filter(filter)\n @filters << CGI.escape(filter)\n self\n end", "title": "" }, { "docid": "a36b81a9ee4fb43fcb5f0eb38cd74481", "score": "0.4762032", "text": "def filter_params\n @_filter_params ||=\n case params[:filter]\n when Hash, ActionController::Parameters\n default_filters.each_with_object({}) do |field, hash|\n unformatted_field = @request.unformat_key(field)\n hash[unformatted_field] = params[:filter][field]\n end\n end\n end", "title": "" }, { "docid": "6742181435fbd0dc8305ee2093c8e4e9", "score": "0.4755289", "text": "def filter_in(str)\n return \"\" if str.nil? || str.empty?\n log.debug(\"(#{@pstack.conn.object_id}) INPUT #{str.inspect}\" )\n str\n end", "title": "" }, { "docid": "70772be22f833d0e60c481a1a612c567", "score": "0.47531515", "text": "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", "title": "" }, { "docid": "58bac35321c9a9b676ddcba7c1a5f9a6", "score": "0.47529107", "text": "def filter(filter = nil)\n case filter\n when nil\n to_a\n when /^eni-/, /^eth[0-9]+$/, /^[0-9a-f:]+$/i, /^[0-9\\.]+$/\n [*self[filter]]\n when /^subnet-/\n select { |dev| dev.subnet_id == filter }\n end.tap do |devs|\n raise Errors::UnknownInterface, \"No interface found matching #{filter}\" if devs.nil? || devs.empty?\n end\n end", "title": "" }, { "docid": "ccbc7f6e1cb22abc15f89e3cc785a059", "score": "0.47446963", "text": "def parse( string )\n data = {}\n\n pairs = string.split('&')\n pairs.each do |kv|\n key, values = kv.split('=')\n data[key.to_sym] = values.nil? ? nil : values.split('|')\n end\n\n data\n end", "title": "" }, { "docid": "8064fc488249061547b954c39b4d14f8", "score": "0.47439718", "text": "def parse_named_params(filter = /:|\\=/, downcase: false)\n grep(filter).parse_to_hash(filter, downcase: downcase)\n end", "title": "" }, { "docid": "2497addd35306a90225ab1432d56a8c4", "score": "0.47418764", "text": "def __parseStringToHash__(string_to_parse)\n errorMessage = \"string format is not correct\\n The expected format should be:\\n <key1>:<value1>,<key2>:<value2>\\n e.g. foo1:bar1,foo2:bar2\\n\"\n parameters = Hash.new\n string_to_parse.split(',').each do |pair|\n if pair == '' or pair.nil?\n fail(ArgumentError.new(\"'#{string_to_parse}' \" + errorMessage))\n end\n pairs = pair.split(':')\n if pairs[0].nil? or pairs[1].nil? or pairs[0] == '' or pairs[1] == ''\n fail(ArgumentError.new(\"'#{string_to_parse}' \" + errorMessage))\n end\n parameters[pairs[0]] = pairs[1].include?('{') ? __parseStringToHash__(pairs[1]) : pairs[1]\n end\n return parameters\n end", "title": "" }, { "docid": "049eba1d7256c4687bb35f903a478f83", "score": "0.47301623", "text": "def list_filters\n {\n track_end_date: 'TrkEndDate gt VALUE',\n track_first_submitted: 'TrkFirstSubmitted gt VALUE',\n app_no: 'AppNo eq VALUE',\n first_name: 'AppFirstName eq VALUE',\n last_name: 'AppLastName eq VALUE',\n email: 'AppEmailAddress eq VALUE'\n }\n end", "title": "" }, { "docid": "0d171eabc583e6639474024dd1845545", "score": "0.47275814", "text": "def initialize(filter_type, &block)\n if FILTER_TYPES.include?(filter_type)\n @filter_type = filter_type\n else\n raise ArgumentError, \"invalid type #{filter_type}, allowed: #{FILTER_TYPES.join(', ')}\"\n end\n @block = block\n end", "title": "" }, { "docid": "bd618d73fb0faaccd2145f6b0907c448", "score": "0.47210363", "text": "def filter_resource(resource, conditions)\n #puts \"condi\"\n #p conditions\n # no conditation => no filter\n if conditions.size == 0\n true\n else\n conditions.all? do |tuple|\n operator, property, bind_value = *tuple\n \n value = property.get!(resource)\n case operator\n when :eql, :in then equality_comparison(bind_value, value)\n when :not then !equality_comparison(bind_value, value)\n when :like then Regexp.new(bind_value.gsub(/%/, \".*\")) =~ value\n when :gt then !value.nil? && value > bind_value\n when :gte then !value.nil? && value >= bind_value\n when :lt then !value.nil? && value < bind_value\n when :lte then !value.nil? && value <= bind_value\n else raise \"Invalid query operator: #{operator.inspect}\"\n end\n end\n end\n end", "title": "" }, { "docid": "6468a963bd8f888689d28c9f2782790e", "score": "0.47175202", "text": "def simple_filter_triplet?\n if filter = (self[:search_pattern] || {})[':filter'.to_sym]\n if self[:type] == 'component' && filter.size == 3\n logical_rel_string = filter[0]\n field_string = filter[1]\n if SimpleFilterRelationsToS.include?(logical_rel_string) && field_string =~ /^:/\n [logical_rel_string.gsub(/^:/, '').to_sym, field_string.gsub(/^:/, '').to_sym, filter[2]]\n end\n end\n end\n end", "title": "" }, { "docid": "f89c6be3348b8e7a25a49eaf036f5373", "score": "0.47169304", "text": "def by_tags(**filter)\n filter = filter.to_a\n reject { |error| (filter - error.to_h.to_a).any? }\n end", "title": "" }, { "docid": "2618e3618f93d010ed9e307da0f7b56e", "score": "0.4697998", "text": "def strict_filters; end", "title": "" }, { "docid": "8a159254d6c4fc9f896298707bef87fa", "score": "0.4695095", "text": "def filter\n @filter_params.each do |key, val|\n # Strip empty values from the array if the given value is an array.\n val.select!{ |val| !val.to_s.empty? } if val.is_a?(Array)\n\n # Convert key if it starts with a column name.\n key = key.slice(@model_method_name.length + 1, key.length) if key.start_with?(\"#{@model_method_name}_\")\n\n if @force_filter_for && @force_filter_for.include?(key)\n ret = @args[:filter].call(:key => key, :val => val, :query => @query)\n @query = ret if ret\n elsif @model.column_names.include?(key)\n if val.is_a?(Array) && val.empty?\n # Ignore.\n else\n @query = @query.where(key => val)\n end\n elsif match = key.to_s.match(/^(.+)_like$/) and @model.column_names.include?(match[1])\n next if val.blank?\n table = @model.arel_table\n \n val.to_s.strip.split(/\\s+/).each do |str|\n @query = @query.where(table[match[1].to_sym].matches(\"%#{escape(str)}%\"))\n end\n elsif @args[:filter]\n ret = @args[:filter].call(:key => key, :val => val, :query => @query)\n @query = ret if ret\n else\n raise \"Dont know what to do regarding filter with key: '#{key}'.\"\n end\n end\n end", "title": "" } ]
bba5066d0a2819796ec2fa4b307b81ae
Methods return_value finds record for given id, then returns value associated with key
[ { "docid": "3b39c26a764429fbe7583d9027ac2bb1", "score": "0.7259998", "text": "def return_value(db, table, id, key)\r\n\tvalue_array = db.execute(\"SELECT #{key} FROM #{table} WHERE id=#{id}\")\r\n\r\n\t# If not defined, return nil\r\n\tif value_array.empty?\r\n\t\treturn nil\r\n\tend\r\n\tif value_array.length > 1\r\n\t\tputs \"ERROR! Multiple matches for id #{id}!\"\r\n\t\treturn nil\r\n\tend\r\n\t# If id is found, return value associated with key\r\n\treturn value_array[0][key]\r\nend", "title": "" } ]
[ { "docid": "8f6aa8ff35874065f4aecef7e4fa9474", "score": "0.67510444", "text": "def fetch_value( oid, key )\n\t\toid = normalize_oid( oid )\n\t\tkey = normalize_key( key )\n\t\tdata = @storage[ oid ] or return nil\n\n\t\treturn data[ key ]\n\tend", "title": "" }, { "docid": "f22563706184fc4952d2bb08a30e3b7f", "score": "0.6747214", "text": "def get_value(attribute_id)\n get_custom_value_hash\n return @custom_value_hash[attribute_id]\n end", "title": "" }, { "docid": "ea09fc6ae04c051265c3167747e58681", "score": "0.6534507", "text": "def find(id)\n @candidates.each do | candidate |\n if candidate[:id] == id\n return candidate \n end\n end\nend", "title": "" }, { "docid": "e26c878d05d451cf7a226c34405f4764", "score": "0.6529493", "text": "def find(id)\n @candidates.each do |candidate|\n if id == candidate[:id] \n return candidate\n end\nend\n\n nil\nend", "title": "" }, { "docid": "572cbcf039a8a5931bbffc233292d2fd", "score": "0.65213436", "text": "def find(id)\n # Your code Here\n @candidates.each do |candidate|\n \tif candidate[:id] == id\n \t return candidate\n \tend\n end\n return nil\nend", "title": "" }, { "docid": "8fc7685af004e090682d44707a2b8755", "score": "0.65180504", "text": "def find(id)\n # Your code Here\n @candidates.each do |candidate|\n if candidate[:id] == id\n return candidate\n end\n end\n nil\nend", "title": "" }, { "docid": "b24eca8b556cf4004f5eb935e8b8f5d4", "score": "0.64894843", "text": "def find(id)\n # Your code Here\n # puts \"you are looking for id: #{id}\"\n @candidates.each do |candidate|\n if candidate[:id] == id\n return candidate\n end\n end\n return nil\nend", "title": "" }, { "docid": "e1719d7a5aadbc7640fbaac873c15015", "score": "0.6457045", "text": "def find(id)\n @candidates.each do |item|\n if item[:id]==id\n @result = item\n end\n end\n @result\nend", "title": "" }, { "docid": "88412679fe2e9f395a016f3c87e18d26", "score": "0.64556074", "text": "def find(id)\n # Your code Here\n @candidates.each do |candidate|\n if id == candidate[:id]\n return candidate\n end\n end\n\n nil\nend", "title": "" }, { "docid": "ecb26b59223fd4151689af0795ccc7c5", "score": "0.643958", "text": "def find(id)\n # takes single candidate as id :\n @candidates.each do | candidate |\n if candidate[:id] == id \n\n return candidate\n else \n nil\n end\n end\nend", "title": "" }, { "docid": "5dd14ad14732f8dab9e2c6b72455d9e1", "score": "0.63948125", "text": "def get_result(key)\n r = results\n if r != nil\n return r.fetch(key, nil)\n end\n nil\n end", "title": "" }, { "docid": "158ecbf8c847ddbdc91acd190430aa8b", "score": "0.63882166", "text": "def fetch_value(value); end", "title": "" }, { "docid": "03f85886e85437b7f2cae8d975da7d75", "score": "0.63736475", "text": "def find(id)\n @candidates.each do |candidate|\n if candidate[:id] == id\n return candidate\n else\n return nil\n end\n end\nend", "title": "" }, { "docid": "64ca3fd10adc83fc0fd94e213457c46d", "score": "0.63536793", "text": "def find_value(calling_node, key)\n @router.touch(calling_node)\n value = @values[key.to_bin]\n return value unless value.nil?\n return find_node(key)\n end", "title": "" }, { "docid": "c026959daae7e562f6cb236c38854848", "score": "0.6349415", "text": "def find(id)\n @data[id]\n end", "title": "" }, { "docid": "4ce9f518ae4bbb784af527e4b86a722a", "score": "0.6342772", "text": "def fetch_value(key)\n val = fetch_nested(key)\n return val if self[:no_pruning].include?(key)\n Prunable::VALUES.include?(val) ? Prunable::Value : val\n end", "title": "" }, { "docid": "814b4c57b8b002eea3a8f75796610acb", "score": "0.6342421", "text": "def find(id)\n @candidates.each do |candidate|\n return candidate if candidate[:id] == id\n end\n return nil\nend", "title": "" }, { "docid": "cca5abbde53dcb882714d98f5b042c40", "score": "0.633836", "text": "def find(id)\n puts id\n @candidates.each do |candidate|\n if candidate[:id] == id \n return candidate\n end\n end\n puts \"No candidate found with that ID\"\n return nil\nend", "title": "" }, { "docid": "3ad88f39a0f0159df7a2f792a1e84186", "score": "0.6313878", "text": "def find(id)\n # Your code Here\n @candidates.each do |el|\n # logic to check if id match else null\n if el[:id] == id\n puts 'found match'\n return el\n end\n end\n return nil\nend", "title": "" }, { "docid": "75316499460bff7b9a6b8fb01b0f8c09", "score": "0.63070434", "text": "def find(key)\n # TODO(himanshujaju) - possible improvement by not checking for contains.\n if contains?(key)\n return @key_data[key].value\n end\n\n return nil\n end", "title": "" }, { "docid": "cafc6b250edf392c6bb8047426c9ca13", "score": "0.63054115", "text": "def fetch(key)\n result.fetch(key)\n end", "title": "" }, { "docid": "075c145db3227b23d1655585c599532e", "score": "0.6304138", "text": "def find_value hash\n @values_mapping[hash]\n end", "title": "" }, { "docid": "d5bd9035871353f211d59f516740aea4", "score": "0.62961364", "text": "def find(id)\n @candidates.each do |candidate|\n return candidate if candidate[:id]==id\n end\n nil\nend", "title": "" }, { "docid": "8cb26bf384aae33e7f6a23313b336f60", "score": "0.6279684", "text": "def find(value)\n key = \\\n if value.to_s =~ /^[0-9\\.]*$/\n default_search_param + \"id\"\n else\n default_search_param\n end\n\n where(key => value).first\n end", "title": "" }, { "docid": "47bff45f2e209a852b79febf18335eb3", "score": "0.62786067", "text": "def fetch(id)\n result = hkp_client.get \"/pks/lookup?options=mr&op=get&search=0x#{URI.escape id}\"\n return clean_key(result) if result\n\n rescue Exception\n raise $! if raise_errors?\n nil\n end", "title": "" }, { "docid": "e3db5ef24cde7c4462f4f239efbc6442", "score": "0.62688863", "text": "def [](key)\n key = key.to_s unless key.is_a? String\n puts \"SEARCHING for key '#{key}' in doc '#{@id}'\"\n cursor = @collection.find_one( { plgid: @id } )\n if cursor\n return cursor[key]\n end\n nil\n end", "title": "" }, { "docid": "a077b7efa346410f099b885b2206135a", "score": "0.62343377", "text": "def find_by_value(value)\n by_value[value]\n end", "title": "" }, { "docid": "a077b7efa346410f099b885b2206135a", "score": "0.62343377", "text": "def find_by_value(value)\n by_value[value]\n end", "title": "" }, { "docid": "84d7dd778ff4cabd6b4c31ab88b44fbd", "score": "0.62103367", "text": "def find(id)\n @candidates.each do |candidate|\n return candidate if id == candidate[:id]\n end\n nil\nend", "title": "" }, { "docid": "b9064933bd14cff4658245d440ee2808", "score": "0.6195892", "text": "def find_value(value) \n find { |item| item.data == value }\n end", "title": "" }, { "docid": "9b20087d7b76fee4cae09329efefe987", "score": "0.6169341", "text": "def result(hash, key)\n hash[key]\nend", "title": "" }, { "docid": "3e32c61ade5c5d84a6542ccdc5ed6481", "score": "0.61567396", "text": "def get_value (key)\r\n @redis.get key\r\n end", "title": "" }, { "docid": "6915e1b9a6690cf2814e70398b2377bb", "score": "0.61502886", "text": "def find(id)\n find_result\n end", "title": "" }, { "docid": "be840408d39d790a3e3702f2859a3da4", "score": "0.61381245", "text": "def find_record(table, id)\n result = DB[table].where(id: id).first\n result ? Hashie::Mash.new(result) : nil\nend", "title": "" }, { "docid": "310dd97b4838d3ed92f2e8c71920b1e9", "score": "0.61299276", "text": "def find_by_id(input, value)\n hash = nil\n input.each do |input|\n if input[:id] == value\n hash = input\n end\n end\n hash\nend", "title": "" }, { "docid": "bd192c2f8b5d7e18627dcc5ffa0c4be2", "score": "0.61265504", "text": "def get_value(name)\n collection.find_one(get_search_query)[\"#{name}\"]\n end", "title": "" }, { "docid": "a62536c5d6a99f9306058db719f38019", "score": "0.61258715", "text": "def result(uuid)\n @result[uuid]\n end", "title": "" }, { "docid": "83b71de8ba04d476a97f11cf0791fd2a", "score": "0.61249864", "text": "def get(key)\n position = find(key)\n if position != nil\n @values[position]\n else\n nil\n end\n end", "title": "" }, { "docid": "2ba254be9a80180c4aa8d3780bed9c11", "score": "0.6118955", "text": "def get_value(key)\n self[key]\n end", "title": "" }, { "docid": "8827642ed0a67cc11187fd1e350dcef4", "score": "0.61134803", "text": "def value\n v = connection.get(key)\n rescue Memcached::NotFound\n if block\n value = block.call\n value\n end\n end", "title": "" }, { "docid": "b0f42ebd9039a8296ffca0cdd41dbd38", "score": "0.6108068", "text": "def find_id(id)\n @candidates.find {|candidate| candidate if candidate[:id] == id}\nend", "title": "" }, { "docid": "60aa1836c06ae00d6f959f35a031fb82", "score": "0.6107052", "text": "def get(field)\n # Get the first/only row as a Hash.\n result = CONNECTION.execute(\"SELECT * FROM #{table_name} WHERE id = #{@id}\").first\n\n # Return only the value for the key of the field we're seeking.\n return result[field]\n end", "title": "" }, { "docid": "e2397bb49ca5fc1ad4cc4e27385fd6ac", "score": "0.61056036", "text": "def [](key)\n find_value(key)\n end", "title": "" }, { "docid": "3a17adbce0a90dba1a14d0b606721d52", "score": "0.610538", "text": "def search(id, key)\n if list = __send__(id)\n val = list.fetch(key) {return nil}\n block_given? ? yield(val) : val\n end\n end", "title": "" }, { "docid": "459dbcf77b9963552e5f2dddbe65f72f", "score": "0.6103826", "text": "def find(id)\n puts id\n @candidates.each do |c|\n if c[:id] == id\n puts c\n return c\n end\n end\nend", "title": "" }, { "docid": "f32ecced9b087a7501a169893b2d01e9", "score": "0.6103718", "text": "def get_key_value(key)\n if v = storage.get(key.object_id)\n return key.object_id, v\n end\n storage.get_candidates(key.hash).find do |k,v|\n candidate_key = get_object(k) or next\n candidate_key.eql? key\n end\n end", "title": "" }, { "docid": "50c3a31e29de72fff4c1d7982ed2b93f", "score": "0.61018896", "text": "def find_metadata_by_id (id, id_type: 'uuid', return_description: true)\r\n\r\n # loop through the metadata structure\r\n $isaac_metadata_auxiliary.each_value do |value|\r\n\r\n # check to see if the passed id matches the specified id in the metadata\r\n if id_type == 'uuid' && value['uuids'] && value['uuids'].first[:uuid] == id\r\n found = true\r\n elsif id_type == 'sequence' && value['uuids'] && value['uuids'].first[:translation]['value'].to_s == id.to_s\r\n found = true\r\n end\r\n\r\n # if this value was a match, return the specified object\r\n if found && return_description\r\n return value['fsn']\r\n elsif found\r\n return value\r\n end\r\n end\r\n\r\n # if nothing was found return an empty string\r\n return ''\r\n end", "title": "" }, { "docid": "2f333e1f22d35a32072deecd51d14505", "score": "0.60970706", "text": "def find_by_key(val)\n find(:first, :conditions => {:key => prepare_key(val)})\n end", "title": "" }, { "docid": "fda7a1d919d03697127f6e633e1fbf63", "score": "0.60960287", "text": "def find_value(contact, key_hash)\n\t\t\tresult = nil\n\t\t\tbegin\n\t\t\t\tcontact.client do |c|\n\t\t\t\t\t@logger.info \"Calling RPC `find_value` on #{contact.name}\"\n\t\t\t\t\tresult = c.find_value(self.to_contact, key_hash)\n\t\t\t\tend\n\t\t\trescue Soil::ClientConnectionError\n\t\t\t\t@logger.info \"find_value: Disregard contact #{contact.name} because of a Connection Error\"\n\t\t\tend\n\t\t\treturn result\n\t\tend", "title": "" }, { "docid": "f08bb7e7716ea39dcd8b9812efce284c", "score": "0.60695434", "text": "def find_item value\n self.find { |item| item.value == value }\n end", "title": "" }, { "docid": "aee7ce44dc9c9c48faf59bb25b577a75", "score": "0.605421", "text": "def find(id)\n binding.pry\n candidate.each do |candidate|\n if @candidate[:id] == id\n return candidate\n else\n nil\n end \n end \nend", "title": "" }, { "docid": "a284649af8f5798dee0a6e1c4f59ac29", "score": "0.6049584", "text": "def [](key)\n if @result.include?(key)\n @result[key]\n else\n data[key]\n end\n end", "title": "" }, { "docid": "b8253598840654890af71670a89019e0", "score": "0.6036274", "text": "def find(id)\n @candidates.each do |candidate|\n if id == candidate[:id]\n candidate\n end\n end\n nil\nend", "title": "" }, { "docid": "89e8bdc44274ba958569f8dbb85daef3", "score": "0.60244906", "text": "def find(id)\n found = nil\n @candidates.each do |candidate|\n if candidate[:id] == id\n found = candidate\n end\n end\n found\nend", "title": "" }, { "docid": "4477ecb1ba8dd0a4920ba0d354098a67", "score": "0.6022271", "text": "def get_search_by_id_result\n if is_do_search_by_id?\n klass = record_select_config.model\n res = klass.find_by_id(@searchparams)\n return res\n end\n return nil\n end", "title": "" }, { "docid": "8c2eeabd4ef64a70eeaa03d3950cbc4c", "score": "0.6021877", "text": "def fetch(id)\n search(id: id)[:records].first\n end", "title": "" }, { "docid": "d696d06f71fff38f99529d11ae49fadd", "score": "0.6017618", "text": "def find_by_key(key)\n find_by_id(key) # backlog method looks exactly the same except for the parameter type\n end", "title": "" }, { "docid": "cfab92a77cae79a5fd3c07d247764e57", "score": "0.6016746", "text": "def getValue(key)\r\n \r\n return @aHash[key]\r\n end", "title": "" }, { "docid": "34b0dabffc452deea797a897f0a178a9", "score": "0.60129255", "text": "def result\n Valkyrie::ID.new(value[:id])\n end", "title": "" }, { "docid": "a31a9c4c1c7d6c1351d6085e2669e960", "score": "0.6008754", "text": "def random_result(id)\n result = settings.db[:cfg_map].where('map_key = ?', id).order(Sequel.lit('rand()')).limit(1)\n sql = result.sql\n result = result.first \n\n logger.debug \"searching for #{id}\"\n if !result\n raise \"Can't find a record for $#{id}\"\n else\n logger.debug \"#{sql} #=> #{result[:map_val]}\"\n result[:map_val]\n end\n end", "title": "" }, { "docid": "95bd1d9a3c9f4e9821762baf565c51b8", "score": "0.60008925", "text": "def fetch(key); end", "title": "" }, { "docid": "d93d65dbe356bf18020788d94152891f", "score": "0.59914845", "text": "def fetch(id)\n # Pass in a proc that will return true if item with id is looked up\n # (pass in invItem as a param to lambda)\n return lookup(id, Proc.new { |invItem| return invItem } )\n end", "title": "" }, { "docid": "8ea1aaba9cb0e3df5b2c005ac9c27dbf", "score": "0.59844935", "text": "def find(x)\n if @candidates.any? {|h| h[:id] == x}\n return @candidates.find {|h| h[:id] == x}\n else\n return \"ID does not exist\".red\n end\nend", "title": "" }, { "docid": "2b7c81bceb2ea4f90cd36107faa2375f", "score": "0.59726566", "text": "def find(id)\n@candidates.detect {|candidate| candidate[:id] == id}\nend", "title": "" }, { "docid": "2305ab7d8e68bafa04f74f01f094ee26", "score": "0.5963773", "text": "def search_by_id(id)\n @data.each do |item|\n return item if item.id == id\n end\n\n nil\n end", "title": "" }, { "docid": "2c1e123334dc48c73c849da0c19987f0", "score": "0.5956518", "text": "def find(id)\n @candidates.each do |person|\n if person[:id] === id\n return person\n end\n end\n return nil\nend", "title": "" }, { "docid": "8134c6839d82e38e5e613beeeb78b96b", "score": "0.5956241", "text": "def find(id)\n\nreturn candidates.detect{|candidate| candidate[:id]==id }\n\nend", "title": "" }, { "docid": "5251291fcb4b21005401da0be9a97a9a", "score": "0.5918199", "text": "def find(id)\n @candidates.find {|h| h[:id] == id}\nend", "title": "" }, { "docid": "0a962855bed5f7bb236cc63096884c0c", "score": "0.59096754", "text": "def find_by_id(id)\n self.select { |record| record.id == id.to_s }.first\n end", "title": "" }, { "docid": "0a962855bed5f7bb236cc63096884c0c", "score": "0.59096754", "text": "def find_by_id(id)\n self.select { |record| record.id == id.to_s }.first\n end", "title": "" }, { "docid": "f59ead30cc9987f339c9c20f97954891", "score": "0.5909036", "text": "def result\n Valkyrie::ID.new(value[\"id\"])\n end", "title": "" }, { "docid": "d640fff60ecc2a8cdd7b2096ace24661", "score": "0.5904719", "text": "def get_key_from_result(res)\n res.fetch('id', {}).fetch('S', nil)\n end", "title": "" }, { "docid": "4b0843ec85d5423fa3cd7b5e13c766f1", "score": "0.5897784", "text": "def get(id)\n klass.find(:first, params: { klass.primary_key => wrap_key(id) })\n end", "title": "" }, { "docid": "8c83a60f06d136b5e03e14355dbfa90b", "score": "0.5886323", "text": "def [](id)\n id = get_id(id) if id.is_a?(Symbol)\n id = 0 unless id.is_a?(Integer) && id_valid?(id)\n return @data[id]\n end", "title": "" }, { "docid": "4bd05544c6ceef6b565fbe37ddd0bd03", "score": "0.5885992", "text": "def custom_field_value_by_id(field_id)\n @acl_cfv_hash = {} if @acl_cfv_hash.blank?\n return @acl_cfv_hash[field_id.to_s] if @acl_cfv_hash.has_key?(field_id.to_s)\n if self.acl_available_custom_fields.has_key?(field_id.to_i)\n x = CustomFieldValue.new\n x.custom_field = self.acl_available_custom_fields[field_id.to_i]\n x.customized = self\n @acl_cfv_hash[field_id.to_s] = x\n x\n else\n nil\n end\n end", "title": "" }, { "docid": "e6cd0290544ee27bc659e619572fdf89", "score": "0.58847976", "text": "def find(id)\n # binding.pry\n raise '@candidates must be an Array' if @candidates.nil?\n candidate.each do |candidate|\n if candidate[:id] == id\n return candidate\n else\n nil\n end \n end \nend", "title": "" }, { "docid": "ded9aafc729f714cc0480fae8ba5dfab", "score": "0.58844113", "text": "def get_key(record)\n get(self.by, record)\n end", "title": "" }, { "docid": "a78e34b238dbcf39b73b00055e16daf5", "score": "0.5881154", "text": "def find(id)\nraise \"candidates must be an Array\" if @candidates.nil?\n @candidates.each do |candidate|\n return candidate if candidate[:id] == id\n end\n nil\nend", "title": "" }, { "docid": "879a17e8fef976345700188fca93ee31", "score": "0.5875186", "text": "def find_by_id(id)\n id = id.to_i\n\n @id_hash[id]\n end", "title": "" }, { "docid": "924929b9ff2134806301bdafd6599811", "score": "0.58730054", "text": "def find(id)\n @candidates.detect {|candidates| candidate[:id] == id}\nend", "title": "" }, { "docid": "e25d8411b07de446f47b596a5e0fc6b9", "score": "0.5871358", "text": "def get(key)\n \n end", "title": "" }, { "docid": "b2d08a2684ca671a87cf9c4c0087cd8d", "score": "0.58645946", "text": "def find(id)\n @candidates.select { |candidate| candidate[:id] === id}\nend", "title": "" }, { "docid": "bd97ac2468b6d0158f623ad848a7e773", "score": "0.5860776", "text": "def find(key)\n # If we are already on nil, just add it here\n return nil if @root.nil?\n #Return the root value if it is the value we are looking for\n return @root.value if @root.key == key\n #Otherwise, call in reinforcements\n return find_helper(@root, key)\n end", "title": "" }, { "docid": "8ff66f9684228518d0e28d5969f6c843", "score": "0.5850546", "text": "def find(key)\n if @root.nil?\n return nil\n elsif @root.key == key\n return @root.value\n else\n find_helper(@root, key)\n end\n end", "title": "" }, { "docid": "4617da6bc791fe271ff93c7b6adb01f7", "score": "0.5847221", "text": "def get_value(collection, key)\n @data[collection][key]\n end", "title": "" }, { "docid": "9b7ce87c8fd62876a9e884b4d054d1aa", "score": "0.58274686", "text": "def find(id)\n @candidates.detect do |candidate|\n candidate[:id] === id\n end\nend", "title": "" }, { "docid": "3804fcaec75c00181035e301fb38565d", "score": "0.5825851", "text": "def get_result(key)\n return @outputs[key]\n end", "title": "" }, { "docid": "a3125e92d390f9639ee941da77a3765f", "score": "0.5811841", "text": "def get(key); end", "title": "" }, { "docid": "a3125e92d390f9639ee941da77a3765f", "score": "0.5811841", "text": "def get(key); end", "title": "" }, { "docid": "a3125e92d390f9639ee941da77a3765f", "score": "0.5811841", "text": "def get(key); end", "title": "" }, { "docid": "a3125e92d390f9639ee941da77a3765f", "score": "0.5811841", "text": "def get(key); end", "title": "" }, { "docid": "e4c5dc4bb30c87e6fc6b8cbb796c7527", "score": "0.5807376", "text": "def fetch( key )\n key = key.to_s.strip unless key.nil?\n raise \"Invalid key\" if key.nil? or key == ''\n\n id,value,hits = @db.get_first_row(\n \"SELECT id,value,hits \"+\n \"FROM #{TABLE_NAME} \"+\n \"WHERE key=?\",\n key.to_s.strip\n )\n\n # Return nil if there is cache MISS.\n return nil if value.nil?\n \n # Increment the number of hits\n if @count_hits\n @db.execute(\n \"UPDATE #{TABLE_NAME} SET hits=?, updated_at=? WHERE id=?\",\n hits.to_i+1, Time.now.to_i, id\n )\n end\n\n # Otherwise if there is a HIT, parse the YAML into an object\n return YAML::load(value)\n end", "title": "" }, { "docid": "4a7a969b06f34ae53fb83374ecce361c", "score": "0.5799702", "text": "def find(id)\n @candidates.select{|candidate| candidate[:id] === id }\n #return @candidates\n\nend", "title": "" }, { "docid": "e35879e49827d2ef260ef1153beddea6", "score": "0.5798678", "text": "def show_field_value(id)\n get(\"fieldValues/#{id}\")\n end", "title": "" }, { "docid": "86c8592d076e42cad1d8aca0d3cb7bd9", "score": "0.5790989", "text": "def find(id)\n\traise '@candidates must be an Array' if @candidates.nil?\n\t@candidates.each do |x|\n\t\tif x[:id] == id\n\t\t\treturn x\n\t\tend\n\tend\n\tputs \"Candidate not found\"\n\tnil\nend", "title": "" }, { "docid": "28f8dec95322b9262a18ee080933a5ed", "score": "0.5785743", "text": "def fetch(key, value = nil)\n if read = self[key]\n return read\n end\n block_given? ? yield(key) : value\n end", "title": "" }, { "docid": "c9e4937fd573af456e9c3ead1d18ab74", "score": "0.57796997", "text": "def find(attribute, match, value)\n search = search_with_store(self.store, attribute, match, value)\n error_ptr = Pointer.new(:id)\n searchResults = search.searchObjectsWithReturnType(NSFReturnObjects, error:error_ptr)\n raise NanoStoreError, error_ptr[0].description if error_ptr[0]\n searchResults.values\n end", "title": "" }, { "docid": "ffd4a42ef042d3b153012524aa4a21a4", "score": "0.57788396", "text": "def record_value(record, property)\n case record\n when Hash\n record.fetch(property, record[property.field])\n when Resource\n property.get!(record)\n end\n end", "title": "" }, { "docid": "b80e3997504f9a5aaaa6b1cb163d53b6", "score": "0.5770578", "text": "def get_key record\n record\n end", "title": "" }, { "docid": "ac8b7530495d2a75abd7f77ae91e09ca", "score": "0.5769012", "text": "def get_b_val(id)\n ans = Market.where(:id => id).first\n ans.b_val\n end", "title": "" } ]
ef30104dab890f7489acd40c24485837
PATCH/PUT /conversations/1 PATCH/PUT /conversations/1.json
[ { "docid": "84d71f1ef5e7403502d2e39b6fb98c25", "score": "0.66328156", "text": "def update\n respond_to do |format|\n if @conversation.update(conversation_params)\n format.html { redirect_to @conversation, notice: 'Conversation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @conversation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "3e54d05f63dfa852336c0059fb7719a7", "score": "0.70295537", "text": "def update_conversation(id, data)\n put(\"conversations/#{id}\", { body: data })\n end", "title": "" }, { "docid": "fdb300fd8bd8024b3443cbdfc63a3ed1", "score": "0.69650495", "text": "def update_conversation(id, data)\n instructions = []\n\n if data[:subject]\n instructions << {\n op: \"replace\",\n path: \"/subject\",\n value: data[:subject],\n }\n end\n if data[:mailboxId]\n instructions << {\n op: \"move\",\n path: \"/mailboxId\",\n value: data[:mailboxId],\n }\n end\n if data[:status]\n status = data[:status]\n if !CONVERSATION_STATUSES.include?(status)\n raise InvalidDataError.new(\"status \\\"#{status}\\\" not supported, must be one of #{CONVERSATION_STATUSES}\")\n end\n\n instructions << {\n op: \"replace\",\n path: \"/status\",\n value: data[:status],\n }\n end\n if data.key?(:assignTo)\n # change owner\n if data[:assignTo]\n instructions << {\n op: \"replace\",\n path: \"/assignTo\",\n value: data[:assignTo],\n }\n else\n # un assign\n instructions << {\n op: \"remove\",\n path: \"/assignTo\",\n }\n end\n end\n\n # Note: HelpScout currently does not support multiple\n # instructions in the same request, well have to do them\n # individually :-)\n instructions.each do |instruction|\n patch(\"conversations/#{id}\", { body: instruction })\n end\n end", "title": "" }, { "docid": "5e48fb8e27355b5f9dbd6feaf7300d5c", "score": "0.68345374", "text": "def update\n @conversation = Conversation.find(params[:id])\n\n if @conversation.update(conversation_params)\n head :no_content\n else\n render json: @conversation.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "5e48fb8e27355b5f9dbd6feaf7300d5c", "score": "0.68345374", "text": "def update\n @conversation = Conversation.find(params[:id])\n\n if @conversation.update(conversation_params)\n head :no_content\n else\n render json: @conversation.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "138e78459cceab6b282d66de5a9d93c2", "score": "0.680446", "text": "def update\n @convo = Convo.find(params[:id])\n\n respond_to do |format|\n if @convo.update_attributes(params[:convo])\n format.html { redirect_to @convo, notice: 'Conversation has been modified.' }\n format.json { render json: @convo.merits }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @convo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "91d6a1962a9dc3b29693cf09d158b0f0", "score": "0.6755192", "text": "def update_conversation(id, data)\r\n @client.raw('put', \"/content/conversations/#{id}\", nil, data_transform(data), @contact_v1_url)\r\n end", "title": "" }, { "docid": "2cb57e66bab153a2a78f3e83b0f7a9c7", "score": "0.67442477", "text": "def update\n @conversation = Conversation.find(params[:id])\n\n respond_to do |format|\n if @conversation.update_attributes(params[:conversation])\n format.html { redirect_to @conversation, notice: 'Conversation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @conversation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "014b00bcdb603a2ac84b0cce7f51466b", "score": "0.6739878", "text": "def update\n @conversation = Conversation.find(params[:id])\n\n respond_to do |format|\n if @conversation.update_attributes(params[:conversation])\n format.html { redirect_to @conversation, notice: 'Conversation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @conversation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dc882ba79610e128151ccd31394d1cee", "score": "0.67357695", "text": "def update\n @conversation = Conversation.find(params[:id])\n\n respond_to do |format|\n if @conversation.update_attributes(params[:conversation])\n format.html { redirect_to @conversation, notice: 'Conversation was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @conversation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ae2e866a104e4b11c0cb226a4b0ea061", "score": "0.6591836", "text": "def conversation_update\n if params[:message][:conversation_line_id]\n #if message_id set then edit the message\n message = Message.find(params[:message][:conversation_line_id])\n\n message.update(\n message_params.merge(updated_at: Time.at(params[:message][:timestamp].to_i))\n )\n\n # Update expiry date of messages on conversations lines\n message.conversation_line_messages.update(\n message_params.merge(updated_at: Time.at(params[:message][:timestamp].to_i))\n )\n\n message.current_user = current_user\n render json: {\n success: true\n }\n else\n render json: {\n success: false\n }\n end\n end", "title": "" }, { "docid": "d9b245f06f1a11d13794aead1882baf0", "score": "0.6526926", "text": "def update\n respond_to do |format|\n if @conversation.update(conversation_params)\n format.html { redirect_to @conversation, notice: 'Conversation was successfully updated.' }\n format.json { render :show, status: :ok, location: @conversation }\n else\n format.html { render :edit }\n format.json { render json: @conversation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d9b245f06f1a11d13794aead1882baf0", "score": "0.6526926", "text": "def update\n respond_to do |format|\n if @conversation.update(conversation_params)\n format.html { redirect_to @conversation, notice: 'Conversation was successfully updated.' }\n format.json { render :show, status: :ok, location: @conversation }\n else\n format.html { render :edit }\n format.json { render json: @conversation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d9b245f06f1a11d13794aead1882baf0", "score": "0.6526926", "text": "def update\n respond_to do |format|\n if @conversation.update(conversation_params)\n format.html { redirect_to @conversation, notice: 'Conversation was successfully updated.' }\n format.json { render :show, status: :ok, location: @conversation }\n else\n format.html { render :edit }\n format.json { render json: @conversation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "11dd3555bb036caae0a2ef7fb41e2e94", "score": "0.65260077", "text": "def patch_conversations_chat_with_http_info(conversation_id, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ConversationsApi.patch_conversations_chat ...\"\n end\n \n \n # verify the required parameter 'conversation_id' is set\n fail ArgumentError, \"Missing the required parameter 'conversation_id' when calling ConversationsApi.patch_conversations_chat\" if conversation_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'body' is set\n fail ArgumentError, \"Missing the required parameter 'body' when calling ConversationsApi.patch_conversations_chat\" if body.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/conversations/chats/{conversationId}\".sub('{format}','json').sub('{' + 'conversationId' + '}', conversation_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(body)\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Conversation')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConversationsApi#patch_conversations_chat\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "b3a12ef6bb62d527830b9eb868c6a7c9", "score": "0.6459299", "text": "def patch_conversations_message_with_http_info(conversation_id, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ConversationsApi.patch_conversations_message ...\"\n end\n \n \n # verify the required parameter 'conversation_id' is set\n fail ArgumentError, \"Missing the required parameter 'conversation_id' when calling ConversationsApi.patch_conversations_message\" if conversation_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'body' is set\n fail ArgumentError, \"Missing the required parameter 'body' when calling ConversationsApi.patch_conversations_message\" if body.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/conversations/messages/{conversationId}\".sub('{format}','json').sub('{' + 'conversationId' + '}', conversation_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(body)\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Conversation')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConversationsApi#patch_conversations_message\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "5153a604f78c2aeb6b891262450662d6", "score": "0.64082664", "text": "def update\n @conversation = Conversation.find(params[:id])\n\n respond_to do |format|\n if @conversation.update_attributes(params[:conversation])\n format.html { redirect_to(@conversation, :notice => 'Conversation was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @conversation.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6add5450df4ee2cf25d1ddadb244ff4d", "score": "0.6257751", "text": "def update_conversation_status(id, data)\r\n @client.raw('put', \"/content/conversations/#{id}/status\", nil, data_transform(data), @contact_v1_url)\r\n end", "title": "" }, { "docid": "858b61e740efc8d71d77ce850c9d19f4", "score": "0.62181765", "text": "def update\n respond_to do |format|\n if @conversation.update(name: conname)\n format.html { redirect_to @conversation, notice: 'conversation was successfully updated.' }\n format.json { render :show, status: :ok, location: @conversation }\n else\n format.html { render :edit }\n format.json { render json: @conversation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "938a8a9f8029f9b8e7b7c49aa547a5c3", "score": "0.6205869", "text": "def patch_conversations_email_with_http_info(conversation_id, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ConversationsApi.patch_conversations_email ...\"\n end\n \n \n # verify the required parameter 'conversation_id' is set\n fail ArgumentError, \"Missing the required parameter 'conversation_id' when calling ConversationsApi.patch_conversations_email\" if conversation_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'body' is set\n fail ArgumentError, \"Missing the required parameter 'body' when calling ConversationsApi.patch_conversations_email\" if body.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/conversations/emails/{conversationId}\".sub('{format}','json').sub('{' + 'conversationId' + '}', conversation_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(body)\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Conversation')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConversationsApi#patch_conversations_email\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "6d559da3f7bc6876e86af5c56c983f4b", "score": "0.6121303", "text": "def patch_conversations_call_with_http_info(conversation_id, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ConversationsApi.patch_conversations_call ...\"\n end\n \n \n # verify the required parameter 'conversation_id' is set\n fail ArgumentError, \"Missing the required parameter 'conversation_id' when calling ConversationsApi.patch_conversations_call\" if conversation_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'body' is set\n fail ArgumentError, \"Missing the required parameter 'body' when calling ConversationsApi.patch_conversations_call\" if body.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/conversations/calls/{conversationId}\".sub('{format}','json').sub('{' + 'conversationId' + '}', conversation_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(body)\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Conversation')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConversationsApi#patch_conversations_call\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "2421a325a0a8942ade108ed03ecb7579", "score": "0.61188525", "text": "def update\n @conversation = Conversation.find(params[:id])\n\n if @conversation.update_attributes(params[:conversation])\n redirect_to(@conversation, :notice => 'Conversation was successfully updated.')\n else\n render :action => \"edit\", :status => :unprocessable_entity\n end\n end", "title": "" }, { "docid": "7d0ac5c9b027ff17c3dfb7674ed88e13", "score": "0.6097776", "text": "def update\n respond_to do |format|\n if @user_conversation.update(user_conversation_params)\n format.html { redirect_to @user_conversation, notice: 'User conversation was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_conversation }\n else\n format.html { render :edit }\n format.json { render json: @user_conversation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4ec41bd213ccb6a7074f6bccea63f8a2", "score": "0.6057246", "text": "def update\n @conversation = Conversation.find(params[:id])\n\n # handle publish/unpublish\n if !params[:published].blank?\n if params[:published] == 'y'\n @conversation.published = true\n else\n @conversation.published = false\n end \n end\n\n respond_to do |format|\n if @conversation.update_attributes(params[:conversation])\n format.html { redirect_to(pad_conversations_path(@pad), :notice => 'Conversation was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @conversation.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "71b7fe0e3d519152b900f2a51d8e98cd", "score": "0.60024416", "text": "def update\n @chat = Chat.find(params[:id])\n\n respond_to do |format|\n if @chat.update_attributes(params[:chat])\n format.html { redirect_to @chat, notice: 'Chat was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @chat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ef313db7b76f30ab1140118ccbb7672e", "score": "0.5975397", "text": "def put_conversations_email_messages_draft_with_http_info(conversation_id, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ConversationsApi.put_conversations_email_messages_draft ...\"\n end\n \n \n # verify the required parameter 'conversation_id' is set\n fail ArgumentError, \"Missing the required parameter 'conversation_id' when calling ConversationsApi.put_conversations_email_messages_draft\" if conversation_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'body' is set\n fail ArgumentError, \"Missing the required parameter 'body' when calling ConversationsApi.put_conversations_email_messages_draft\" if body.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/conversations/emails/{conversationId}/messages/draft\".sub('{format}','json').sub('{' + 'conversationId' + '}', conversation_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(body)\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'EmailMessage')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConversationsApi#put_conversations_email_messages_draft\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "d55c8508389794349319b606c917ca34", "score": "0.59679574", "text": "def edit\n @conversation = Conversation.find(params[:id])\n end", "title": "" }, { "docid": "5e8cacaf3fdf06ab445bc284f2349957", "score": "0.5951268", "text": "def patch_conversations_callback_with_http_info(conversation_id, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ConversationsApi.patch_conversations_callback ...\"\n end\n \n \n # verify the required parameter 'conversation_id' is set\n fail ArgumentError, \"Missing the required parameter 'conversation_id' when calling ConversationsApi.patch_conversations_callback\" if conversation_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'body' is set\n fail ArgumentError, \"Missing the required parameter 'body' when calling ConversationsApi.patch_conversations_callback\" if body.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/conversations/callbacks/{conversationId}\".sub('{format}','json').sub('{' + 'conversationId' + '}', conversation_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(body)\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Conversation')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConversationsApi#patch_conversations_callback\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "324fee270b220c23ae2d8c9e0089ec1d", "score": "0.59302676", "text": "def update\n @v1_message = V1::Message.find(params[:id])\n\n if @v1_message.update(message_params)\n render json: @v1_message, status: :ok\n else\n render json: @v1_message.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "e4d546ad8ff1b8a69358795759c24d37", "score": "0.58737814", "text": "def update\n respond_to do |format|\n if @chat.update(chat_params)\n format.html { redirect_to @chat, notice: 'Chat was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @chat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e4d546ad8ff1b8a69358795759c24d37", "score": "0.58737814", "text": "def update\n respond_to do |format|\n if @chat.update(chat_params)\n format.html { redirect_to @chat, notice: 'Chat was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @chat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1c0841777c64752163c1c0922c34945e", "score": "0.5845496", "text": "def update\r\n respond_to do |format|\r\n if @chat.update(chat_params)\r\n format.html { redirect_to chat_path(@chat), notice: 'Chat 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: @chat.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "70df2db3912ab88c400256f6c37755bd", "score": "0.5800803", "text": "def update!(**args)\n @conversations = args[:conversations] if args.key?(:conversations)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n end", "title": "" }, { "docid": "70df2db3912ab88c400256f6c37755bd", "score": "0.5799674", "text": "def update!(**args)\n @conversations = args[:conversations] if args.key?(:conversations)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n end", "title": "" }, { "docid": "70df2db3912ab88c400256f6c37755bd", "score": "0.5799674", "text": "def update!(**args)\n @conversations = args[:conversations] if args.key?(:conversations)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n end", "title": "" }, { "docid": "833de695462e64181280d3af0f2bb1ea", "score": "0.578546", "text": "def update\n conversation = Conversation.find(params[:conversation_id])\n conversation.messages << Message.new(user_id: current_user.id, body: params[:body])\n conversation.save\n\n redirect_to conversation_path(conversation)\n end", "title": "" }, { "docid": "c201aa722c3509eccf92a61e72cb3405", "score": "0.57698697", "text": "def update\n message = Message.find(params[:id])\n message.update(message_params)\n render json: message\n end", "title": "" }, { "docid": "0face1983265e75bad46849fc48300b3", "score": "0.5763642", "text": "def update\n @chatline = Chatline.find(params[:id])\n\n respond_to do |format|\n if @chatline.update_attributes(params[:chatline])\n format.html { redirect_to @chatline, notice: 'Chatline was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @chatline.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "46f430c19c603e844c7b99f1c15a95e3", "score": "0.5760693", "text": "def update\n respond_to do |format|\n if @chat.update(chat_params)\n format.html { redirect_to @chat, notice: 'Chat was successfully updated.' }\n format.json { render :show, status: :ok, location: @chat }\n else\n format.html { render :edit }\n format.json { render json: @chat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "46f430c19c603e844c7b99f1c15a95e3", "score": "0.5760693", "text": "def update\n respond_to do |format|\n if @chat.update(chat_params)\n format.html { redirect_to @chat, notice: 'Chat was successfully updated.' }\n format.json { render :show, status: :ok, location: @chat }\n else\n format.html { render :edit }\n format.json { render json: @chat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "46f430c19c603e844c7b99f1c15a95e3", "score": "0.5760693", "text": "def update\n respond_to do |format|\n if @chat.update(chat_params)\n format.html { redirect_to @chat, notice: 'Chat was successfully updated.' }\n format.json { render :show, status: :ok, location: @chat }\n else\n format.html { render :edit }\n format.json { render json: @chat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fd9424c4951c8ec2183590e2919f559b", "score": "0.5747042", "text": "def update\n respond_to do |format|\n if @chat.update(chat_params)\n format.html { redirect_to @chat, notice: \"Chat was successfully updated.\" }\n format.json { render :show, status: :ok, location: @chat }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @chat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2ecfe83d3cc84a6fa458200aa53aa756", "score": "0.57357377", "text": "def update\n @chat = Chat.find(params[:id])\n\n respond_to do |format|\n if @chat.update_attributes(params[:chat])\n flash[:notice] = 'BATE PAPO ATUALIZADO.'\n format.html { redirect_to(@chat) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @chat.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e48790502e635302d5b3573a573deded", "score": "0.57059914", "text": "def update\n @message = Message.find(params[:id])\n @message.update(text: params[\"_json\"])\n render json: @message\n end", "title": "" }, { "docid": "702fca169eb1544b02bdb291638e4f06", "score": "0.56952333", "text": "def patch_conversation_participant_with_http_info(conversation_id, participant_id, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ConversationsApi.patch_conversation_participant ...\"\n end\n \n \n # verify the required parameter 'conversation_id' is set\n fail ArgumentError, \"Missing the required parameter 'conversation_id' when calling ConversationsApi.patch_conversation_participant\" if conversation_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'participant_id' is set\n fail ArgumentError, \"Missing the required parameter 'participant_id' when calling ConversationsApi.patch_conversation_participant\" if participant_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'body' is set\n fail ArgumentError, \"Missing the required parameter 'body' when calling ConversationsApi.patch_conversation_participant\" if body.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/conversations/{conversationId}/participants/{participantId}\".sub('{format}','json').sub('{' + 'conversationId' + '}', conversation_id.to_s).sub('{' + 'participantId' + '}', participant_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(body)\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConversationsApi#patch_conversation_participant\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "8d6a61f3186174209e44862cb0ae05d7", "score": "0.56816536", "text": "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", "title": "" }, { "docid": "eeef9ff3678222961c7ea24aed32aebe", "score": "0.56511635", "text": "def update\n @messaging_inbox = Messaging::Inbox.find(params[:id])\n\n respond_to do |format|\n if @messaging_inbox.update_attributes(params[:messaging_inbox])\n format.html { redirect_to @messaging_inbox, notice: 'Inbox was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @messaging_inbox.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "90229088ede4747b6df57c465c83f9a3", "score": "0.564982", "text": "def patch_conversations_message_participant_attributes_with_http_info(conversation_id, participant_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ConversationsApi.patch_conversations_message_participant_attributes ...\"\n end\n \n \n # verify the required parameter 'conversation_id' is set\n fail ArgumentError, \"Missing the required parameter 'conversation_id' when calling ConversationsApi.patch_conversations_message_participant_attributes\" if conversation_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'participant_id' is set\n fail ArgumentError, \"Missing the required parameter 'participant_id' when calling ConversationsApi.patch_conversations_message_participant_attributes\" if participant_id.nil?\n \n \n \n \n \n \n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/conversations/messages/{conversationId}/participants/{participantId}/attributes\".sub('{format}','json').sub('{' + 'conversationId' + '}', conversation_id.to_s).sub('{' + 'participantId' + '}', participant_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(opts[:'body'])\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConversationsApi#patch_conversations_message_participant_attributes\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "555715ed1d1e2df1844052b5e1618762", "score": "0.56485254", "text": "def update\n params.require(:id)\n msg = Message.find(params[:id])\n msg.read = true\n msg.save\n render :json => msg.as_json, status: :ok\n end", "title": "" }, { "docid": "cb682472a8e63777c251e16cb667890f", "score": "0.56440777", "text": "def update\n\t\t# channel_sid = params[:channel_sid]\n\t\t# message_sid = params[:id]\n\t\t# @client = Twilio::REST::Client.new(ENV['account_sid'], ENV['auth_token'])\n\n\t\t# # Update the message\n\t\t# service = @client.chat.v2.services(ENV['service_sid'])\n\t\t# channel = service.channels(channel_sid).fetch\n\t\t# message = channel.messages(message_sid).fetch\n\t\t# message_updated = message.update(body: params[:body])\n\t\t# puts \"#{message_updated.sid} #{message_updated.body}\"\n\t\t# new_message = \"Message was changed\"\n\t\t# json_response(new_message)\n\tend", "title": "" }, { "docid": "b3d2114d610cf79bb3e5c7345a4419c7", "score": "0.56324506", "text": "def update!(**args)\n @conversation = args[:conversation] if args.key?(:conversation)\n @conversation_id = args[:conversation_id] if args.key?(:conversation_id)\n @parent = args[:parent] if args.key?(:parent)\n @redaction_config = args[:redaction_config] if args.key?(:redaction_config)\n end", "title": "" }, { "docid": "b3d2114d610cf79bb3e5c7345a4419c7", "score": "0.56324506", "text": "def update!(**args)\n @conversation = args[:conversation] if args.key?(:conversation)\n @conversation_id = args[:conversation_id] if args.key?(:conversation_id)\n @parent = args[:parent] if args.key?(:parent)\n @redaction_config = args[:redaction_config] if args.key?(:redaction_config)\n end", "title": "" }, { "docid": "67142517f433c9d181ef018f4c56ba0c", "score": "0.5628306", "text": "def patch_conversations_message_participant_communication_with_http_info(conversation_id, participant_id, communication_id, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ConversationsApi.patch_conversations_message_participant_communication ...\"\n end\n \n \n # verify the required parameter 'conversation_id' is set\n fail ArgumentError, \"Missing the required parameter 'conversation_id' when calling ConversationsApi.patch_conversations_message_participant_communication\" if conversation_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'participant_id' is set\n fail ArgumentError, \"Missing the required parameter 'participant_id' when calling ConversationsApi.patch_conversations_message_participant_communication\" if participant_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'communication_id' is set\n fail ArgumentError, \"Missing the required parameter 'communication_id' when calling ConversationsApi.patch_conversations_message_participant_communication\" if communication_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'body' is set\n fail ArgumentError, \"Missing the required parameter 'body' when calling ConversationsApi.patch_conversations_message_participant_communication\" if body.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/conversations/messages/{conversationId}/participants/{participantId}/communications/{communicationId}\".sub('{format}','json').sub('{' + 'conversationId' + '}', conversation_id.to_s).sub('{' + 'participantId' + '}', participant_id.to_s).sub('{' + 'communicationId' + '}', communication_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(body)\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Empty')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConversationsApi#patch_conversations_message_participant_communication\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "e02ad28b2a63105d0684a0691c3baee2", "score": "0.561399", "text": "def patch_conversations_chat_participant_communication_with_http_info(conversation_id, participant_id, communication_id, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ConversationsApi.patch_conversations_chat_participant_communication ...\"\n end\n \n \n # verify the required parameter 'conversation_id' is set\n fail ArgumentError, \"Missing the required parameter 'conversation_id' when calling ConversationsApi.patch_conversations_chat_participant_communication\" if conversation_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'participant_id' is set\n fail ArgumentError, \"Missing the required parameter 'participant_id' when calling ConversationsApi.patch_conversations_chat_participant_communication\" if participant_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'communication_id' is set\n fail ArgumentError, \"Missing the required parameter 'communication_id' when calling ConversationsApi.patch_conversations_chat_participant_communication\" if communication_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'body' is set\n fail ArgumentError, \"Missing the required parameter 'body' when calling ConversationsApi.patch_conversations_chat_participant_communication\" if body.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/conversations/chats/{conversationId}/participants/{participantId}/communications/{communicationId}\".sub('{format}','json').sub('{' + 'conversationId' + '}', conversation_id.to_s).sub('{' + 'participantId' + '}', participant_id.to_s).sub('{' + 'communicationId' + '}', communication_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(body)\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Empty')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConversationsApi#patch_conversations_chat_participant_communication\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "d2ccd6f3a989d221ab7994853c7da50b", "score": "0.56131315", "text": "def update\n respond_to do |format|\n if @smpl_chat.update(smpl_chat_params)\n format.html { redirect_to @smpl_chat, notice: 'Smpl chat was successfully updated.' }\n format.json { render :show, status: :ok, location: @smpl_chat }\n else\n format.html { render :edit }\n format.json { render json: @smpl_chat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9f8e8fa0383f16e734c2e76aa43fafc6", "score": "0.5609105", "text": "def update\n respond_to do |format|\n if @chat_message.update(chat_message_params)\n format.html { redirect_to @chat_message, notice: 'Chat message was successfully updated.' }\n format.json { render :show, status: :ok, location: @chat_message }\n else\n format.html { render :edit }\n format.json { render json: @chat_message.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "66e24096728b58f10d7d5e070a4630de", "score": "0.5595151", "text": "def update\n @inbox = Inbox.find(params[:id])\n\n respond_to do |format|\n if @inbox.update_attributes(params[:inbox])\n format.html { redirect_to @inbox, notice: 'Inbox was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @inbox.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "10e1f4ec6694ce72cfeb0f69ce41a82b", "score": "0.5588278", "text": "def patch_conversations_chat_participant_attributes_with_http_info(conversation_id, participant_id, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ConversationsApi.patch_conversations_chat_participant_attributes ...\"\n end\n \n \n # verify the required parameter 'conversation_id' is set\n fail ArgumentError, \"Missing the required parameter 'conversation_id' when calling ConversationsApi.patch_conversations_chat_participant_attributes\" if conversation_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'participant_id' is set\n fail ArgumentError, \"Missing the required parameter 'participant_id' when calling ConversationsApi.patch_conversations_chat_participant_attributes\" if participant_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'body' is set\n fail ArgumentError, \"Missing the required parameter 'body' when calling ConversationsApi.patch_conversations_chat_participant_attributes\" if body.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/conversations/chats/{conversationId}/participants/{participantId}/attributes\".sub('{format}','json').sub('{' + 'conversationId' + '}', conversation_id.to_s).sub('{' + 'participantId' + '}', participant_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(body)\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConversationsApi#patch_conversations_chat_participant_attributes\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "ef6af9d7203a75e0934bec66dd1c2b95", "score": "0.55851257", "text": "def patch_conversations_email_participant_communication_with_http_info(conversation_id, participant_id, communication_id, body, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ConversationsApi.patch_conversations_email_participant_communication ...\"\n end\n \n \n # verify the required parameter 'conversation_id' is set\n fail ArgumentError, \"Missing the required parameter 'conversation_id' when calling ConversationsApi.patch_conversations_email_participant_communication\" if conversation_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'participant_id' is set\n fail ArgumentError, \"Missing the required parameter 'participant_id' when calling ConversationsApi.patch_conversations_email_participant_communication\" if participant_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'communication_id' is set\n fail ArgumentError, \"Missing the required parameter 'communication_id' when calling ConversationsApi.patch_conversations_email_participant_communication\" if communication_id.nil?\n \n \n \n \n \n \n # verify the required parameter 'body' is set\n fail ArgumentError, \"Missing the required parameter 'body' when calling ConversationsApi.patch_conversations_email_participant_communication\" if body.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/conversations/emails/{conversationId}/participants/{participantId}/communications/{communicationId}\".sub('{format}','json').sub('{' + 'conversationId' + '}', conversation_id.to_s).sub('{' + 'participantId' + '}', participant_id.to_s).sub('{' + 'communicationId' + '}', communication_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(body)\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Empty')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConversationsApi#patch_conversations_email_participant_communication\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "dc4b9e3079d744bf6cca44a22cbf8909", "score": "0.5579243", "text": "def update\n @message = Message.find(params[:id])\n if @message.recipient == current_user\n @message.remove_from_inbox = true\n elsif @message.sender == current_user\n @message.remove_from_sent = true\n end\n respond_to do |format|\n if @message.update_attributes(params[:message])\n if @message.recipient == current_user\n format.html { redirect_to mailbox_type_messages_path('inbox'), notice: 'Message has been deleted.' }\n elsif @message.sender == current_user\n format.html { redirect_to mailbox_type_messages_path('sent'), notice: 'Message has been deleted.' }\n end\n format.json { head :no_content }\n # else\n # format.html { render action: \"edit\" }\n # format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4e0e59715d19dce2a47fccc2c67326dd", "score": "0.5576431", "text": "def patch!\n request! :patch\n end", "title": "" }, { "docid": "c5622ce01c661c1cc0ec4b0839c587ff", "score": "0.55691534", "text": "def update\n respond_to do |format|\n if @api_v1_concern.update(api_v1_concern_params)\n format.html { redirect_to @api_v1_concern, notice: 'Concern was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_concern }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_concern.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c3c11dffa0c70cd985367a4c02ef5124", "score": "0.5568566", "text": "def update\n @message = Message.find(params[:id])\n @message.update_attributes(params[:message])\n respond_with(@message)\n end", "title": "" }, { "docid": "6bf74f6c37305ab7a5960b465144bcfd", "score": "0.5567092", "text": "def update\n #@appointment = Appointment.find(params[:id])\n @conversation = Conversation.find(@appointment.conversation_id)\n @user = current_user\n if @user == @appointment.host\n @appointment.host_confirmed = true\n @appointment.attendee_confirmed = false\n free_credits(@appointment)\n elsif @user == @appointment.attendee\n @appointment.attendee_confirmed = true\n @appointment.host_confirmed = false\n free_credits(@appointment)\n else\n redirect_to current_user, notice: \"There was an error with your request.\"\n return\n end\n\n respond_to do |format|\n if @appointment.update_attributes(params[:appointment])\n current_user.reply_to_conversation(@conversation, params[:message][:body], @conversation.subject)\n format.html { redirect_to @appointment, notice: 'Appointment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @appointment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f80dd890f2afb58d329a2a7eb42d1239", "score": "0.55668616", "text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.json {render json: :created}\n else\n format.json {render json: \"not created\"}\n end\n end\n end", "title": "" }, { "docid": "9b155bc58ee66285eeeb44dedf1f1e4c", "score": "0.556375", "text": "def patch_conversations_call(conversation_id, body, opts = {})\n data, _status_code, _headers = patch_conversations_call_with_http_info(conversation_id, body, opts)\n return data\n end", "title": "" }, { "docid": "656c9199d52c87d934b52d3c1bc6d82f", "score": "0.55601543", "text": "def update\n if params[:send_button]\n @sender = User.find(params[:user_id])\n @message_sent = @sender.messages.find(params[:id])\n @message_sent.folder = \"sent\"\n @contact = @sender.contacts.where(:contact_name => params[:message][:name]).first\n if @contact.present? || params[:message][:to_user_id].present?\n if @contact.present?\n @message_sent.to_user_id = @contact.contact_id\n @recipient = User.find(@message_sent.to_user_id)\n @message_recieved = @recipient.messages.build(params[:message])\n @message_recieved.to_user_id = @contact.contact_id\n else\n @message_sent.to_user_id = params[:message][:to_user_id]\n @recipient = User.find(@message_sent.to_user_id)\n @message_recieved = @recipient.messages.build(params[:message])\n @message_recieved.to_user_id = params[:message][:to_user_id]\n end\n @message_recieved.thread_count = @message_sent.thread_count\n @message_recieved.folder = \"inbox\"\n if !@recipient.contacts.where(:contact_id => @sender.id).first.present?\n @new_contact = @recipient.contacts.build(:contact_name => @sender.name, :contact_id => @sender.id, :user_id => @recipient.id)\n @new_contact.save\n end\n end\n respond_to do |format|\n if @message_sent.update_attributes(params[:message]) && \n @message_recieved.update_attributes(params[:message]) && \n @message_sent.save && @message_recieved.save\n if @message_sent.thread_count == 0\n @message_sent.update_attribute(:parent_id, @message_sent.id)\n @message_recieved.update_attribute(:parent_id, @message_sent.id)\n else\n @message_recieved.update_attribute(:parent_id, @message_sent.parent_id)\n end\n format.html { redirect_to user_messages_path(@sender), notice: 'Message was successfully created.' }\n #format.json { render json: @message, status: :created, location: @message }\n format.json { head :no_content }\n else\n #format.html { render action: \"new\" }\n format.html { redirect_to user_messages_path(@sender), alert: 'Message was unsuccessfully created.' }\n format.json { render json: @message_sent.errors, status: :unprocessable_entity}\n end\n end\n \n else\n @user = User.find(params[:user_id])\n @message = @user.messages.find(params[:id]) \n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to user_messages_drafts_path(@user), notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "title": "" }, { "docid": "663d8e26fd4563886f958819b1e42cbe", "score": "0.5555157", "text": "def set_conversation\n @conversation = Conversation.find(params[:id])\n end", "title": "" }, { "docid": "663d8e26fd4563886f958819b1e42cbe", "score": "0.5555157", "text": "def set_conversation\n @conversation = Conversation.find(params[:id])\n end", "title": "" }, { "docid": "663d8e26fd4563886f958819b1e42cbe", "score": "0.5555157", "text": "def set_conversation\n @conversation = Conversation.find(params[:id])\n end", "title": "" }, { "docid": "663d8e26fd4563886f958819b1e42cbe", "score": "0.5555157", "text": "def set_conversation\n @conversation = Conversation.find(params[:id])\n end", "title": "" }, { "docid": "663d8e26fd4563886f958819b1e42cbe", "score": "0.5555157", "text": "def set_conversation\n @conversation = Conversation.find(params[:id])\n end", "title": "" }, { "docid": "4d885992a555781e3010d3a6c2d22d75", "score": "0.5543824", "text": "def update\n respond_to do |format|\n if @chat_room.update_attributes(params[:chat_room])\n format.html { redirect_to @chat_room, notice: 'Chat room was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @chat_room.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a67b079364d1fda9fc8f62901b71c8be", "score": "0.5540236", "text": "def update(options)\n message = symbolize_keys(options)\n\n debug \"Sending via Web API\", message\n client.web_client.chat_update(message)\n end", "title": "" }, { "docid": "f973df473d5bc49d6e72b1622339af71", "score": "0.553968", "text": "def update\n if @message.update(message_params)\n render json: @message\n else\n render json: @message.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "a58722b232d64320a7c5654ff71a5490", "score": "0.5533606", "text": "def edit_message(message_id, builder: nil, content: nil, embeds: nil, allowed_mentions: nil)\n builder ||= Builder.new\n\n yield builder if block_given?\n\n data = builder.to_json_hash.merge({ content: content, embeds: embeds, allowed_mentions: allowed_mentions }.compact)\n RestClient.patch(\"#{@url}/messages/#{message_id}\", data.compact.to_json, content_type: :json)\n end", "title": "" }, { "docid": "69c85045be8cd9b6c4e1eb892a8a3606", "score": "0.5526889", "text": "def conversation\n @user = User.find(params[:id])\n @messages = Message.find(:all, :conditions => [\"((messages.user_id = #{current_user.id} and messages.receiver_id = #{params[:id]}) and messages.user_status != 'deleted') or ((messages.receiver_id = #{current_user.id} and messages.user_id = #{params[:id]}) and messages.receiver_status != 'deleted')\"], :order => \"created_at Desc\")\n for message in @messages\n if message.receiver_id == current_user.id\n message.update_attribute(:receiver_status, \"read\") if message.receiver_status == \"unread\"\n end\n end\n respond_to do |format|\n format.xml { render :xml => @messages }\n format.json { render :json => @messages }\n end\n end", "title": "" }, { "docid": "9e413083b856cc148561624ef4aff35e", "score": "0.55188215", "text": "def update\n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8b3d58a02e990f36d5d859f16a898bc4", "score": "0.551679", "text": "def update\n @contact = current_user.contacts.find(params[:contact_id])\n @request = @contact.requests.find(params[:id])\n\n respond_with @request do |format|\n if @request.update_attributes(params[:request])\n @requests = @contact.requests.last_requests\n format.html { redirect_to(contact_requests_path, :notice => t('messages.updated')) }\n else\n format.html { render :action => \"edit\" }\n end\n end\n end", "title": "" }, { "docid": "341c7e293193607de20999a3ce75b1ff", "score": "0.5509563", "text": "def patch_conversations_chat(conversation_id, body, opts = {})\n data, _status_code, _headers = patch_conversations_chat_with_http_info(conversation_id, body, opts)\n return data\n end", "title": "" }, { "docid": "b2451430e6452d6574defa5e9d1e6e9a", "score": "0.55065376", "text": "def update\n @chatcontent = Chatcontent.find(params[:id])\n\n respond_to do |format|\n if @chatcontent.update_attributes(params[:chatcontent])\n format.html { redirect_to @chatcontent, notice: 'Chatcontent was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @chatcontent.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "074f67381aa6ce93c08b15ac4740aa18", "score": "0.55012757", "text": "def update\n webhook.update(webhook_params)\n respond_with(webhook)\n end", "title": "" }, { "docid": "c1e2841eefa5e36400d33bb1e1336c78", "score": "0.5487738", "text": "def update\n @message = Message.find(params[:id])\n\n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to outbox_path, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0b5ef9877c032e56bb02aceee6b689ae", "score": "0.5484287", "text": "def update\n if request.headers[\"Authorization\"] == \"Basic 78f91d346838110d9edb6be3996624a9\"\n @message = Message.find(params[:id])\n\n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "title": "" }, { "docid": "50d8572a3e974fed9463ae2f216f600a", "score": "0.5484212", "text": "def patch_conversations_message(conversation_id, body, opts = {})\n data, _status_code, _headers = patch_conversations_message_with_http_info(conversation_id, body, opts)\n return data\n end", "title": "" }, { "docid": "850de048f3abda626f84067c710d4a15", "score": "0.54836243", "text": "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", "title": "" }, { "docid": "32625a264e4936d77a8ef87f2f0035ac", "score": "0.54757786", "text": "def update\n @post = Post.find(@chat.post_id)\n respond_to do |format|\n if @chat.update(chat_params)\n format.html { redirect_to @post, notice: 'Chat was successfully updated.' }\n format.json { render :show, status: :ok, location: @chat }\n else\n format.html { render :edit }\n format.json { render json: @chat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0e8581e0e6e64e056fa43e94b47d47d9", "score": "0.5473866", "text": "def update\n @reply = Reply.find(params[:id])\n\n if @reply.update(params[:reply])\n head :no_content\n else\n render json: @reply.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "d53626910eda544c4dd399bc6dcc4de2", "score": "0.5473234", "text": "def update\n respond_to do |format|\n if @reply.update(reply_params)\n format.html { redirect_to @reply, notice: 'Replie was successfully updated.' }\n format.json { render :show, status: :ok, location: @reply }\n else\n format.html { render :edit }\n format.json { render json: @reply.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3d141337655c2c2ce67dddf0ddfffbe6", "score": "0.5470691", "text": "def update\n if @message.update(message_params)\n render json: @message, status: :ok\n else\n render json: @message.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "6bd46689559d253256c92eb1866ff793", "score": "0.546969", "text": "def update\n respond_to do |format|\n if @reply.update(reply_params)\n format.html { redirect_to @reply, notice: 'Reply was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @reply.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b5725b861cb1cd37995673c424a38b1d", "score": "0.5463814", "text": "def update\n respond_to do |format|\n if @coversation.update(coversation_params)\n format.html { redirect_to @coversation, notice: 'Coversation was successfully updated.' }\n format.json { render :show, status: :ok, location: @coversation }\n else\n format.html { render :edit }\n format.json { render json: @coversation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3f1eb087bb7f4d2ddf56374217c9478b", "score": "0.54605335", "text": "def update\n @webhook = Webhook.find(params[:id])\n\n respond_to do |format|\n if @webhook.update_attributes(params[:webhook])\n format.html { redirect_to @webhook, notice: 'Webhook was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @webhook.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e40f23b6405cd5f1204032df78deefa5", "score": "0.54558027", "text": "def update\n webhook.update_attributes(webhook_params)\n respond_with(webhook)\n end", "title": "" }, { "docid": "80e5652456a42383ca4826326c30f1cc", "score": "0.5455379", "text": "def update\n respond_to do |format|\n if @msg.update(msg_params)\n format.html { redirect_to @msg, notice: 'Msg was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @msg.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c8d415f013747ca5ec5fb50293c47b42", "score": "0.5443794", "text": "def update\n respond_to do |format|\n if @auto_message.update(auto_message_params)\n format.html { redirect_to @auto_message, notice: 'Auto message was successfully updated.' }\n format.json { render :show, status: :ok, location: @auto_message }\n else\n format.html { render :edit }\n format.json { render json: @auto_message.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7a639c6db741334e7d5cc358c895b174", "score": "0.5436909", "text": "def update\n respond_to do |format|\n if @verb.update(verb_params)\n format.html { redirect_to @verb, notice: 'Verb was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @verb.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "855440faaba0a7cfdb81a68c63890c00", "score": "0.54349715", "text": "def update\n\n params[:client][:contact_ids] ||= []\n @client = Client.find(params[:id])\n\n respond_to do |format|\n if @client.update_attributes(params[:client])\n format.html { redirect_to @client, notice: 'Client was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "968091470438e9768f0dfcd9b6097ba7", "score": "0.54349494", "text": "def edit\n render json: Passage.find(params[:id])\n end", "title": "" }, { "docid": "8a3788a716202fd5a7bf66ae4bf8c1c9", "score": "0.54330105", "text": "def set_conversation\n @conversation = Conversation.find(params[:id])\n end", "title": "" }, { "docid": "8a3788a716202fd5a7bf66ae4bf8c1c9", "score": "0.54330105", "text": "def set_conversation\n @conversation = Conversation.find(params[:id])\n end", "title": "" } ]
f5d89b0fdbdca8f90196a5aba96fa331
Defines a country with an ISO 31661 alpha2 country code and name.
[ { "docid": "572af35f16c1e994487fce9f628fcdbb", "score": "0.7671598", "text": "def country(code, name); end", "title": "" } ]
[ { "docid": "09d29886b74da88db24ee91f79fc73c5", "score": "0.72336644", "text": "def country\n @country ||= IsoCountryCodes.find(alpha2)\n end", "title": "" }, { "docid": "c50579e61b9473c49200d80918955763", "score": "0.7165545", "text": "def country=(value)\n @country = value\n\n @format = case country_code\n when nil, '' then nil\n else LocalPostal::Format.from_country_code(country_code)\n end\n end", "title": "" }, { "docid": "a7d0d6d2bf861c1c7089ac023969176d", "score": "0.71480924", "text": "def country\n ISO3166::Country[@country_code]\n end", "title": "" }, { "docid": "a3fbd85e247e0b7d4291c0ffaaba6d84", "score": "0.7065198", "text": "def iso3166_alpha2_code_from_name(orig_country_name)\n country_name = orig_country_name&.strip\n\n return \"US\" if ACCEPTABLE_USA_VARIATIONS.include?(country_name&.downcase)\n\n iso3166_code = ISO3166::Country.find_country_by_name(country_name)\n iso3166_code = ISO3166::Country.find_country_by_alpha3(country_name) if iso3166_code.blank?\n\n if iso3166_code.blank?\n fail InvalidCountryNameError, \"no ISO 3166 country code found for \\\"#{country_name}\\\"\"\n end\n\n iso3166_code.alpha2\n end", "title": "" }, { "docid": "60f3ef68ca7daa77fac3a5887fe64eb3", "score": "0.7020514", "text": "def country_name\n ISO3166::Country[country_code].name if country_code.present?\n end", "title": "" }, { "docid": "afd900e5ff7bdaf25ad54e9ae39b6129", "score": "0.6915439", "text": "def country_code_alpha2\n country_code == 'EL' ? 'GR' : country_code\n end", "title": "" }, { "docid": "969c0ecd6fe64ea69e09edfa40ad2c03", "score": "0.67721045", "text": "def hard_code_to_create_country(iso_name, iso, iso3, name, numcode, states_required, zipcode_required)\n @country = Spree::Country.create(iso_name: iso_name, iso: iso, iso3: iso3, name: name, numcode: numcode, states_required: states_required, zipcode_required: zipcode_required)\n if @country.save\n puts 'Successful!'\n else\n puts @country.errors.full_messages\n end\n end", "title": "" }, { "docid": "687ea879c8dc24936b0952ec9b2f54a3", "score": "0.67649555", "text": "def address_country=(v)\n @address_country = alma_string v\n end", "title": "" }, { "docid": "a82bc7ef8c8af7eb82b98adff8a08dd6", "score": "0.67334056", "text": "def country_name(country_code)\n country = ISO3166::Country[country_code]\n country.name\n end", "title": "" }, { "docid": "6ab2eda12d7f57ef409613c6b03d301b", "score": "0.67017764", "text": "def country_name\n country = ISO3166::Country[country_code]\n country.translations[I18n.locale.to_s] || country.name\n end", "title": "" }, { "docid": "6ab2eda12d7f57ef409613c6b03d301b", "score": "0.67017764", "text": "def country_name\n country = ISO3166::Country[country_code]\n country.translations[I18n.locale.to_s] || country.name\n end", "title": "" }, { "docid": "6ab2eda12d7f57ef409613c6b03d301b", "score": "0.67017764", "text": "def country_name\n country = ISO3166::Country[country_code]\n country.translations[I18n.locale.to_s] || country.name\n end", "title": "" }, { "docid": "ce89a2998310e33c19e2d0da76a782df", "score": "0.66923326", "text": "def country\n if(@country_code.to_i == 280)\n IsoCountryCodes.find(276) #since 1990 we use 176 for whole germany, 280 was for \"west germany\" WTF\n else\n IsoCountryCodes.find(@country_code)\n end\n end", "title": "" }, { "docid": "08cc01315c19a8a77685099ca3739ae0", "score": "0.66782767", "text": "def country_name\n iso_country = ISO3166::Country[country] # `country` should be code like 'AU'\n iso_country.translations[I18n.locale.to_s] || iso_country.name\n end", "title": "" }, { "docid": "b683fa47b82f5c1650594631bf342895", "score": "0.66552", "text": "def country_name\n country = ISO3166::Country[country_code]\n # country.translations[I18n.locale.to_s] || country.name\n # country.name\n end", "title": "" }, { "docid": "498bc3e2b3ba4031e00de68f28e87430", "score": "0.6653658", "text": "def carmen_country\n return unless country.is_a?(String)\n\n Carmen::Country.named(country) || Carmen::Country.coded(country)\n end", "title": "" }, { "docid": "2ee10866b3661e8ddb580a742a1c7e50", "score": "0.6630797", "text": "def country(code)\n\t\tcase code\n\t\t\twhen \"AD\"\tthen \"Andorra\"\n\t\t\twhen \"AE\"\tthen \"United Arab Emirates\"\n\t\t\twhen \"AF\"\tthen \"Afghanistan\"\n\t\t\twhen \"AG\"\tthen \"Antigua and Barbuda\"\n\t\t\twhen \"AI\"\tthen \"Anguilla\"\n\t\t\twhen \"AL\"\tthen \"Albania\"\n\t\t\twhen \"AM\"\tthen \"Armenia\"\n\t\t\twhen \"AO\"\tthen \"Angola\"\n\t\t\twhen \"AR\"\tthen \"Argentina\"\n\t\t\twhen \"AS\"\tthen \"American Samoa\"\n\t\t\twhen \"AT\"\tthen \"Austria\"\n\t\t\twhen \"AU\"\tthen \"Australia\"\n\t\t\twhen \"AW\"\tthen \"Aruba\"\n\t\t\twhen \"AX\"\tthen \"Aland Islands\"\n\t\t\twhen \"AZ\"\tthen \"Azerbaijan\"\n\t\t\twhen \"BA\"\tthen \"Bosnia and Herzegovina\"\n\t\t\twhen \"BB\"\tthen \"Barbados\"\n\t\t\twhen \"BD\"\tthen \"Bangladesh\"\n\t\t\twhen \"BE\"\tthen \"Belgium\"\n\t\t\twhen \"BF\"\tthen \"Burkina Faso\"\n\t\t\twhen \"BG\"\tthen \"Bulgaria\"\n\t\t\twhen \"BH\"\tthen \"Bahrain\"\n\t\t\twhen \"BI\"\tthen \"Burundi\"\n\t\t\twhen \"BJ\"\tthen \"Benin\"\n\t\t\twhen \"BL\"\tthen \"Saint Barthelemy\"\n\t\t\twhen \"BN\"\tthen \"Brunei Darussalam\"\n\t\t\twhen \"BO\"\tthen \"Bolivia\"\n\t\t\twhen \"BM\"\tthen \"Bermuda\"\n\t\t\twhen \"BQ\"\tthen \"Bonaire Saint Eustachius and Saba\"\n\t\t\twhen \"BR\"\tthen \"Brazil\"\n\t\t\twhen \"BS\"\tthen \"Bahamas\"\n\t\t\twhen \"BT\"\tthen \"Bhutan\"\n\t\t\twhen \"BV\"\tthen \"Bouvet Island\"\n\t\t\twhen \"BW\"\tthen \"Botswana\"\n\t\t\twhen \"BY\"\tthen \"Belarus\"\n\t\t\twhen \"BZ\"\tthen \"Belize\"\n\t\t\twhen \"CA\"\tthen \"Canada\"\n\t\t\twhen \"CC\"\tthen \"Cocos (Keeling) Islands\"\n\t\t\twhen \"CD\"\tthen \"Democratic Republic of Congo\"\n\t\t\twhen \"CF\"\tthen \"Central African Republic\"\n\t\t\twhen \"CG\"\tthen \"Republic of Congo\"\n\t\t\twhen \"CH\"\tthen \"Switzerland\"\n\t\t\twhen \"CI\"\tthen \"Côte d'Ivoire\"\n\t\t\twhen \"CK\"\tthen \"Cook Islands\"\n\t\t\twhen \"CL\"\tthen \"Chile\"\n\t\t\twhen \"CM\"\tthen \"Cameroon\"\n\t\t\twhen \"CN\"\tthen \"China\"\n\t\t\twhen \"CO\"\tthen \"Colombia\"\n\t\t\twhen \"CR\"\tthen \"Costa Rica\"\n\t\t\twhen \"CU\"\tthen \"Cuba\"\n\t\t\twhen \"CV\"\tthen \"Cape Verde\"\n\t\t\twhen \"CW\"\tthen \"Curaçao\"\n\t\t\twhen \"CX\"\tthen \"Christmas Island\"\n\t\t\twhen \"CY\"\tthen \"Cyprus\"\n\t\t\twhen \"CZ\"\tthen \"Czech Republic\"\n\t\t\twhen \"DE\"\tthen \"Germany\"\n\t\t\twhen \"DJ\"\tthen \"Djibouti\"\n\t\t\twhen \"DK\"\tthen \"Denmark\"\n\t\t\twhen \"DM\"\tthen \"Dominica\"\n\t\t\twhen \"DO\"\tthen \"Dominican Republic\"\n\t\t\twhen \"DZ\"\tthen \"Algeria\"\n\t\t\twhen \"EC\"\tthen \"Ecuador\"\n\t\t\twhen \"EG\"\tthen \"Egypt\"\n\t\t\twhen \"EE\"\tthen \"Estonia\"\n\t\t\twhen \"EH\"\tthen \"Western Sahara\"\n\t\t\twhen \"ER\"\tthen \"Eritrea\"\n\t\t\twhen \"ES\"\tthen \"Spain\"\n\t\t\twhen \"ET\"\tthen \"Ethiopia\"\n\t\t\twhen \"FI\"\tthen \"Finland\"\n\t\t\twhen \"FJ\"\tthen \"Fiji\"\n\t\t\twhen \"FK\"\tthen \"Falkland Islands\"\n\t\t\twhen \"FM\"\tthen \"Federated States of Micronesia\"\n\t\t\twhen \"FO\"\tthen \"Faroe Islands\"\n\t\t\twhen \"FR\"\tthen \"France\"\n\t\t\twhen \"GA\"\tthen \"Gabon\"\n\t\t\twhen \"GB\"\tthen \"United Kingdom\"\n\t\t\twhen \"GE\"\tthen \"Georgia\"\n\t\t\twhen \"GD\"\tthen \"Grenada\"\n\t\t\twhen \"GF\"\tthen \"French Guiana\"\n\t\t\twhen \"GG\"\tthen \"Guernsey\"\n\t\t\twhen \"GH\"\tthen \"Ghana\"\n\t\t\twhen \"GI\"\tthen \"Gibraltar\"\n\t\t\twhen \"GL\"\tthen \"Greenland\"\n\t\t\twhen \"GM\"\tthen \"Gambia\"\n\t\t\twhen \"GN\"\tthen \"Guinea\"\n\t\t\twhen \"GO\"\tthen \"Glorioso Islands\"\n\t\t\twhen \"GP\"\tthen \"Guadeloupe\"\n\t\t\twhen \"GQ\"\tthen \"Equatorial Guinea\"\n\t\t\twhen \"GR\"\tthen \"Greece\"\n\t\t\twhen \"GS\"\tthen \"South Georgia and South Sandwich Islands\"\n\t\t\twhen \"GT\"\tthen \"Guatemala\"\n\t\t\twhen \"GU\"\tthen \"Guam\"\n\t\t\twhen \"GW\"\tthen \"Guinea-Bissau\"\n\t\t\twhen \"GY\"\tthen \"Guyana\"\n\t\t\twhen \"HK\"\tthen \"Hong Kong\"\n\t\t\twhen \"HM\"\tthen \"Heard Island and McDonald Islands\"\n\t\t\twhen \"HN\"\tthen \"Honduras\"\n\t\t\twhen \"HR\"\tthen \"Croatia\"\n\t\t\twhen \"HT\"\tthen \"Haiti\"\n\t\t\twhen \"HU\"\tthen \"Hungary\"\n\t\t\twhen \"ID\"\tthen \"Indonesia\"\n\t\t\twhen \"IE\"\tthen \"Ireland\"\n\t\t\twhen \"IL\"\tthen \"Israel\"\n\t\t\twhen \"IM\"\tthen \"Isle of Man\"\n\t\t\twhen \"IN\"\tthen \"India\"\n\t\t\twhen \"IO\"\tthen \"British Indian Ocean Territory\"\n\t\t\twhen \"IQ\"\tthen \"Iraq\"\n\t\t\twhen \"IR\"\tthen \"Iran\"\n\t\t\twhen \"IS\"\tthen \"Iceland\"\n\t\t\twhen \"IT\"\tthen \"Italy\"\n\t\t\twhen \"JE\"\tthen \"Jersey\"\n\t\t\twhen \"JM\"\tthen \"Jamaica\"\n\t\t\twhen \"JO\"\tthen \"Jordan\"\n\t\t\twhen \"JP\"\tthen \"Japan\"\n\t\t\twhen \"JU\"\tthen \"Juan De Nova Island\"\n\t\t\twhen \"KE\"\tthen \"Kenya\"\n\t\t\twhen \"KG\"\tthen \"Kyrgyzstan\"\n\t\t\twhen \"KH\"\tthen \"Cambodia\"\n\t\t\twhen \"KI\"\tthen \"Kiribati\"\n\t\t\twhen \"KM\"\tthen \"Comoros\"\n\t\t\twhen \"KN\"\tthen \"Saint Kitts and Nevis\"\n\t\t\twhen \"KP\"\tthen \"North Korea\"\n\t\t\twhen \"KR\"\tthen \"South Korea\"\n\t\t\twhen \"XK\"\tthen \"Kosovo\"\n\t\t\twhen \"KW\"\tthen \"Kuwait\"\n\t\t\twhen \"KY\"\tthen \"Cayman Islands\"\n\t\t\twhen \"KZ\"\tthen \"Kazakhstan\"\n\t\t\twhen \"LA\"\tthen \"Lao People's Democratic Republic\"\n\t\t\twhen \"LB\"\tthen \"Lebanon\"\n\t\t\twhen \"LC\"\tthen \"Saint Lucia\"\n\t\t\twhen \"LI\"\tthen \"Liechtenstein\"\n\t\t\twhen \"LK\"\tthen \"Sri Lanka\"\n\t\t\twhen \"LR\"\tthen \"Liberia\"\n\t\t\twhen \"LS\"\tthen \"Lesotho\"\n\t\t\twhen \"LT\"\tthen \"Lithuania\"\n\t\t\twhen \"LU\"\tthen \"Luxembourg\"\n\t\t\twhen \"LV\"\tthen \"Latvia\"\n\t\t\twhen \"LY\"\tthen \"Libya\"\n\t\t\twhen \"MA\"\tthen \"Morocco\"\n\t\t\twhen \"MC\"\tthen \"Monaco\"\n\t\t\twhen \"MD\"\tthen \"Moldova\"\n\t\t\twhen \"MG\"\tthen \"Madagascar\"\n\t\t\twhen \"ME\"\tthen \"Montenegro\"\n\t\t\twhen \"MF\"\tthen \"Saint Martin\"\n\t\t\twhen \"MH\"\tthen \"Marshall Islands\"\n\t\t\twhen \"MK\"\tthen \"Macedonia\"\n\t\t\twhen \"ML\"\tthen \"Mali\"\n\t\t\twhen \"MO\"\tthen \"Macau\"\n\t\t\twhen \"MM\"\tthen \"Myanmar\"\n\t\t\twhen \"MN\"\tthen \"Mongolia\"\n\t\t\twhen \"MP\"\tthen \"Northern Mariana Islands\"\n\t\t\twhen \"MQ\"\tthen \"Martinique\"\n\t\t\twhen \"MR\"\tthen \"Mauritania\"\n\t\t\twhen \"MS\"\tthen \"Montserrat\"\n\t\t\twhen \"MT\"\tthen \"Malta\"\n\t\t\twhen \"MU\"\tthen \"Mauritius\"\n\t\t\twhen \"MV\"\tthen \"Maldives\"\n\t\t\twhen \"MW\"\tthen \"Malawi\"\n\t\t\twhen \"MX\"\tthen \"Mexico\"\n\t\t\twhen \"MY\"\tthen \"Malaysia\"\n\t\t\twhen \"MZ\"\tthen \"Mozambique\"\n\t\t\twhen \"NA\"\tthen \"Namibia\"\n\t\t\twhen \"NC\"\tthen \"New Caledonia\"\n\t\t\twhen \"NE\"\tthen \"Niger\"\n\t\t\twhen \"NF\"\tthen \"Norfolk Island\"\n\t\t\twhen \"NG\"\tthen \"Nigeria\"\n\t\t\twhen \"NI\"\tthen \"Nicaragua\"\n\t\t\twhen \"NL\"\tthen \"Netherlands\"\n\t\t\twhen \"NO\"\tthen \"Norway\"\n\t\t\twhen \"NP\"\tthen \"Nepal\"\n\t\t\twhen \"NR\"\tthen \"Nauru\"\n\t\t\twhen \"NU\"\tthen \"Niue\"\n\t\t\twhen \"NZ\"\tthen \"New Zealand\"\n\t\t\twhen \"OM\"\tthen \"Oman\"\n\t\t\twhen \"PA\"\tthen \"Panama\"\n\t\t\twhen \"PE\"\tthen \"Peru\"\n\t\t\twhen \"PF\"\tthen \"French Polynesia\"\n\t\t\twhen \"PG\"\tthen \"Papua New Guinea\"\n\t\t\twhen \"PH\"\tthen \"Philippines\"\n\t\t\twhen \"PK\"\tthen \"Pakistan\"\n\t\t\twhen \"PL\"\tthen \"Poland\"\n\t\t\twhen \"PM\"\tthen \"Saint Pierre and Miquelon\"\n\t\t\twhen \"PN\"\tthen \"Pitcairn Islands\"\n\t\t\twhen \"PR\"\tthen \"Puerto Rico\"\n\t\t\twhen \"PS\"\tthen \"Palestinian Territories\"\n\t\t\twhen \"PT\"\tthen \"Portugal\"\n\t\t\twhen \"PW\"\tthen \"Palau\"\n\t\t\twhen \"PY\"\tthen \"Paraguay\"\n\t\t\twhen \"QA\"\tthen \"Qatar\"\n\t\t\twhen \"RE\"\tthen \"Reunion\"\n\t\t\twhen \"RO\"\tthen \"Romania\"\n\t\t\twhen \"RS\"\tthen \"Serbia\"\n\t\t\twhen \"RU\"\tthen \"Russia\"\n\t\t\twhen \"RW\"\tthen \"Rwanda\"\n\t\t\twhen \"SA\"\tthen \"Saudi Arabia\"\n\t\t\twhen \"SB\"\tthen \"Solomon Islands\"\n\t\t\twhen \"SC\"\tthen \"Seychelles\"\n\t\t\twhen \"SD\"\tthen \"Sudan\"\n\t\t\twhen \"SE\"\tthen \"Sweden\"\n\t\t\twhen \"SG\"\tthen \"Singapore\"\n\t\t\twhen \"SH\"\tthen \"Saint Helena\"\n\t\t\twhen \"SI\"\tthen \"Slovenia\"\n\t\t\twhen \"SJ\"\tthen \"Svalbard and Jan Mayen\"\n\t\t\twhen \"SK\"\tthen \"Slovakia\"\n\t\t\twhen \"SL\"\tthen \"Sierra Leone\"\n\t\t\twhen \"SM\"\tthen \"San Marino\"\n\t\t\twhen \"SN\"\tthen \"Senegal\"\n\t\t\twhen \"SO\"\tthen \"Somalia\"\n\t\t\twhen \"SR\"\tthen \"Suriname\"\n\t\t\twhen \"SS\"\tthen \"South Sudan\"\n\t\t\twhen \"ST\"\tthen \"Sao Tome and Principe\"\n\t\t\twhen \"SV\"\tthen \"El Salvador\"\n\t\t\twhen \"SX\"\tthen \"Saint Martin\"\n\t\t\twhen \"SY\"\tthen \"Syria\"\n\t\t\twhen \"SZ\"\tthen \"Swaziland\"\n\t\t\twhen \"TC\"\tthen \"Turks and Caicos Islands\"\n\t\t\twhen \"TD\"\tthen \"Chad\"\n\t\t\twhen \"TF\"\tthen \"French Southern and Antarctic Lands\"\n\t\t\twhen \"TG\"\tthen \"Togo\"\n\t\t\twhen \"TH\"\tthen \"Thailand\"\n\t\t\twhen \"TJ\"\tthen \"Tajikistan\"\n\t\t\twhen \"TK\"\tthen \"Tokelau\"\n\t\t\twhen \"TL\"\tthen \"Timor-Leste\"\n\t\t\twhen \"TM\"\tthen \"Turkmenistan\"\n\t\t\twhen \"TN\"\tthen \"Tunisia\"\n\t\t\twhen \"TO\"\tthen \"Tonga\"\n\t\t\twhen \"TR\"\tthen \"Turkey\"\n\t\t\twhen \"TT\"\tthen \"Trinidad and Tobago\"\n\t\t\twhen \"TV\"\tthen \"Tuvalu\"\n\t\t\twhen \"TW\"\tthen \"Taiwan\"\n\t\t\twhen \"TZ\"\tthen \"Tanzania\"\n\t\t\twhen \"UA\"\tthen \"Ukraine\"\n\t\t\twhen \"UG\"\tthen \"Uganda\"\n\t\t\twhen \"UM_DQ\"\tthen \"Jarvis Island\"\n\t\t\twhen \"UM_FQ\"\tthen \"Baker Island\"\n\t\t\twhen \"UM_HQ\"\tthen \"Howland Island\"\n\t\t\twhen \"UM_JQ\"\tthen \"Johnston Atoll\"\n\t\t\twhen \"UM_MQ\"\tthen \"Midway Islands\"\n\t\t\twhen \"UM_WQ\"\tthen \"Wake Island\"\n\t\t\twhen \"US\"\tthen \"United States\"\n\t\t\twhen \"UY\"\tthen \"Uruguay\"\n\t\t\twhen \"UZ\"\tthen \"Uzbekistan\"\n\t\t\twhen \"VA\"\tthen \"Vatican City\"\n\t\t\twhen \"VC\"\tthen \"Saint Vincent and the Grenadines\"\n\t\t\twhen \"VE\"\tthen \"Venezuela\"\n\t\t\twhen \"VG\"\tthen \"British Virgin Islands\"\n\t\t\twhen \"VI\"\tthen \"US Virgin Islands\"\n\t\t\twhen \"VN\"\tthen \"Vietnam\"\n\t\t\twhen \"VU\"\tthen \"Vanuatu\"\n\t\t\twhen \"WF\"\tthen \"Wallis and Futuna\"\n\t\t\twhen \"WS\"\tthen \"Samoa\"\n\t\t\twhen \"YE\"\tthen \"Yemen\"\n\t\t\twhen \"YT\"\tthen \"Mayotte\"\n\t\t\twhen \"ZA\"\tthen \"South Africa\"\n\t\t\twhen \"ZM\"\tthen \"Zambia\"\n\t\t\twhen \"ZW\"\tthen \"Zimbabwe\"\n\t\t\telse\n\t\t\t\t\"ERROR\"\n\t\tend\n\tend", "title": "" }, { "docid": "074c6e205b07b31307500544629b6ad6", "score": "0.66040385", "text": "def get_country_name_lib country_code\n country = Carmen::Country.coded(country_code)\n if country\n country.name\n else\n \"N/A\"\n end\n end", "title": "" }, { "docid": "db0eb24393a2272dd02dd312d7d058aa", "score": "0.6594086", "text": "def country=(value)\n\t\t\t@country = value\n\t\tend", "title": "" }, { "docid": "54c082d8b7be5982a130df06823df264", "score": "0.65464467", "text": "def format_country(country)\n return country if country == '' || country == 'Global'\n\n begin\n IsoCountryCodes.find(country).name\n rescue\n # Fallback to raw value\n country\n end\n end", "title": "" }, { "docid": "e1a925ba6636f65ced52ab7e0ac8284c", "score": "0.6539186", "text": "def country_code=(country_code)\n if !country_code.nil? && country_code.to_s.length > 2\n fail ArgumentError, 'invalid value for \"country_code\", the character length must be smaller than or equal to 2.'\n end\n\n pattern = Regexp.new(/^[A-Z]{2}$/)\n if !country_code.nil? && country_code !~ pattern\n fail ArgumentError, \"invalid value for \\\"country_code\\\", must conform to the pattern #{pattern}.\"\n end\n\n @country_code = country_code\n end", "title": "" }, { "docid": "7ee9664c43a76e76e0b1e4dd0a2d5454", "score": "0.65070915", "text": "def set_Country(value)\n set_input(\"Country\", value)\n end", "title": "" }, { "docid": "7ee9664c43a76e76e0b1e4dd0a2d5454", "score": "0.65070915", "text": "def set_Country(value)\n set_input(\"Country\", value)\n end", "title": "" }, { "docid": "7ee9664c43a76e76e0b1e4dd0a2d5454", "score": "0.65070915", "text": "def set_Country(value)\n set_input(\"Country\", value)\n end", "title": "" }, { "docid": "7ee9664c43a76e76e0b1e4dd0a2d5454", "score": "0.65070915", "text": "def set_Country(value)\n set_input(\"Country\", value)\n end", "title": "" }, { "docid": "7ee9664c43a76e76e0b1e4dd0a2d5454", "score": "0.65070915", "text": "def set_Country(value)\n set_input(\"Country\", value)\n end", "title": "" }, { "docid": "2aa5289bb3daac5e082d57e7a2c94507", "score": "0.64966965", "text": "def country_params\n params.require(:country).permit(\n :name, :display_name, :alpha_2, :alpha_3, :numeric_3, :note\n )\n end", "title": "" }, { "docid": "3364bffabfd8b18eb3ebb784bd8d6c52", "score": "0.6483702", "text": "def country_name\n countryfull = ISO3166::Country[country]\n countryfull.translations[I18n.locale.to_s] || countryfull.name\n end", "title": "" }, { "docid": "c0f5baab9378c2256bb37f67617470b6", "score": "0.6456276", "text": "def country_name\n cc = carmen_country\n\n cc ? \"#{cc.name}\" : ''\n end", "title": "" }, { "docid": "93d53ed1c6bcf725057ddc0960d2555e", "score": "0.64493304", "text": "def country_code=(value)\n @country_code = value\n end", "title": "" }, { "docid": "da44fd9e25936c9385b872dbdfe79a7e", "score": "0.64341664", "text": "def country=(args)\n @country = if args.is_a? ::Blackbird::Retoure::Country\n args\n else\n ::Blackbird::Retoure::Country.new(args)\n end\n end", "title": "" }, { "docid": "ea424d90903dab1be4dbf1a1b5e86cc3", "score": "0.6417267", "text": "def airport_country= name\n self.country = name if(self.country.blank?)\n end", "title": "" }, { "docid": "7363c9fb4a8656e468209deb2999d409", "score": "0.64077586", "text": "def set_Country(value)\n set_input(\"Country\", value)\n end", "title": "" }, { "docid": "61893ea0d0c59f5e2236cfe270d6995a", "score": "0.63634264", "text": "def country\n @country ||= begin\n valid_countries.find do |iso2|\n @data[iso2][Core::MAIN_COUNTRY_FOR_CODE] == 'true'\n end || valid_countries.first || countries.first\n end\n end", "title": "" }, { "docid": "497aa816d56c14e939a7bc58437fdbda", "score": "0.6336933", "text": "def country\n 'United Kingdom'\n end", "title": "" }, { "docid": "e2744bdd680c5c0a4ecb38502fc807ed", "score": "0.63318825", "text": "def ensure_CountryName\n\t\tif self.CountryName == \"\"\n\t\t\tself.CountryName = \"United States\"\n\t\tend\n\t\tif [\"AB\", \"BC\", \"MB\", \"NB\"].include?(self.State)\n\t\t\tself.CountryName = \"Canada\"\n\t\tend\n\tend", "title": "" }, { "docid": "e2744bdd680c5c0a4ecb38502fc807ed", "score": "0.63318825", "text": "def ensure_CountryName\n\t\tif self.CountryName == \"\"\n\t\t\tself.CountryName = \"United States\"\n\t\tend\n\t\tif [\"AB\", \"BC\", \"MB\", \"NB\"].include?(self.State)\n\t\t\tself.CountryName = \"Canada\"\n\t\tend\n\tend", "title": "" }, { "docid": "dea843e29bb592cb0da636add606ff93", "score": "0.63303584", "text": "def country_code\n cc = carmen_country\n\n cc ? \"#{cc.code.upcase}\" : nil\n end", "title": "" }, { "docid": "44e124ce427847e6cadd8585a3f1a6ea", "score": "0.6319347", "text": "def country_code\n \"+#{fetch('country_code')}\"\n end", "title": "" }, { "docid": "92a0a2f69b89a182709b496bbc0b5884", "score": "0.6302757", "text": "def get_country_name_from_code(country_code)\n if country_code.present?\n country = ISO3166::Country[country_code]\n country.translations[I18n.locale.to_s] || country.name\n end\n end", "title": "" }, { "docid": "d8eb339064741f625ae9513909ae8889", "score": "0.6292202", "text": "def country_name(multilingual = false)\n if self.country\n country_data = ISO3166::Country[self.country]\n\t\t\tif country_data and multilingual\n\t\t\t country_data.translations[I18n.locale.to_s] || country_data.name\n\t\t\telsif country_data\n\t\t\t country_data.name\n\t\t\telse\n\t\t\t self.country\n\t\t\tend\n else\n \"\"\n end\n end", "title": "" }, { "docid": "2a36e57f6816b6733b356221a6b68632", "score": "0.6291867", "text": "def country_name=(country_name)\n if !country_name.nil? && country_name.to_s.length > 64\n fail ArgumentError, 'invalid value for \"country_name\", the character length must be smaller than or equal to 64.'\n end\n\n @country_name = country_name\n end", "title": "" }, { "docid": "70b6a7b151c0db338c7ad4978e2e1d9d", "score": "0.6286354", "text": "def name_to_iso_code(name)\n {\n 'Cambodia' => 'KH',\n 'Gibraltar' => 'GI',\n 'Ivory Coast' => 'CI',\n 'Latvia' => 'LV',\n 'Mozambique' => 'MZ',\n 'Norway' => 'NO',\n 'Slovenia' => 'SI',\n 'Tuvalu' => 'TV',\n }[name]\n end", "title": "" }, { "docid": "281db3caba23bd2cf39f2820f156dde3", "score": "0.6279243", "text": "def country_code\n end", "title": "" }, { "docid": "a18c39285a9c28c2eb81ae2c7109a2d3", "score": "0.62741345", "text": "def country_code; end", "title": "" }, { "docid": "a18c39285a9c28c2eb81ae2c7109a2d3", "score": "0.62741345", "text": "def country_code; end", "title": "" }, { "docid": "711a4a52b7b0e60d372009133b6303a6", "score": "0.6241838", "text": "def country(opts = {})\n data, _status_code, _headers = country_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "f2d63d2881bd08f1800b5a21f8931720", "score": "0.62272006", "text": "def initialize(new_country_name)\n @country_name = new_country_name\n if !@country_name.nil?\n @url = @@URI_PREFIX + @country_name.gsub(\" \", \"_\").gsub(\"USA\", \"United_States_of_America\")\n @root_node = nil\n begin\n fetch_rdf\n rescue => e\n $log.error(\"Not able to get country information, through exception: #{e}\")\n end\n end\n end", "title": "" }, { "docid": "c1b43f549238af5fb7622d388a59696f", "score": "0.6227172", "text": "def reserved country_code\n # Does nothing, will just fail with an exception.\n end", "title": "" }, { "docid": "22f45f2a91d7c9f82e45b7b5bd8aeca8", "score": "0.62133646", "text": "def normalize_country\n c = @data_object.add_country.strip\n\n c = c.downcase.gsub(/[\\. ]/, '').sub(/^the/, '')\n \n if US_MAP[c]\n @data_object.add_country = USA\n end\n\n end", "title": "" }, { "docid": "4329b88c5ce6383cf36803623d980caa", "score": "0.6203898", "text": "def set_country_name\n @country_name = CountryName.find( params[:id] )\n end", "title": "" }, { "docid": "f40bbc315edbaa7abaf6742a9ed19b4f", "score": "0.6181149", "text": "def set_country\n @country = Country.find_by_name(params[:name])\n end", "title": "" }, { "docid": "e34a20c66dd5d737f275e5ba7f2c2456", "score": "0.6179885", "text": "def country\n 'Australia'\n end", "title": "" }, { "docid": "5fa812b9a99dcc61cdf1dd3bd364ed71", "score": "0.6178805", "text": "def represented_country; end", "title": "" }, { "docid": "c6cbcb3c91e82bdc1b9e3f58c26fb238", "score": "0.6168815", "text": "def test_that_it_adds_the_default_country\n hash = PigeonBand.format(\"1-1-1\")\n assert_equal \"DE\", hash[:code]\n end", "title": "" }, { "docid": "e2ced2cbe51407a952658cc88fc4b514", "score": "0.61434215", "text": "def selected_country_code(address)\n address.country_code.blank? ? 'AU' : address.country_code\n end", "title": "" }, { "docid": "cc21c23be1ceea28cade3a7d5df59086", "score": "0.6141643", "text": "def country\n @country || @default_country || 'GB'\n end", "title": "" }, { "docid": "431a939126dc2c347b89dbe584901376", "score": "0.6102122", "text": "def set_country_for_partner_admin country\n contact_chg_country_select.select country\n end", "title": "" }, { "docid": "f850845004f07baf7fe516b17cf602ca", "score": "0.60941684", "text": "def country_code\n if self.uk?\n UK_COUNTRY_CODE\n else\n IE_COUNTRY_CODE\n end\n end", "title": "" }, { "docid": "934df5207d33abfdc2c001052ea1b13c", "score": "0.60884416", "text": "def set_country country\n wait_until {contact_chg_country_select.visible?}\n contact_chg_country_select.select country\n end", "title": "" }, { "docid": "e36ea3112315b43acf5d647dcfd9f41e", "score": "0.6088097", "text": "def default_code\n \"#{country}-#{abbreviation}\"\n end", "title": "" }, { "docid": "ebb98aa23d8844d6a888eedfb3fe10cd", "score": "0.6080147", "text": "def country_code=(country_code)\n if country_code\n if country_code.is_a?(String)\n @country_code = country_code.strip.upcase.to_sym\n elsif country_code.is_a?(Symbol)\n @country_code = country_code.upcase\n end\n end\n end", "title": "" }, { "docid": "e4d4f8b087a4477f1683aad472cfcbd5", "score": "0.6047002", "text": "def get_iso_country(country)\n #Kinda redundant but downcasing first makes the hardcoding a bit more obvious\n country = country.downcase\n\n if country == \"bosnia-herzogovnia\"\n country = \"bosnia and herzogovnia\"\n elsif country == \"russia\"\n country = \"russian federation\"\n elsif country == \"laos\"\n country = \"lao peoples democratic republic\"\n elsif country == \"iran\"\n country = \"islamic republic of iran\"\n elsif country == \"taiwan\"\n country = \"province of china taiwan\"\n elsif country == \"north korea\"\n country = \"democratic people's republic of korea\"\n elsif country == \"south korea\"\n country = \"republic of korea\"\n elsif country == \"basque spain\"\n country = \"spain\"\n elsif country == \"macedonia\"\n country = \"the former yugoslav republic of macedonia\"\n elsif country == \"tanzania\"\n country = \"united republic of tanzania\"\n elsif country == \"vietnam\"\n country = \"viet nam\"\n elsif country == \"venezuela\"\n country = \"bolivarian republic of venezuela\"\n elsif country == \"syria\"\n country = \"syrian arab republic\"\n elsif country == \"rep.dem.congo\"\n country = \"congo\"\n elsif country == \"dagestan\"\n country = \"russian federation\"\n elsif country == \"adygea\"\n country = \"russian federation\"\n elsif country == \"karachaevo circassia\"\n country = \"russian federation\"\n elsif country == \"tartarstan\"\n country = \"russian federation\"\n #elsif country == \"ivory coast\"\n # This seems like the wrong way of doing this but not sure how else to guarentee the match\n #country = \"CÔTE D'IVOIRE\".downcase\n end\n\n country = normalize(country)\n \n @@iso_country_codes.xpath(\"//ISO_3166-1_Entry\").each do |code|\n n_country = normalize(code.xpath(\"ISO_3166-1_Country_name\")[0].content)\n\n if (country.upcase == n_country.upcase)\n return code.xpath(\"ISO_3166-1_Alpha-2_Code_element\")[0].content\n end\n end\n return \"ZZ\"\n end", "title": "" }, { "docid": "30c978a1347358b4fb1e48836970f846", "score": "0.6041393", "text": "def country_code\n end", "title": "" }, { "docid": "5e4aab86508c56d8e71b7ddbd608d529", "score": "0.6023998", "text": "def ag_country_params\n params.require(:ag_country).permit(:name, :iso)\n end", "title": "" }, { "docid": "f8fc274bbd53876cf98770dbec2b376a", "score": "0.6011437", "text": "def country; end", "title": "" }, { "docid": "f8fc274bbd53876cf98770dbec2b376a", "score": "0.6011437", "text": "def country; end", "title": "" }, { "docid": "f8fc274bbd53876cf98770dbec2b376a", "score": "0.6011437", "text": "def country; end", "title": "" }, { "docid": "874b459545c4f4b564da0c451ed4e2e1", "score": "0.6000024", "text": "def set_country_from_http_accept_language\n\n #\"HTTP_ACCEPT_LANGUAGE\\\"=>\\\"en-us,en;q=0.5\\\"\n accept_language = request.env['HTTP_ACCEPT_LANGUAGE']\n \n language = 'en'\n locale = 'us'\n \n unless accept_language.nil?\n language = accept_language[0,2] unless accept_language.length < 2\n locale = accept_language[3,2] unless accept_language.length < 5\n end\n \n case locale\n when 'us' then\n @customer.country = 'US'\n when 'ca' then\n @customer.country = 'CA'\n when 'gb' then \n @customer.country = 'GB'\n end \n end", "title": "" }, { "docid": "8ffa12e05c6eeaf98ff23247ba13de78", "score": "0.59965885", "text": "def country_code\n @country_code.to_s\n end", "title": "" }, { "docid": "ef6e25e4d313d3993539429528447cf9", "score": "0.5993239", "text": "def load_country_info(code)\n raise_invalid_data_source('load_country_info')\n end", "title": "" }, { "docid": "e2acc8b396708066cd7d8e9c284f3bb2", "score": "0.5992791", "text": "def country_code=(code)\n self.country = Country.find_by_code(code)\n end", "title": "" }, { "docid": "c52a6c1621797f3f3c54d3ad48d03948", "score": "0.59741575", "text": "def country_code\n decode hash[\"CountryCode\"]\n end", "title": "" }, { "docid": "9da5fd5cfb6d7b64cd86fda5f0dfd61e", "score": "0.59734887", "text": "def country\n location[2] || location[1]\n end", "title": "" }, { "docid": "23c7a1148e556751ca5cc6e6ddd94852", "score": "0.5973331", "text": "def set_country\n id = params[:id]\n @country = Countries.list[id.to_i - 1]\n end", "title": "" }, { "docid": "48214e4f5c5328fe8948ab7b75b9a550", "score": "0.5968443", "text": "def set_country\n self.country = self.region.country if self.region && self.region.country\n end", "title": "" }, { "docid": "90972231f8bdc9fa010c36c606b7b151", "score": "0.5954315", "text": "def registered_country; end", "title": "" }, { "docid": "f178deafd0e162bf8f1b3e42ab0da1fe", "score": "0.5953567", "text": "def set_country\n @country = Country.friendly.find(params[:id])\n end", "title": "" }, { "docid": "930bafc89f9c16eab3498544f85eb9ec", "score": "0.5950755", "text": "def get_country_name( code )\n # Strip and lowercase code\n new_code = code.strip.downcase\n # Find country by code. If not found, default to empty string.\n country = $COUNTRIES.find do |record|\n record[:code] == new_code.downcase\n end || ''\n\n return country.length > 0 ? \"The country you selected is #{country[:name]}.\" :\n 'That country code is not in our database.'\nend", "title": "" }, { "docid": "05bb2da2eceab9cca616ee4d9980db58", "score": "0.59298277", "text": "def country\n self[:C]\n end", "title": "" }, { "docid": "720f4f30d92b763dbbe9ddfada6e4ef9", "score": "0.592971", "text": "def get_country_code\n Geonames::WebService.country_code @latitude, @longitude\n end", "title": "" }, { "docid": "ffbadd31a208551f8d7d78f06bf88768", "score": "0.59204364", "text": "def country_name_params\n params.require( :country_name ).permit( :id, :code, :label )\n end", "title": "" }, { "docid": "6a502138155a1ff7294852264d00875f", "score": "0.59147614", "text": "def country_code=(country_code)\n if !country_code.nil? && country_code.to_s.length > 8\n fail ArgumentError, 'invalid value for \"country_code\", the character length must be smaller than or equal to 8.'\n end\n\n @country_code = country_code\n end", "title": "" }, { "docid": "cbc77f5755d6ab9a5902a8fea10e7522", "score": "0.59012556", "text": "def country\n client.places.get_countries.select{|hash| hash[\"cid\"] == @params[:country].to_i}.first[:title]\n end", "title": "" }, { "docid": "74d3de08d22c732e1c3fbc6267663dbb", "score": "0.5898259", "text": "def country_code_map\r\n {\r\n 'Ägypten' => 'eg',\r\n 'Albanien' => 'al',\r\n 'Algerien' => 'dz',\r\n 'Argentinien' => 'ar',\r\n 'Australien' => 'au',\r\n 'Belgien' => 'be',\r\n 'Bosnien-Herzegowina' => 'ba',\r\n 'Brasilien' => 'br',\r\n 'Chile' => 'cl',\r\n 'Costa Rica' => 'cr',\r\n 'Dänemark' => 'dk',\r\n 'Deutschland' => 'de',\r\n 'Ecuador' => 'ec',\r\n 'Elfenbeinküste' => 'ci',\r\n 'England' => '_England',\r\n 'Frankreich' => 'fr',\r\n 'Ghana' => 'gh',\r\n 'Griechenland' => 'gr',\r\n 'Honduras' => 'hn',\r\n 'Iran' => 'ir',\r\n 'Irland' => 'ie',\r\n 'Island' => 'is',\r\n 'Italien' => 'it',\r\n 'Japan' => 'jp',\r\n 'Kamerun' => 'cm',\r\n 'Kolumbien' => 'co',\r\n 'Kroatien' => 'hr',\r\n 'Marokko' => 'ma',\r\n 'Mexiko' => 'mx',\r\n 'Niederlande' => 'nl',\r\n 'Nigeria' => 'ng',\r\n 'Nordirland' => '_Northern_Ireland',\r\n 'Österreich' => 'at',\r\n 'Panama' => 'pa',\r\n 'Peru' => 'pe',\r\n 'Polen' => 'pl',\r\n 'Portugal' => 'pt',\r\n 'Rumänien' => 'ro',\r\n 'Russland' => 'ru',\r\n 'Saudi-Arabien' => 'sa',\r\n 'Schweden' => 'se',\r\n 'Schweiz' => 'ch',\r\n 'Senegal' => 'sn',\r\n 'Serbien' => 'rs',\r\n 'Slowakei' => 'sk',\r\n 'Spanien' => 'es',\r\n 'Südkorea' => 'kr',\r\n 'Tschechien' => 'cz',\r\n 'Tunesien' => 'tn',\r\n 'Türkei' => 'tr',\r\n 'Ukraine' => 'ua',\r\n 'Ungarn' => 'hu',\r\n 'USA' => 'us',\r\n 'Uruguay' => 'uy',\r\n 'Wales' => '_Wales'\r\n }\r\nend", "title": "" }, { "docid": "0a4b35e8c6e91026508982816d668bd3", "score": "0.5895612", "text": "def country_code_map\r\n {\r\n 'Ägypten' => 'eg',\r\n 'Albanien' => 'al',\r\n 'Algerien' => 'dz',\r\n 'Argentinien' => 'ar',\r\n 'Australien' => 'au',\r\n 'Belgien' => 'be',\r\n 'Bosnien-Herzegowina' => 'ba',\r\n 'Brasilien' => 'br',\r\n 'Chile' => 'cl',\r\n 'Costa Rica' => 'cr',\r\n 'Dänemark' => 'dk',\r\n 'Deutschland' => 'de',\r\n 'Ecuador' => 'ec',\r\n 'Elfenbeinküste' => 'ci',\r\n 'England' => '_England',\r\n 'Finnland' => 'fi',\r\n 'Frankreich' => 'fr',\r\n 'Ghana' => 'gh',\r\n 'Griechenland' => 'gr',\r\n 'Honduras' => 'hn',\r\n 'Iran' => 'ir',\r\n 'Irland' => 'ie',\r\n 'Island' => 'is',\r\n 'Italien' => 'it',\r\n 'Japan' => 'jp',\r\n 'Kamerun' => 'cm',\r\n 'Kanada' => 'ca',\r\n 'Katar' => 'kz',\r\n 'Kolumbien' => 'co',\r\n 'Kroatien' => 'hr',\r\n 'Marokko' => 'ma',\r\n 'Mexiko' => 'mx',\r\n 'Niederlande' => 'nl',\r\n 'Nigeria' => 'ng',\r\n 'Nordirland' => '_Northern_Ireland',\r\n 'Nordmazedonien' => 'mk',\r\n 'Österreich' => 'at',\r\n 'Panama' => 'pa',\r\n 'Peru' => 'pe',\r\n 'Polen' => 'pl',\r\n 'Portugal' => 'pt',\r\n 'Rumänien' => 'ro',\r\n 'Russland' => 'ru',\r\n 'Saudi-Arabien' => 'sa',\r\n 'Schottland' => '_Scotland',\r\n 'Schweden' => 'se',\r\n 'Schweiz' => 'ch',\r\n 'Senegal' => 'sn',\r\n 'Serbien' => 'rs',\r\n 'Slowakei' => 'sk',\r\n 'Spanien' => 'es',\r\n 'Südkorea' => 'kr',\r\n 'Tschechien' => 'cz',\r\n 'Tunesien' => 'tn',\r\n 'Türkei' => 'tr',\r\n 'Ukraine' => 'ua',\r\n 'Ungarn' => 'hu',\r\n 'USA' => 'us',\r\n 'Uruguay' => 'uy',\r\n 'Wales' => '_Wales'\r\n }\r\nend", "title": "" }, { "docid": "10950e29b9ad923fb1601d7e5aedca96", "score": "0.5890571", "text": "def country_codes\n raise_invalid_data_source('country_codes')\n end", "title": "" }, { "docid": "e73ab853321c01c3e74ce6c4e02fb01b", "score": "0.58889294", "text": "def country_select(country)\n select(country, :from => countryname[:id])\n end", "title": "" }, { "docid": "b939a980ca4ac8a0c05ff8012fcee695", "score": "0.5881042", "text": "def country\n query_root_node(\"gdacs:country/text()\", @@NAMESPACES)\n end", "title": "" }, { "docid": "da40af3d13ee1b88fd9eb9a9b5ccc5ba", "score": "0.5865472", "text": "def set_CountryCode(value)\n set_input(\"CountryCode\", value)\n end", "title": "" }, { "docid": "da40af3d13ee1b88fd9eb9a9b5ccc5ba", "score": "0.5865472", "text": "def set_CountryCode(value)\n set_input(\"CountryCode\", value)\n end", "title": "" }, { "docid": "11680d1ece99b36c64deadecdcf6c49c", "score": "0.5857027", "text": "def country_params\n params.require(:country).permit(:name, :c_code, :telephone_code)\n end", "title": "" }, { "docid": "88bd51fd315cc8149b80feb2a70abc3c", "score": "0.58333904", "text": "def country_codes; end", "title": "" }, { "docid": "88bd51fd315cc8149b80feb2a70abc3c", "score": "0.58333904", "text": "def country_codes; end", "title": "" }, { "docid": "88bd51fd315cc8149b80feb2a70abc3c", "score": "0.58333904", "text": "def country_codes; end", "title": "" }, { "docid": "88bd51fd315cc8149b80feb2a70abc3c", "score": "0.58333904", "text": "def country_codes; end", "title": "" }, { "docid": "88bd51fd315cc8149b80feb2a70abc3c", "score": "0.58333904", "text": "def country_codes; end", "title": "" }, { "docid": "88bd51fd315cc8149b80feb2a70abc3c", "score": "0.58333904", "text": "def country_codes; end", "title": "" }, { "docid": "842aa744ea9c6d0634224ed92c701516", "score": "0.5828337", "text": "def iban_country_code; end", "title": "" }, { "docid": "a03d9820465603055e0d5d29f460bf70", "score": "0.58256793", "text": "def set_CountryCode(value)\n set_input(\"CountryCode\", value)\n end", "title": "" } ]